Jon Whisman

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • in reply to: spjs.utility.addItem with people pickers? #30408
    Jon Whisman
    Participant

    Hi, thank you for that data. This works great for a user that has access to the site, but what about inserting people names that are not currently users of the site?

    Use case: creating a list item to assign to Joe Smith. Joe Smith will receive an email from the site, but Joe Smith does not actually use the site as all he needs from it is the email. We have many examples of sites that users do not access them, yet we send communications to them via the sites to call for action on various business processes and tasks.

    in reply to: dffs functions for hide save / cancel buttons? #29791
    Jon Whisman
    Participant

    Perfect, thank you.

    in reply to: trigger function on spjs.casc.add #29756
    Jon Whisman
    Participant

    Thank you, Alexander.

    I’m using jQuery UI with DFFS. Any way to detect an on change event for a date field? My code will run when I type a date, but not when I use the jqueryUI date selector widget.

    jQuery(“#dffs_Date1”).find(“input”).datepicker();

    in reply to: trigger function on spjs.casc.add #29740
    Jon Whisman
    Participant

    Thank you very much, Alexander! This worked for text field, but not the “select” drop down options for other fields.

    Would you happen to know how I can trigger a change event for sharepoint dropdown columns? I tried the below, but it does not work.

    jQuery(“dffs_FIELDNAMEHERE”).find(‘input”select’).on(“change”, function(){
    //my code
    });

    Jon Whisman
    Participant

    Here is what I have come up with – working beautifully.

    
    
    function checkForAttachments() {
        //check for a folder first
        var vLookupID = getFieldValue("_vLookupID","disp"); //vLookup ID from THIS item
        var res = spjs.utility.queryItems({
            "listName": "{LIST_GUID}", 
            "query": "<Where><Eq><FieldRef Name='VLOOKUP_INTERNAL_FIELD_NAME_FROM_CHILD_LIST' /><Value Type='Text'>"+vLookupID +"</Value></Eq></Where>",
            "viewFields": ["ID"]
        });
    
        if(res.count > 0){
            var folderID = res.items[0].ID; 
            window.console  &&  console.log("folderID = " + folderID);
            //query for child items in the folder
            var res = spjs.utility.queryItems({
                "listName": "{LIST_GUID}",
                "query": "<Where><Eq><FieldRef Name='VLOOKUP_INTERNAL_FIELD_NAME_FROM_CHILD_LIST'/><Value Type='Text'>"+vLookupID+"</Value></Eq></Where>",
                "viewFields": ["ItemChildCount"]
            });
            //window.console  &&  console.log(res);
            var IDAttachmentCount = res.items[0].ItemChildCount;
            window.console  &&  console.log("IDAttachmentCount = " + IDAttachmentCount);
                //split IDAttachmentCount by the # delimiter
                var attachmentCount = IDAttachmentCount.split('#');
                var attachmentCount = attachmentCount[1];
                window.console  &&  console.log("attachmentCount = " + attachmentCount);
                //check count and update Attachments? column
                if(attachmentCount > 0){
                    window.console  &&  console.log("Attachments found: updating attachments column to Yes");
                    setFieldValue("attachmentsYN", "Yes");
                    setFieldValue("attachmentCount", attachmentCount);
                }
    
                if(attachmentCount <= 0){
                    window.console  &&  console.log("No Attachments: updating attachments column to No");
                    setFieldValue("attachmentsYN", "No");
                    setFieldValue("attachmentCount", attachmentCount);  
                }
    
        }
        else {
            window.console  &&  console.log("no folder yet");
        }
    }
    Jon Whisman
    Participant

    The vLookup query is below. I set the current item vLookupID to a field “actionPlanID” in the child list, which is the document library.

    <Where><Or><Eq><FieldRef Name='actionPlanDocID'/><Value Type='Text'>[currentItem:_vLookupID]</Value></Eq><Eq><FieldRef Name='actionPlanID'/><Value Type='Text'>[currentItem:ID]</Value></Eq></Or></Where>
    Jon Whisman
    Participant

    Thanks – I’ve gotten the below, and in the attached file you’ll see the results of the console output. I am trying to get the ‘count’ into a variable so that I can it for other logic. What syntax do I use in the vLookup dataObj or the spjs.dffs.data to get the count from the result in the attached image?

    The function I have so far:

    
    
    function testDataLog(){
        window.console  &&  console.log(spjs.vLookup.dataObj['vLookupAttachments'][spjs.dffs.data.thisItemID]);
    }
    Attachments:
    in reply to: Update data in list B from list A on save #28252
    Jon Whisman
    Participant

    The above is working great for the initial solution, but I have a new need:

    Update the folder name name in a document library base don the vLookup item in the current item to the _vLookupParentID in the child item.

    I’m having difficulty re-naming the folder name (INT = FileLeafRef), but also understanding how to specify a different id in the child list to target.

    I want to target the vlookup column in the child list, matching to the vlookup column in the parent list. How to write this in the spjs.utility.updateItem?

    
    
        var res = spjs.utility.updateItem({
            "listName": "my_document_library_child_list",
            "id": getFieldValue("_vLookupID"), //vLookup ID in parent list
            "data": {
                "FileLeafRef": "NEW_FOLDER_NAME_TEST", // The Folder Name in the child library
            }
        });
    
        if (res.success) {
            // Updated successfully
        } else {
            alert(res.errorText);
            return false; // stops the save process
        }
    }
    in reply to: Update data in list B from list A on save #27383
    Jon Whisman
    Participant

    Sorry for my late reply.

    The cascading dropdown actually does pull back an ID (‘mentorID’) from the lookup list. I place this into a ‘mentorID’ field within the current item at the end of the cascade in the form. The ‘mentorID’ in the lookup list is set upon item creation via workflow from the lookup list ID field.

    With that, all I’m after is creating a new function I can do via dffs_PreSaveAction in the current item that will update certain fields in list B, doing a match against the ‘mentorID’ in the current item to the ‘mentorID’ in the lookup list.

    in reply to: Update data in list B from list A on save #27221
    Jon Whisman
    Participant

    Hi Alexander,

    To answer your question, what I’m after is the below.

    The person filling in list A uses the a cascading dropdown and selects a Mentor from list B. On Save (I’ll use the preSave function), the data in list B should be modified to update fields in list B as below:

    paired = yes
    set protegeID (ID from list A) into protegeID into list B.

    This way, I can use vLookup in a list view of list A to pull back data from list B of who list A people have been paired with from list B based on ID.

    Hope this makes sense. The workflow does the above at the moment, but randomly fails.

    Jon Whisman
    Participant

    Marvelous! Works without issues.

    Jon Whisman
    Participant

    Need some additional help if you can. Each time the tab is clicked, a new header is generated.

    Example: click into another tab, then back into the tab with the code above = a new header.

    Repeat this multiple times and I have multiple headers stacked on top of each other.

    I tried to clear the div content before the div is written so that any previous div’s would be deleted, but that did not work.

    Any suggestions or code to do a clear of any previously rendered headers before the new header is rendered?

    Jon Whisman
    Participant

    Worked beautifully, thank you!!!

    in reply to: Securing DFFS' settings/configuration list #24161
    Jon Whisman
    Participant

    Nacho,

    Not sure if this would help, but would using an obfuscator on your JS code help the matter to scramble the code a bit more and secure it further?

    Like so?

    http://www.javascriptobfuscator.com/Javascript-Obfuscator.aspx

    Jon Whisman
    Participant

    My teammate actually came upon the solution using DFFS. We have all of the questions in a master list and the form field labels are hidden via side by side indexes. The destination list (current list) has field for “question” and “answer”, and upon form load, the “questions” are being pre-filled with the values from the lookup list. The “answers” are just single line of text fields awaiting whatever they put in. When they save the form, we the answers, but also the exact text that was asked for the matching question.

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