'Function getGlideObject is not allowed' error message on Business Rule

matthew_hughes
Kilo Sage

I'm wanting to the update the following field on a request based on the time a request is created:

 

matthew_hughes_0-1696841019825.png

I'm wanting to update the value via the following Business Rule:

matthew_hughes_1-1696841078479.png

 

matthew_hughes_2-1696841147781.png

 

However, when I create a new request and save it, I get the following error message and the field is not populating:

matthew_hughes_3-1696841190060.png

 

I was just wondering if somebody could explain why the error message is occurring and what I need to do prevent it from re-occurring.

 

I've created the Business Rule and new field under a different scope

10 REPLIES 10

SHARANsnow7
Tera Guru

Peter Bodelier
Giga Sage

Hi @matthew_hughes,

 

That is not the way you fill a field in a script.

You should use either one of below lines

current.field_name = 'new_value';
current.setValue('field_name', 'new_value');

 

Is this always going to be a hardcoded value? 
Then you shouldn't need to use a script at all, but just select the field and value in the Actions tab of the Business Rule.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

I tried that as well, but the same error was occurring.

I doubt it is coming from the Business Rule.

 

If you remove the read only of the field, and set the value manually, does it still happen?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.