PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03/27/2017 11:55 AM by  TimC
jscript function return object or JSON object
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages
TimC
Systems Analyst
Private
Veteran Member
(220 points)
Veteran Member
Posts:84


Send Message:

--
03/27/2017 11:55 AM

    Use Case:

        Have central flow that returns a structure of 2 dates: paymentDate and payThroughDate;

         I tried two techniques that I debugged in VisualStudio and they work there. So, pasted them in to an Assign script var.

     

    Abridged Version

    subFlow:

    function calcDates(frequency)

    {

         logicToCalcDates;

         var pDates

         pDates = {"paymentDate":paymentDate,"payThroughDate":payThroughDate}  //JSON object

         /*

            or,

            pDates = function(){}  //jscript object

            pDates.paymentDate = paymentDate

            pDates.payThroughDate = payThroughDate

         */

         return pDates    

    }

     

    the calling script (same flow)

    Assign node

    pDates = eval(calcDates("TUESDAY"))

    paymentDate = pDates.paymentDate

    payThroughDate = pDates.payThroughDate

    At this point, both the above vars are "undefined"...... Hmmm...

     

    You are not authorized to post a reply.