Skip to main content
Solved

Client Script Code Question

  • December 27, 2022
  • 2 replies
  • 80 views

Forum|alt.badge.img+7

Hi all,

 

In the FSM Client Scripts. The baseline coding logic includes the use of {0} and {1}. May I understand what they mean and how they are to be used?

Eg. the code below:


var fullFilter = stringFormat("task.task_status in (select task_status from task_status where status = 'OP',' and task_status <> '{0}') and task.team_id in (select team_id from team_member where person_id = '{1}') and task.person_id is null", getAppParam("REJECTED_TASK_STATUS"), getUserInfo("PersonID"));
return fullFilter;

 

{0} and {1} are also used in many other context, like in XML Business Rules.

 

Just want to understand how to use these 2 values.
 

Best answer by Hasara Dinu

Hi @StejonatL,

{0} and {1} are used as the substitution parameters for these queries. If you want to get another argument to substitute for the same query, you can use another 3rd parameter as {2}.

 

{0} - This will take the first argument

{1} - This will take the second argument

 

Lets assume that the values for the below arguments are as follows.

 

getAppParam("REJECTED_TASK_STATUS") - CL

getUserInfo("PersonID") - USER1

 

So the final query will look likes below.

task.task_status in (select task_status from task_status where status = 'OP',' and task_status <> 'CL') and task.team_id in (select team_id from team_member where person_id = 'USER1') and task.person_id is null

 

Hope this information will help you .

 

Thanks,

Hasara

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+13
  • Hero (Employee)
  • 68 replies
  • Answer
  • January 3, 2023

Hi @StejonatL,

{0} and {1} are used as the substitution parameters for these queries. If you want to get another argument to substitute for the same query, you can use another 3rd parameter as {2}.

 

{0} - This will take the first argument

{1} - This will take the second argument

 

Lets assume that the values for the below arguments are as follows.

 

getAppParam("REJECTED_TASK_STATUS") - CL

getUserInfo("PersonID") - USER1

 

So the final query will look likes below.

task.task_status in (select task_status from task_status where status = 'OP',' and task_status <> 'CL') and task.team_id in (select team_id from team_member where person_id = 'USER1') and task.person_id is null

 

Hope this information will help you .

 

Thanks,

Hasara


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 47 replies
  • January 3, 2023

Thank you.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings