Automate

 View Only
  • 1.  Javascript to add dynamically add rows to Repeating Content Table

    Posted 15 hours ago

    I am looking for a method to dynamically add additional rows to a repeating table.

    The following works to add to the first line: if (org == '1000' && ctry == 'CA') it sets the value of GST

    How do I added a second line: if(org == '1000' && ctry == 'CA' && reg=='QC') to set the value of QST

    function canadaTax() {
        debugger;
        var ctry = $form.getValue('/my:myFields/my:Country');
        var reg = $form.getValue('/my:myFields/my:Region');

        var org = $form.getValue('/my:myFields/my:Sales_Organization');
        var gst = "GST";
        var qst = "QST";
        if (org == '1000' && ctry == 'CA') {
            var rowNumber = count('/my:myFields/my:LineItems1/my:Repeating_Content/my:Text_Line_3','[^\\s]');
            var xPath = '/my:myFields/my:LineItems1/my:Repeating_Content['+(rowNumber)+']/my:Text_Line_3';
            $form.setValue(xPath, gst);
            }
    }

    Thanks,

    Puff



    ------------------------------
    Kurt Marshman
    Old World Industries, LLC
    ------------------------------


  • 2.  RE: Javascript to add dynamically add rows to Repeating Content Table

    Posted 2 hours ago

    hi,

    I am using:

    $form.addNewRow('/my:myFields/my:Repeating_Table_conditions');

    around this you can have IF statements etc.

    always be aware that first row in a rep.tab. is row 0

    Hope this helps.



    ------------------------------
    Ed Meiners
    Lead Consultant MDIM
    Wessanen Nederland Holding BV
    Amsterdam
    ------------------------------