Search Results for 'list form'

Home Forums Search Search Results for 'list form'

Viewing 15 results - 91 through 105 (of 1,358 total)
  • Author
    Search Results
  • #37245
    Jorah Lavin
    Participant

      We’ve been building DFFS-enabled forms on sites all over our SP Online sites, and now I’ve been asked to inventory which sites and forms have been set up this way. I was able to pull a list of our sites with the app catalog enabled, so I know which of my sites have DFFS on them, but I can’t find a way (other than opening each list and clicking the New button) to see if any of them have DFFS enabled.

      Is there a way to identify these lists?

      Thanks for any help!

      -Jorah

      Wayne Thompson
      Participant

        Hi Alexander,

        I noticed the web part you added which enables showing a new form on a SharePoint page. This is really useful! I have been playing around with it and it seems to be working correctly overall – just like the new form works when in a list.

        I did notice one slight difference, though, in regard to the NewForm. When showing the new form on a SharePoint page using the Modern DFFS webpart, there is no permission to add or edit content in a Multiple lines of text column. When viewing an item’s new form in a Site Page via the new web part, the “Edit” pencil button is not active. Is this by design, or would it be possible to have the “Edit” pencil button available and active like it is when viewing a NewForm item directly in a list?

        Thank you!

        #37183
        Marcus Khoo
        Participant

          Sorry, this is the question I meant to ask.

          I have already created DFFS forms and they mostly work fine.

          I have 40 lists and hence 120 DFFS forms

          I can only add the JSON formatting suggested in this post, to the “original” SharePonit form.

          How do I access the original form in order to put the JSON formatting in place when everytime I open the forms now I get the DFFS form?

          Is there a quick way to temporary “disable” the DFFS form so I can add the JSON to the “original” form?

          Thanks

          #37142
          Marcus Khoo
          Participant

            Hi Alexander,

            Reporting an error between Display and Edit form:

            If I Display an item using the Displkay form (that was created in a previous version of DFFS Modern ) and try the Edit button (i.e. to display the edit form from the display form), I get the attached error.

            Strangely, if I select “Edit” directly from the list elipses menu on the List, then it opens the Edit form correctly.

            /Marcus

            #37123

            In reply to: Autocomplete Issue

            Alexander Bautz
            Keymaster

              Here is an example. Add it to your NewForm and configure the spjs.ac.textField call to match your field and the arrOfFieldsToPrefill to include all the fields you want to prefill.

              spjs.ac.textField({
                "applyTo": "Name_of_autocomplete_field",
                "helpText": "Start typing",
                "loadText": "Searching...",
                "listGuid": _spPageContextInfo.pageListId,
                "listBaseUrl": _spPageContextInfo.webServerRelativeUrl,
                "showField": "Title",
                "searchFields": ["Title"],
                "filterCAML": "",
                "useREST": true,
                "preloadData": false,
                "filterREST": "",
                "optionDetailFields": [],
                "optionDetailPrefix": [],
                "enforceUniqueValues": false,
                "rowLimit": 15,
                "listOptionsOnFocus": true,
                "minLengthBeforeSearch": 1,
                "reValidateOnLoad": true,
                "allowAddNew": true,
                "isLookupInSelf": false,
                "addNewAdditionalFields": [],
                "multiselect": false,
                "multiselectSeparator": "; ",
                "orderBy": [],
                "clearSetFieldsOnInvalidSelection": true,
                "setFields": [{
                  "fromFIN": "ID",
                  "joinBy": "",
                  "toFIN": "DUMMY_USING_CUSTOM_JS",
                  "parseFunction": "getSelectedItemAndPrefill",
                  "skipIfEmpty": false
                }],
                "debug": false
              });
              
              function getSelectedItemAndPrefill(id) {
                var arrOfFieldsToPrefill = [
                  "Field_1",
                  "Field_2",
                  "Field_3"
                ];
              
                var select = [];
                var expand = [];
              
                arrOfFieldsToPrefill.forEach(fin => {
                  var type = spjs.dffs.fieldtype[fin];
                  console.log(type);
                  switch (type) {
                    case "SPFieldUser":
                    case "SPFieldUserMulti":
                      select.push(fin + "/Name");
                      expand.push(fin);
                      break;
                    case "SPFieldLookup":
                    case "SPFieldLookupMulti":
                      select.push(fin + "Id");
                      break;
                  }
                });
              
                jQuery.ajax({
                  "url": _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getbyid('" + _spPageContextInfo.pageListId + "')/items(" + id + ")?$select=*," + select.join(",") + "&$expand=" + expand.join(","),
                  "method": "GET",
                  "headers": {
                    "Accept": "application/json;odata=verbose",
                    "content-type": "application/json;odata=verbose"
                  },
                  "success": function (data) {
                    arrOfFieldsToPrefill.forEach(fin => {
                      var item = data.d;
                      var type = spjs.dffs.fieldtype[fin];
                      var val;
                      switch (type) {
                        case "SPFieldUser":
                          val = item[fin];
                          if (val.Name !== undefined) {
                            setFieldValue(fin, val.Name);
                          }
                          break;
                        case "SPFieldUserMulti":
                          val = item[fin];
                          if (val.results !== undefined) {
                            val.results.forEach(user => {
                              if (user.Name !== undefined) {
                                setFieldValue(fin, user.Name);
                              }
                            });
                          }
                          break;
                        case "SPFieldLookup":
                          val = item[fin + "Id"];
                          if (val !== null) {
                            setFieldValue(fin, val);
                          }
                          break;
                        case "SPFieldLookupMulti":
                          val = item[fin + "Id"];
                          setFieldValue(fin, val.results);
                          break;
                        case "SPFieldMultiChoice":
                          val = item[fin];
                          if (val !== null && val.results !== undefined) {
                            setFieldValue(fin, val.results);
                          }
                          break;
                        case "SPFieldTaxonomyFieldType":
                          val = item[fin];
                          if (val !== null) {
                            setFieldValue(fin, val.Label);
                          }
                          break;
                        case "SPFieldTaxonomyFieldTypeMulti":
                          val = item[fin];
                          if (val !== undefined && val.results !== undefined) {
                            var arr = [];
                            val.results.forEach(tax => {
                              arr.push(tax.Label);
                            });
                            setFieldValue(fin, arr);
                          }
                          break;
                        case "SPFieldURL":
                          val = item[fin];
                          if (val !== null) {
                            setFieldValue(fin, val.Url + "," + val.Description);
                          }
                          break;
                        case "SPFieldDateTime":
                          val = item[fin];
                          if (val !== null) {
                            spjs.utility.setDateFieldFromDateObject(fin, new Date(val));
                          }
                          break;
                        default:
                          val = item[fin];
                          if (val !== null) {
                            setFieldValue(fin, val);
                          }
                          break;
                      }
                    });
                  },
                  "error": function (data) {
                    console.log(data);
                  }
                });
              }
              

              Alexander

              #37119

              In reply to: Autocomplete Issue

              Alexander Bautz
              Keymaster

                The reason you only see one is that “Cast name” is not unique. The way this works, the “ShowField” value must be unique. To achieve this you can concatenate for example CAST_x0020_Name and Title in a calculated column and use that new field as “ShowField”.

                What kind of fields are there in this list? – the code would have to query the other list item and will retrieve the data stored in sharepoint and not the “display value” used in the form. This means people pickers, multichoice fields, lookup fields and date fields must be manipulated before it can be filled into the form.

                I have some functions to copy an item already in the forum, but can write up a new example if I know what kind of fields you are using.

                Alexander

                #37114
                Saikia Kashmiri
                Participant

                  Hi Alex,

                  Have two items –

                  1. I am trying to use Autocomplete on a lookup field in a form, where a user enters a record ID or record name and the search is run on two other fields from the *same* list. If a match is found and selected, it will populate the rest of the current form fields with info from the selected record.
                  My issue is, whenever more than one match is found, the drop down only displays one result. The debug mode shows all the matches.

                  2. My records have about 120+ fields and I need all of them to be copied over to the current form whenever a match is selected – Do I have to write 120+ blocks under “setFields” or is there a simpler way to copy the entire record into the current record and leave open for editing?

                  PS: Reg the first issue. it occurred on both (DFFS v4.4.5.47 – July 30, 2023||spjs-utility version: 1.356|Loader version: v2) and (DFFS v4.4.5.34 – October 15, 2021||spjs-utility version: 1.354|Loader version: v1).

                  Thanks as always!

                  #37108

                  In reply to: CommentBox Basics

                  Alexander Bautz
                  Keymaster

                    Hi,
                    Yes, it requires a separate license: https://spjsblog.com/commentbox-for-sharepoint/#Buy_a_license

                    There is a built in trial period, and you can get an extended trial if you need that.

                    You do not need to add any columns to the parent list item, but you must add the placeholder for the comments (in line 2 of spjs-cBox_CEWP.html) to a HTML section in your form.

                    It has been some time since I tried cBox in DFFS, but if you have added all the scripts (DO NOT ADD JQUERY – it is already loaded) in the top of the spjs-cBox_CEWP.html file in the textarea at the top of your custom js tab and ensured that all paths to the files are correct and you still get this error, you can try wrapping the function call and the license code setting in line 16 inside a function named dffs_ready – like this:

                    function dffs_ready(){
                      /* Add license code here */
                      spjs.cBox.licenseCode = "";
                      /* Configuration object */
                      var cBoxArg = {
                        ....
                        // the rest of the argument object here
                        ....
                      }
                    }
                    

                    Please remember to add the cBox css file link to the top of the custom css tab.

                    Alexander

                    #37107
                    Saikia Kashmiri
                    Participant

                      Hey Alex!
                      Took a long break!
                      I was trying to work out CommentBox per your reply here (https://spjsblog.com/forums/topic/chevron-above-tabs-showing-status/#post-37099).

                      So some basic questions – Prior to following the instructions you provided and the ones in this link (https://spjsblog.com/commentbox-for-sharepoint/installation-manual-v3/#Updating_from_an_older_version&#8221), do I need to purchase a license for CommentBox separately? I’ve only purchased DFFS license so far (Dynamic Forms for SharePoint v4.4.5.34 – October 15, 2021||spjs-utility version: 1.354|Loader version: v1).

                      Also do I need to add specific columns to the parent list (like we do in vLookup) to start using this feature?

                      Lastly, after following the steps in your response, I am getting the error “TypeError:Cannot set properties of undefined (setting ‘licenseCode’)” .. basically it’s not recognizing spjs.cBox …

                      Thank you!

                      #37084
                      Alexander Bautz
                      Keymaster

                        1: To do that you must use the Check out list items functionality in the Misc tab of your EditForm.

                        2: You can create a rule to set the fields as readonly. If you need to have multiple conditions you can create for example a rule triggering on SharePoint group membership: Logged in users is member of group” to detect that the user is in the target group, and then use this rule in the “Linked rules and functions” section on the second rule that triggers on “Selected tab index / Tab unique ID”.

                        You can add multiple rules to the “Linked rules and function” to include for example the “Sizing in progress” status.

                        I’m not sure I understand what you mean by making it editable upon request. How would they request it?

                        Giving edit access could for example be done by adding them to a multichoice people picker and use a rule to make the fields editable if the user is selected in the people picker.

                        3: Yes, you can set the width of each columns in the vLookup configuration. Specify the width in px and it should push the width of your table.

                        You can style the vLookup table using normal CSS. Add something like this to your Custom CSS tab:

                        .vLookupTable{
                            border:1px #cccccc solid;
                            padding:10px;
                        }
                        

                        Alexander

                        Saikia Kashmiri
                        Participant

                          Hey Alex – THANK YOU for your help with the problem yesterday! My colleague helped to get it working!

                          Have a some more questions –

                          1. Is there a way to show the name of the person currently editing a list item on the top of the form if someone else opens it at the same time? Something like
                          “John Smith is editing the form right now. Please coordinate your changes with them”.

                          2. I need to make some tabs non editable to a certain group after the status has moved to say “Sizing In Progress” (AND make it editable upon request). What would be an elegant way of doing that?

                          3. Can I expand the width of the vlookup box and put a border around it? Right now a comments column is wrapping up very narrow.

                          Appreciate your help as always.

                          #37078
                          Alexander Bautz
                          Keymaster

                            You can show the items pending sizing by adding this code to your parent form custom js:

                            (function() {
                                let allTeams = ["Brick supplier", "Metal supplier", "Plumbing", "Electric"];
                                let allSizing = spjs.utility.queryItems({
                                    "listName": "SupplierSizing",
                                    "query": "<Where><Eq><FieldRef Name='_vLookupParentID' /><Value Type='Text'>" + getFieldValue("_vLookupID") + "</Value></Eq></Where>",
                                    "viewFields": ["ID", "Title", "EffortSizing"]
                                });
                                if (allSizing.count < 0) {
                                    alert("ERROR\n" + allSizing.errorText);
                                    return;
                                }
                                // Loop over all items and find the ones not
                                let completedTracker = {};
                                allSizing.items.forEach(item => {
                                    completedTracker[item.Title] = item.EffortSizing !== null;
                                });
                                // Loop over allTeams and find the ones not completed.
                                let stillPending = [];
                                allTeams.forEach(team => {
                                    if (completedTracker[team] === undefined) {
                                        stillPending.push(team);
                                    }
                                });
                                // Write status to placeholder added in a HTML section in the form
                                let statusText = "<div style='font-size:1.5rem;'>No pending sizing</div>";
                                if (stillPending > 0) {
                                    statusText = "<div style='font-size:1.5rem;'>Pending sizing:</div><br>" + stillPending.join("<br>");
                                }
                                document.querySelector("#pending_sizing_placeholder").innerHTML = statusText;
                            })();
                            

                            You must replace the listName to match. In this example, the team name of the child items are stored in the Title column. Change all occurrences of Title if you use another field.

                            Also change the allTeams array to list the team names used in the child items.

                            To show the status in your form you must add a HTML section (or a heading or table row) and add the placeholder div like this:

                            <div id="pending_sizing_placeholder"></div>
                            

                            Marking the parent item status as “Completed” is done using the original “Write back to parent” code I provided here.

                            Alexander

                            Alexander Bautz
                            Keymaster

                              Yes, you can use the vLookup plugin to create the four “Supplier sizing items” and assign these to the correct “Sizing team”. You must use a FLOW or Workflow on the “Supplier sizing” list to send the assigned person an email with a link to the list item. When they edit the item, the below code will write back to the parent list item – add it to the EditForm Custom JS in the “Supplier sizing” list.

                              Please note that the code assumes that you have set up the vLookup connection as described in the setup example in my website (using _vLookupID > _vLookupParentID). You must also edit the code to set the correct list names and field names (internal name of fields).

                              function dffs_PreSaveAction() {
                                  var parentItemRes = spjs.utility.queryItems({
                                      "listName": "BuildingRequirements",
                                      "query": "<Where><Eq><FieldRef Name='_vLookupID' /><Value Type='Text'>" + getFieldValue("_vLookupParentID") + "</Value></Eq></Where>",
                                      "viewFields": ["ID"]
                                  });
                                  if (parentItemRes.count > 0) {
                                      var parentItem = parentItemRes.items[0];
                                      var allSiblings = spjs.utility.queryItems({
                                          "listName": _spPageContextInfo.pageListId,
                                          "query": "<Where><Eq><FieldRef Name='_vLookupParentID' /><Value Type='Text'>" + getFieldValue("_vLookupParentID") + "</Value></Eq></Where>",
                                          "viewFields": ["ID", "EffortSize"]
                                      });
                                      // The EffortSize field in this list must be set as required in EditForm
                                      var sum = Number(getFieldValue("EffortSize"));
                                      var allSizingDone = true;
                                      allSiblings.items.forEach(item => {
                                          // Only count the other child items and not the one that is being edited
                                          if (item.ID !== spjs.dffs.data.thisItemID) {
                                              if (item.EffortSize === null) {
                                                  allSizingDone = false;
                                              } else {
                                                  sum += Number(item.EffortSize);
                                              }
                                          }
                                      });
                                      // Update parent
                                      var parentData = {
                                          "TotalRecSize": sum
                                      };
                                      if (allSizingDone) {
                                          parentData.SizingStatus = "Complete";
                                      }
                                      var update = spjs.utility.updateItem({
                                          "listName": "BuildingRequirements",
                                          "id": parentItem.ID,
                                          "data": parentData
                                      });
                                      if (update.success) {
                                          return true; // Save item
                                      } else {
                                          console.log(update.errorText);
                                          alert("An error occurred, try hitting save again.");
                                      }
                                  } else {
                                      alert("Parent item not found.");
                                  }
                              }
                              

                              If two users try to save at the exact same time, the users will get an alert message and must try saving again

                              Let me know if you have any questions.

                              Alexander

                              • This reply was modified 1 year, 9 months ago by Alexander Bautz.
                              • This reply was modified 1 year, 9 months ago by Alexander Bautz. Reason: Updated code snippet
                              • This reply was modified 1 year, 8 months ago by Alexander Bautz. Reason: Fixed query because < and > was removed by the browser
                              Saikia Kashmiri
                              Participant

                                Hi Alex – I have three questions –
                                I am attaching a mock set up of two tables/ lists –
                                1. Building Requirements (the main parent list)
                                2. Supplier Sizing (the vlookup list)

                                For every requirement record in “Building Requirements” list, there needs to be sizing from 4 entities in the “Supplier Sizing” list.
                                Status of the parent record stays “Incomplete” till all 4 effort sizes have been populated.

                                Question 1 ~~ As the sizes come in from each supplier, I would like to update the “Total Rec Size” field in the parent record in “Building Requirements” list with the total of all the sizes received.
                                Question 2 ~~ Upon receipt of all 4 sizes, I’d like to mark the status of the parent record “Complete”.

                                Is this achievable with DFFS (Version is v4.4.5.34.)?
                                And if yes, would you provide the rough directions to achieve this please?

                                And final question 3 ~~ How does conflict of two users trying to update the form showing the parent list play out in this scenario?

                                Many Thanks!

                                #37027
                                Saikia Kashmiri
                                Participant

                                  Hi Alex – I am using DFFS v4.4.5.34 – October 15, 2021||spjs-utility version: 1.354|Loader version: v1 and Sharepoint Server 2016.
                                  I am using a single list of about 150 fields and creating a form with several tabs to receive inputs into various groups of fields.

                                  My issue is – all the tabs on the New Item form are limited within a smaller window inside the browser window and one has to use a scroll bar to access lower fields. Is there any way to get rid of this please?

                                  I can control the horizontal scroll bar since as I can avoid too much side by side placement – but I cannot control the vertical.

                                Viewing 15 results - 91 through 105 (of 1,358 total)