Notrega

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • in reply to: Send vLookup data in workflow email (2023 version) #36612
    Notrega
    Participant

      Never mind, I figured it out…

      in reply to: Link to DFFS Backend Missing on New Site Install #29215
      Notrega
      Participant

        Nevermind – I think I have it… Had to turn off InfoPath

        in reply to: Link to DFFS Backend Missing on New Site Install #29212
        Notrega
        Participant

          Here is the screenshot of the installer – Clicking the Direct to Backend just opens the form

          Attachments:
          in reply to: Send vLookup data in a workflow email #28163
          Notrega
          Participant

            So I figured it out… here is how to call multiple vLookups to multiple multi-line fields… I had been duplicating the whole code for each vLookup, but it only needs the information in the first function.

            
            
            function dffs_PreSaveAction() {
                write_vLookup_to_multiline({
                    "fin": "vLookupShiftAssignments", // Name of vLookup column #1
                    "writeTo": "ShiftAssignments", // Name of field to write to
                    "groupBy": "Category_" // Name of field to group by
                });
                    write_vLookup_to_multiline({
                    "fin": "vLookupSecurityInspection", // Name of vLookup column #2
                    "writeTo": "SecurityInspection", // Name of field to write to
                    "groupBy": "InspectionComplete" // Name of field to group by
                });
                write_vLookup_to_multiline({
                    "fin": "vLookupContrabandInspection", // Name of vLookup column #3
                    "writeTo": "ContrabandInspection", // Name of field to write to
                    "groupBy": "Mod" // Name of field to group by
                });    
                return true;
            
            }
            
            function write_vLookup_to_multiline(arg) {
                var b = [], val, arr = [];
                b.push("<table cellpadding='4' cellspacing='0' class='vLookupText'>");
                // Header row
                b.push("<tr>");
                jQuery.each(spjs.vLookup.dataObj[arg.fin][spjs.dffs.data.thisItemID].fields, function (fin, disp) {
                    b.push("<th valign='top' class='vLookupTextth'>" + disp + "</th>");
                });
                b.push("</tr>");
                // Body - make array of items
                jQuery.each(spjs.vLookup.dataObj[arg.fin][spjs.dffs.data.thisItemID].items, function (i, item) {
                    arr.push(item);
                });
                // Sort by groupBy field
                arr.sort(function (a, b) {
                    if (a[arg.groupBy] < b[arg.groupBy]) {
                        return -1;
                    }
                    if (a[arg.groupBy] > b[arg.groupBy]) {
                        return 1;
                    }
                    return 0;
                });
                var groupHeaderTracker = {};
                jQuery.each(arr, function (i, item) {
                    if (groupHeaderTracker[item[arg.groupBy]] === undefined) {
                        groupHeaderTracker[item[arg.groupBy]] = true;
                        b.push("<tr>");
                        b.push("<td style='padding:5px; valign:top; border:none;'>" + item[arg.groupBy] + "</td>");
                        b.push("</tr>");
                    }
                    b.push("<tr>");
                    jQuery.each(spjs.vLookup.dataObj[arg.fin][spjs.dffs.data.thisItemID].fields, function (fin, disp) {
                        val = item[fin] !== null ? item[fin] : "";
                        val = val.split("<").join("<").split(">").join(">");
                        b.push("<td valign='top' class='vLookupTexttd' style='" + (i % 2 === 1 ? "background-color:#eaeaea;" : "") + "'>" + val + "</td>");
                    });
                    b.push("</tr>");
                });
                b.push("</table>");
                setFieldValue(arg.writeTo, b.join(""));
            }
            • This reply was modified 4 years, 10 months ago by Notrega.
            in reply to: Send vLookup data in a workflow email #28067
            Notrega
            Participant

              No error… We found the vlookup had to be on the active tab. We fixed the no save issue but still need help with the multiple calls.

              in reply to: Send vLookup data in a workflow email #28060
              Notrega
              Participant

                Hey Alex – hope your holiday season is going great.

                We are successfully using the code above in several lists, but are having issues using multiple instances of the code at the same time. Basically we have a list that has 6 vLookups that we want to write them to multiline fields so that we can eventually archive the vLookup records and still maintain a snapshot of the data in the parent record.

                The issue is that we can get them all to work, then some stop working. So we remove 5 and leave one, it works for maybe a few records and then prevents the users from saving the parent record.

                Is there a better way to accomplish what we need or different code we can use?

                in reply to: DFFS does not recognize workflow created list record #27064
                Notrega
                Participant

                  Hey Alexander – This is working wonderfully with one issue… if somehow the user gets to the point that creating the new record is ready, but gets a Save Conflict error… What happens is when they refresh or cancel the new record is created. They then go back and attempt to enter more information and a second new record is created… sometimes as many as 4-5 depending on how persistent the user is.

                  Is there anything that can check and see if the record is already there and not create a newer one?

                  in reply to: Send vLookup data in a workflow email #26369
                  Notrega
                  Participant

                    I have the vLookup view grouped and sorted… see the image attached.
                    What I am wanting grouped and/or sorted is the multiline field that goes in the email, something similar to the vlookup view in the item.

                    Attachments:
                    in reply to: Send vLookup data in a workflow email #26297
                    Notrega
                    Participant

                      Last question – is there way to sort or group the view?

                      in reply to: Send vLookup data in a workflow email #26295
                      Notrega
                      Participant

                        You sir are a fricking genius – THANK YOU!!
                        Beers on me on payday

                        in reply to: Send vLookup data in a workflow email #26287
                        Notrega
                        Participant

                          Changed field names and still no go, but here is what I got out of Console View –

                          in reply to: Send vLookup data in a workflow email #26285
                          Notrega
                          Participant

                            I can’t seem to get this to work. I followed the directions and changed vLookupTask with my field name vLookupItem and Multiline with my field name Email_Text, but now it won’t let me save the record at all…

                            in reply to: CAML Query Assistance for vLookup #25658
                            Notrega
                            Participant

                              Forgot to add – the DateV field is the day# of the year… 6/9/2019 = 160
                              The DateV is meant to check to see if the ShiftDateV falls between the Start/End DateV

                              Notrega
                              Participant

                                Well… my colleague did all the work… I just asked you the questions. LOL
                                Seriously though it works perfectly and is exactly what we needed.

                                Notrega
                                Participant

                                  Beers on me Friday (payday)!!!

                                Viewing 15 posts - 1 through 15 (of 25 total)