Using Created and Created By in Forms

Forums Dynamic Forms for SharePoint Using Created and Created By in Forms

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 4 months, 1 week ago.

  • 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

You must be logged in to reply to this topic.