Using Created and Created By in Forms

Home Forums Classic DFFS Using Created and Created By in Forms

Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #19860
      Keith Hudson
      Participant

        I have a list in which I have changed the name of the “Created” field to “Date Requested” and the “Created By” field to “Requestor”. I would like to be able to place those fields on tabs within my DFFS form, but they do not appear in the field picker when adding a field to the tab. Is this expected behavior?

        I am using the version of DFFS dated 2018-02-12.

      • #19896
        Alexander Bautz
        Keymaster

          Hi,
          Yes, this is sort of “by design” because these fields are not part of the fields available to use in a form. I guess I could make it appear in the field picker somehow, but you might be able to fix it in your form like this.

          Start by adding a HTML section in the tab with the Unique ID “CreatedBy”.Then add this to the Custom JS:

          (function addCreatedByToTab(){
              var b = [];
              b.push("<tr>");
              b.push("<td class='ms-formlabel'>");
              b.push("<span class='ms-h3 ms-standardheader'>Created by</span>");
              b.push("</td>");
              b.push("<td class='ms-formbody'>");
              b.push(spjs.dffs.beforeProperties.Author[0]);
              b.push("</td>");
              b.push("</tr>");
              jQuery("#dffsHTML_CreatedBy").replaceWith(b.join(""));
          })();

          Alexander

        • #28151
          Vidya
          Participant

            Hi Alexander,

            I tried the above customJS and getting this error, please see attched.

            Thanks,
            Vidya

            • #28154
              Alexander Bautz
              Keymaster

                Are you trying to use this in NewForm? – if so, the Author property is not available because the item hasn’t been saved yet.

                Alexander

            • #28158
              Vidya
              Participant

                Yes i was….sigh…thank you!

            Viewing 3 reply threads
            • You must be logged in to reply to this topic.