I am working on a form and my xlw file is getting really large, so I am trying to move some code to a function. I have multiple drop down items that can make up a series of levels. I am trying to populate a document variable with the levels that are selected. Here is what I have.
Function:
{fn fnDLseries(str1,str2)
{local strDLseries = ""
Cond
Case (str1 == "1" and str2 == "2") strDLseries = ""
case (str1 == "1" and str2 == "3") strDLseries = "(T1-T2, T2-T3)"
case (str1 == "1" and str2 == "4") strDLseries = "(T1-T2, T2-T3, T3-T4)"
case (str1 == "1" and str2 == "5") strDLseries = "(T1-T2, T2-T3, T3-T4, T4-T5)"
else ""
endcond
return strDLseries
}
}
Function Call:
{!document.tlif_pp = fnDLseries(document.dl_t1, document.dl_t2)}
My drop downs to create the levels are named “document.dl_t1 and document.dl_t2.” I am trying to populate a document variable named “document.tlif_pp” with the “strDLseries” value in the function depending on what levels are selected. Not having any luck. If I do If, Then statements in the function window, the code works fine, but my function does not. Here is information from a Mel Trace.
12/23/2013 13:26:24.259 INFO Process Id #20644 Thread Id #1 [MelTrace] results>Function
12/23/2013 13:26:24.259 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>end
12/23/2013 13:26:24.259 INFO Process Id #20644 Thread Id #1 [MelTrace] results>Function
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] >{!DOCUMENT.T_4668_932_1387400201 = fnDLseries(DOCUMENT.D_4668_206_1386971687, DOCUMENT.D_4668_865_1386971760)}
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>Document.D_4668_206_1386971687
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>"1"
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>Document.D_4668_865_1386971760
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>"5"
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>call FNDLSERIES("1", "5")
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>FNDLSERIES = Function
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>Function
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>return Function
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>Document.T_4668_932_1387400201 = Function
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] >>
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] Fire trigger: {CFMT(DOCUMENT.T_4668_932_1387400201, "", "\par Procedure Performed: ", "B", "\par ")}
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>>Document.T_4668_932_1387400201
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>>""
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>>call CFMT("", "", "\par Procedure Performed: ", "B", "\par ")
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>>""
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>>end
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] results>>""
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>>Done with trigger
12/23/2013 13:26:26.475 INFO Process Id #20644 Thread Id #1 [MelTrace]
12/23/2013 13:26:26.476 INFO Process Id #20644 Thread Id #1 [MelTrace] results>Function
12/23/2013 13:26:26.476 INFO Process Id #20644 Thread Id #1 [MelTrace] execute>end
Thanks
Posted : December 26, 2013 2:08 am