Scoped App ... does not support "setNewGuid" ???

Zod
Giga Guru

Hi Experts,

I'm currently shifting some develeopements (that worked) into a scoped app ... now I fave the issue, that I get en error message, telling me: "Error Message - Function setNewGuid is not allowed in scope xxx".

 

It's an UI action that urgently requires to generate a new sys_id within the underlying script ... but why does this not work within a scoped app?? What else could be used instead?

The UI action will create an record (that is in global) scope ... not sure if this is the issue?

Code like ... var record_id = newRec.setNewGuid();

Thank you!!!

1 ACCEPTED SOLUTION

yes this randomly creates a sys_id that I then could set ... ok. Would mostpropbably work as workaround. I do update within the catalog task activity, then the sys_id can also be retrieved. 

But thanks anyhow!

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

In scoped app use this method and it should work

 setNewGuidValue(String guid)

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

thank you.

But as far I understand this is to set a specific guid!?! ... I just need to store the guid of the record to be created via the script before the record is really actually inserted ... 

Hi,

Basically what I mean to say is that setNewGuid() works in global scope and setNewGuidValue(String guid) works in scoped application.

 

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Vemffm,

Any update on this?
Can you mark answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader