You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Can't pass variable text into a template for use in a Planning expression

edited Jun 19, 2023 8:28PM in Planning 14 comments

Summary:

I have a groovy rule that executes a calc that references a Template. Here is a snippet:


String ApproverMsg = '"' + "This is a Test" + '"'

Calc ="""
  %Template(name:="promotion",application:="testapp",plantype:="testdb",
     dtps:=(  
         "ApproveMsg":=[[$ApproverMsg]]
         ))
 """;


In the Template referenced, I use a design time prompt (of type string passed in from the rule above) in a Planning expression like so:

"Approver" = [[PlanningFunctions.getIdForString([ApproveMsg])]];


Unfortunately it throws an error on execution. If however I hardcode the DTP in the Template call instead of using a variable it works fine:

 Calc ="""
 %Template(name:="prmotion",application:="testapp",plantype:="testdb",
   dtps:=(  
     "ApproveMsg":=[["This is a Test"]]
     ))
 """;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!