Hello,
I'm working on a trigger that loops through some related records and perform some action on those records with values from the master object.
In the loop below debugging shows that hours and startdatetime are not correctly substituted. Only the suplier field is correctly substitued. This is not what i expected.
Solved this by assigning the hours and startdatetime to a variable before the loops start. Now it's working correctly.
{!#LOOP_BEGIN.R228075#214066}
performAction("{!R228075,supplier}","{!startDateTime#iso)",{!hours});
{!#LOOP_END.R228075}
Now i'm wondering if this is designed behavior or that i ran in some bug. If it is designed behavior it might be a good idea to substitute also the normal available values as well in the loop.
Regards,
Wilco Weultjes.
Hello,
What do you mean about the values being substituted? Can you post the returned value in which you are having a problem with?
Thank you,
Gian
Hello Gian,
Here an example.
this code for a workorder with 5 detail lines:
rbv_api.println("{!mtc_enddatetime#iso}");
{!#LOOP_BEGIN.R228075}
rbv_api.println("{!mtc_enddatetime#iso}");
{!#LOOP_END.R228075}
gives in debug mode:
var rbv_api = new Packages.com.rb.core.services.api.ServerSideAPI(205908, 212352);
rbv_api.println("2014-11-19T14:00:00Z");
rbv_api.println("");
rbv_api.println("");
rbv_api.println("");
rbv_api.println("");
rbv_api.println("");
Regards,
Wilco.
Hello,
It is printing the date correctly am I right?
rbv_api.println("2014-11-19T14:00:00Z");
The other println may not have a value in it. You can elaborate this further so that we may have a clear understanding of the issue.
Regards,
Gian
Hello,
Yes it print the line correctly, but only once. I was expecting that the "empty" rbv_api.println also contained a correct date.
I like to print all detail lines of the workorder with some information of that workorder and that doesn't work this way.
Regards,
Wilco.
Hello,
May I know your expected output? So that we can provide a clear solution to the issue.
Thank you,
Gian
Can you print "name" and "id" tokens also?
Hello Gian,
I expect that for each detail line the data from the master record will be written. So instead of 5 times rbv_api.println(""); i expect 5 times rbv_api.println("2014-11-19T14:00:00Z");
Regards,
Wilco.
Hello,
Can you go to the view page of the master record and display the related detail line record list view with the date field showing? It should print properly if there is a value in each related record,
Thank you,
Gian