Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Is it possible to set the value of a Record Producer variable, from the code within the RP?

ldave
Giga Guru

When we're managing variables from within a record producer, we can access the variable content with "producer.variableName", so we can set something else based on a variable value, i.e.

 

current.category = "something" + producer.variableName;

 

The above is just an example but we all know it works and that's how we're suppose to do things.

 

But let's suppose we need to WRITE in a variable that is on the record producer itself, with a server side code (so no client script) at the time of the record generation, how can we do it? (aside from using a before business rule, I mean, from within the Record Producer code).

 

producer.variableName = "something";

 

Will not work.

Nor will current.variables.variableName

Nor will using .setValue instead of the = sign.

 

Is this something doable at all?

 

Thanks.

1 ACCEPTED SOLUTION

ldave
Giga Guru

I've asked to support too, and it doesn't appear to be this possibility at all.

View solution in original post

2 REPLIES 2

Brad59
Giga Guru

We set the assignment group on cases directly in the producer. It is hard coded. Assuming the Record Producer is configured for a specific table you should be able to access the current object.


For example:

current.assignment_group = "<sys_id>";

 

EDIT:
We do not have assignment_group as a variable on the Record Producer. 

ldave
Giga Guru

I've asked to support too, and it doesn't appear to be this possibility at all.