Jeff Lynch

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Resource Management #30578
    Jeff Lynch
    Participant

    thank you, that’s what I suspected.

    in reply to: vLookup ID – Word Files #22613
    Jeff Lynch
    Participant

    I would like to be able to add a folder or subfolder and then automatically upload to that folder, or choose a subfolder.
    When i leave the upload to this folder field blank i do not get a choice of folders as the help icon indicates. how can this be achieved?

    in reply to: Require vLookup Values on New form #21888
    Jeff Lynch
    Participant

    only change is on the first two message strings add \n to the end for a new line.

    in reply to: Require vLookup Values on New form #21886
    Jeff Lynch
    Participant

    Final solution – save New Form and continue on to Edit form with dffs special feature, then use this code to build the error message:

    function dffs_PreSaveAction(){
    var hasChildren = false;
    var hasChildren1 = false;
    var hasChildren2 = false;
    var message=””;

    if(spjs.vLookup.dataObj[“vLookupItems”] !== undefined && spjs.vLookup.dataObj[“vLookupItems”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupItems”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren = true;
    }
    if(spjs.vLookup.dataObj[“vLookupW9”] !== undefined && spjs.vLookup.dataObj[“vLookupW9”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupW9”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren1 = true;
    }
    if(spjs.vLookup.dataObj[“vLookupContract”] !== undefined && spjs.vLookup.dataObj[“vLookupContract”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupContract”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren2 = true;
    }
    if(!hasChildren){
    message += “You must add an Item to this request”;

    if(!hasChildren1){
    message += “You must add the W9 to this request”;

    }
    if(!hasChildren2){
    message += “You must add the Contract to this request”;

    }
    if (message != “”){
    alert(message);
    return false;}
    return true;

    }

    in reply to: Require vLookup Values on New form #21884
    Jeff Lynch
    Participant

    On testing the validation does not work on a New Form because it always returns spjs.vLookup.dataObj as undefined in a new form. It works in the edit for so I will have to have the user click create and continue editing on New Form it appears.

    Is there a way to make it work on the new form? I would think it would be difficult.

    in reply to: Require vLookup Values on New form #21882
    Jeff Lynch
    Participant

    this works great. now they want multiple vLookups to be required, I’m thinking add it to the same function so like this…

    function dffs_PreSaveAction(){
    var hasChildren = false;
    var hasChildren1 = false;
    var hasChildren2 = false;

    if(spjs.vLookup.dataObj[“vLookupItems”] !== undefined && spjs.vLookup.dataObj[“vLookupItems”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupItems”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren = true;
    }
    if(spjs.vLookup.dataObj[“vLookupW9”] !== undefined && spjs.vLookup.dataObj[“vLookupW9”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupW9”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren1 = true;
    }
    if(spjs.vLookup.dataObj[“vLookupContract”] !== undefined && spjs.vLookup.dataObj[“vLookupContract”][spjs.dffs.data.thisItemID] !== undefined && spjs.vLookup.dataObj[“vLookupContract”][spjs.dffs.data.thisItemID].count > 0){
    hasChildren2 = true;
    }
    if(!hasChildren){
    alert(“You must add an Item to this request”);
    return false;
    }
    if(!hasChildren1){
    alert(“You must add the W9 to this request”);
    return false;
    }
    if(!hasChildren2){
    alert(“You must add the Contract to this request”);
    return false;
    }
    return true;

    }

    question is will it throw all three errors or just the first one with this…I’ll test and see.

    in reply to: Require vLookup Values on New form #21857
    Jeff Lynch
    Participant

    yes i did that, this was just the base code:

    function dffs_PreSaveAction(){
    var hasChildren = false;
    if(spjs.vLookup.dataObj[“vLookupItems”] !== undefined){
    hasChildren = true;
    }
    if(!hasChildren){
    alert(“You must add items before you can save the PRF!”);
    return false;
    }
    return true;
    }

    in reply to: Redirect from NewForm to EditForm in DFFS #19525
    Jeff Lynch
    Participant

    I am having a very hard time getting a lookup field to populate as an additional field.
    I’ve pulled it out in console.log and it is a string and it is populated with getFieldValue but i get a generic error “The operation failed because an unexpected error occured”.

    I pulled the value out and set it as a variable…same result here is my code, any ideas on how to populate a Lookup field?

    function saveAndRedir(){
    var ok = spjs.dffs.check_Mandatory([“Title”]), data = {}, newItem, url;
    var subcat = getFieldValue(“Sub_x0020_Category”);
    if(ok){
    data.Title = (“Title”);
    data.Sub_x0020_Category = subcat;

    newItem = spjs.utility.addItem({“listName”:_spPageContextInfo.pageListId,”data”:data});
    if(newItem.success){
    url = location.pathname.substring(0,location.pathname.lastIndexOf(“/”)) + “/EditForm.aspx?ID=”+newItem.id;
    if(GetUrlKeyValue(“IsDlg”)===”1″){
    url += “&IsDlg=1”;
    }
    location.href = url;
    }else{
    alert(newItem.errorText);
    }
    }
    }

    function PreSaveAction(){
    saveAndRedir();
    return false;
    }

    in reply to: Multiline Textfield Read-only #16638
    Jeff Lynch
    Participant

    I’m trying to implement this and it comes back as “undefined” what might I have missed here. We had issues with the field internal name because it had underscores that were converted to the code, before changing them we got a syntax error due to the field internal name, after changing it to underscores it just comes back as undefined.

    Here is the function:
    function appendHistory(){
    var history = $(“#dffs_Worklog_x0020_History”).find(“td.ms-formbody div.dffs_tdWrap div”).has(“a”).html();
    $(“#dffs_Worklog_x0020_History”).find(“td.dffs-readonly-inner div.dffs_tdWrap”).append(“”+history+””);
    }

    and here is the field internal name the way it appears: Worklog%5Fx0020%5FHistory

    again with the original field internal name we get a syntax error, and with the modified name we get “undefined”

    Jeff Lynch
    Participant

    one issue with the first part, if you open the display form first and then click the edit from there, it does not work, it appears the return path after the ID breaks it, any fix for that?

    in reply to: display lookup sub-field info on newform for read only use #15939
    Jeff Lynch
    Participant

    this works great, is there a fast easy way to add a button to edit the parent list in a dialog box from the newform and editform?

Viewing 11 posts - 1 through 11 (of 11 total)