Set Content Type

Forums Classic DFFS Set Content Type

Viewing 1 reply thread
  • Author
    • #33353
      Paul Lynch

      Hi Alexander,

      I am not a fan of using Content Types when DFFS can effectively replace their necessity. But I have an old list that I am trying to implement it on that needs to keep their three content types.

      The issue I have is that I want to use the Query URL parameter to create a new form, but also to set the content type at the same time.

      Idea 1 – Somehow incorporate the Query URL parameter into the button url, so that it also sets content type?

      Here is my custom link to add an item to the list:

      Idea 2 – After the normal “Item” content type is created, when user sets a field, it sets the content type.

      Sets Field=A – rule or JS does nothing
      Sets Field=B – rule or JS sets Content Type B
      Sets Field=C – rule or JS sets Content Type C

      I’ve been trying to do this without success in the NewForm or EditForm using a rule (which I debug checked is running) but nothing changes in form (I have content type field visible in edit form).

       setFieldValue("ContentTypeId", "0x010003D8415BFE122145BE9C8717F2580443003FAB0C9E7156E94DA988BEF82E06218E");
        setFieldValue("ContentType", "Type B");

      Kind Regards,

    • #33358
      Alexander Bautz

      The first option (with ContentTypeId=0x010003D8415BFE122145BE9C8717F2580443003FAB0C9E7156E94DA988BEF82E06218E in the URL) is the one you want to use in NewForm as the content type selector is not visible.

      In EditForm the item will have it’s content type already set, but if you want to use custom js to change it you must use the fieldInternalName “ContentTypeChoice” like this:

      setFieldValue("ContentTypeChoice", "Type B");


Viewing 1 reply thread
  • You must be logged in to reply to this topic.