Jeremy Smith

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Jeremy Smith
    Participant

    Nevermind my request for help. I realized I had not put similar code into the EditForm of the child pop-up window, only the NewForm. so nothing was triggering when I would edit.

    Once I added the code, it seemed to work. Still running more tests currently

    • This reply was modified 3 years, 9 months ago by Jeremy Smith.
    Jeremy Smith
    Participant

    After further testing, I am having trouble understanding why it isn’t executing. So once I click the Vlookup table and create an item, it carries back the items in the code and places the data into the parent form field. However, now if I go to edit the new item again, it doesn’t carry over the new changes made in the pop-up child form back to the parent:
    Tried the following to test:
    Trial 1:
    – Create a new parent form
    – Click the vlookup to create child pop-up form
    – Edit child form and click save
    – Pulls in original values from child to parent form field
    – Without saving Parent form, click the vlookup child form edit button and launch child form pop-up
    – edit and save
    – Nothing changes to parent form, not even triggering the parent form js code

    Trial 2:
    – Create a new parent form
    – Click the vlookup to create child pop-up form
    – Edit child form and click save
    – Pulls in original values from child to parent form field
    – Save parent form and exit
    – Reopen same parent itme
    – Click the vlookup child form edit button and launch child form pop-up
    – edit and save
    – Nothing changes to parent form, not even triggering the parent form js code

    Current code

    Parent:

    
    
    //Add content from child window to parent window field
    var setTracknumInterval = setInterval(function () {
        if(typeof tracknum !== "undefined" && typeof dCreated !== "undefined" && typeof rStatus !== "undefined" && typeof rFormType !== "undefined"){
            var newCounterField = getFieldValue("YOUR_COUNTER_FIELD");
            alert(newCounterField);
            alert(rStatus);
            setFieldValue("YOUR_COUNTER_FIELD", rFormType + ":" + tracknum + " : Date Created: " + dCreated + " : " + rStatus + "---" + newCounterField);
            clearInterval(setTracknumInterval);
        }
    }, 1000);

    Child Code:

    
    
    function dffs_PreSaveAction() {
        var tracknum = getFieldValue("Title");
        var dCreated = getFieldValue("DateCreated");
        var rStatus = getFieldValue("Status");
        var rFormType = getFieldValue("SystemRequest");
        window.parent.tracknum = tracknum;
        window.parent.dCreated = dCreated;
        window.parent.rStatus = rStatus;
        window.parent.rFormType = rFormType;
        return true;
    }

    What needs to be modified to make happen

    Jeremy Smith
    Participant

    Thank you for making the tweaks for this. It appears to be working as expected with the little bit of testing I have performed. If anything changes, I will reach back out. Again, thank you ๐Ÿ™‚

    Jeremy Smith
    Participant

    Attached a screenshot of the setup

    Jeremy Smith
    Participant

    I tried to adjust the code to work for what I was looking to do and it doesn’t seem to work.

    I built a temporary field for testing called YOUR_COUNTER_FIELD on the parent form
    I have my vlookup Child Form on the same page

    I added to the parent form this modified code:

    
    
    setInterval(function()
    {
            var currCount = getFieldValue("YOUR_COUNTER_FIELD");
            var newValue = tracknum;
            setFieldValue("YOUR_COUNTER_FIELD", newValue);
    },1000);

    and went into the vlookup child form and added this modified code:

    
    
    function dffs_PreSaveAction(){
        var tracknum = getFieldValue("Title");
        window.parent.tracknum
        return true;
    }

    When I launch the child form from the parent, it pulls up in a small dialog window in front of the parent form.
    I fill out the form field on the child (internalname = Title) and click save
    it then brings me back to the parent form and I click save
    it exits to the main list of items and I reopen and the field YOUR_COUNTER_FIELD is still blank

    I am not sure what I am doing incorrect, but then again, I am still learning here ๐Ÿ™‚

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