Page 1 of 1

passing variable as parameters to TM1runti

Posted: Wed Dec 04, 2019 9:43 pm
by Rtel
Following code in TI process TESTPROC1 works fine

executecommand ('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="aaa" parameter2="bbb" ' , 1 ) ;

I have 2 parameters in TESTPROC1 as P1 and p2

Now if I want to pass a parameter P1 for "aaa" and P2 for "bbb" how can I do that

Thanks

Rtel

Re: passing variable as parameters to TM1runti

Posted: Wed Dec 04, 2019 11:39 pm
by Wim Gielis
executecommand( Expand('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="%P1%" parameter2="%P2%" ') , 1 ) ;

Re: passing variable as parameters to TM1runti

Posted: Thu Dec 05, 2019 9:14 pm
by Rtel
P1 = account1
P2 = account2

Calling proc
executecommand ('path/tm1runti.exe -adminhost myadminhost -server myserver -user "Admin" -pwd apple -process TestCalledProc parameter1="%P1%" parameter2="%P2%" ' , 1 ) ;


Called proc

ASCIIOUTPUT('filepath/TestOutput.csv', ' The parameter value is ' | P1 | ' AND ' | P2 );


Expected output in TestOutput.csv

The parameter passed is account1 AND account2

Actual Output I am getting ....

The parameter passed is %P1% AND %P2%

Please let me know what I am missing

Thanks

Rtel

Re: passing variable as parameters to TM1runti

Posted: Thu Dec 05, 2019 9:18 pm
by Wim Gielis
Rtel wrote: Thu Dec 05, 2019 9:14 pm Please let me know what I am missing
The Expand function.
Did you double check and triple check with my suggested code ?

Re: passing variable as parameters to TM1runti

Posted: Thu Dec 05, 2019 10:01 pm
by Rtel
Hi Wim, I missed the expand function in the code

It's working now !

Thank you very much

Rtel