Can a business rule access variables on catalog submitted tickets?

George P
Tera Guru

I am trying to set a field value based on a variable on catalog items.  Can an on insert business rule access catalog variables to set field values?

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hello,

Unfortunately, your post is a very vague, so I can only answer it directly.

Yes. Yes, a business rule can access request item variables.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

As you can see, each reply as we go along here is containing more information than the last person's reply. Which is great, there's always more we can add/say, especially if we're speculating what you're doing.

We don't know the context of what you're talking about or doing, what table is involved here in the business rule, where are you trying to use those values, etc. You could have this business rule involved on a completely separate table from the catalog item you're talking about...who knows? haha.

So if you can provide that information, that would help tighten this down and narrow the responses to what you need/are looking for.

Please mark reply as Helpful, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Yes. You can access the variables in a BR by current.variables.<variable name>

Hope this helps.

-Anurag

-Anurag

shloke04
Kilo Patron

Hi,

Yes, you can write an After insert business Rule on Requested Item Table and add a condition to that BR if you want to have the rule setup only for 1 catalog item and use the script below:

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.fieldNAME =current.variables.VariableName;

})(current, previous);

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke