Not able to insert a record into a scoped table

farukhkhan
Mega Contributor

Hi All,

Getting a error while trying to create a new record in a scoped application from background script(scope = global) .

Could anyone please provide guidance

Background Script:

find_real_file.png

Error:

find_real_file.png

Scoped Table Configuration:

find_real_file.png

TIA

Farukh

1 ACCEPTED SOLUTION

Please change it to tracking, remove instance cache by typing cache.do in the Application navigator and then try running your background script. 

Regards,
Muhammad

View solution in original post

10 REPLIES 10

MrMuhammad
Giga Sage

You might want to navigate to sys_scope_privilege_list.do in order to verify if the cross application scope is created or not. Although, when you run script first time it gets created automatically but some times it missed.  Also, try passing field values while creating record and see how it goes. 

 

Please mark this ACCEPTED & HELPFUL if applicable. Thanks!

Regards,
Muhammad

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Farukh,

it should working considering your Can create checkbox is true

Are you able to create records manually?

Cross scope record should be there in the table

Regards
Ankur

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

farukhkhan
Mega Contributor

Hi @Ankur and @Muhammad,

Thanks for your replies.

I could not found any record on 'sys_scope_privilege' table for 'x_68177_servicenow_replies' table.

Then I tried to create a record on 'sys_scope_privilege' table but its showing error.

find_real_file.png

I have selected target scope as 'ServiceNow Dev'(scoped application) and source scope as 'Global',  As I am trying to create record in scoped application from global.

And @Ankur Bawiskar I can create the record manually on 'x_68177_servicenow_replies' table while my selected application is 'Global'.

Thanks,

Farukh

Yes, global can never be selected as source table. you should do this other way arround for creating cross scope privilleges but before that you should check Application access Tracking settings by navigating to application configuration and set Runtime Access Tracking to none. After doing this run your script and it should automatically create cross scope access. If not then you can create manually. 

 

For further details, You can read about Runtime access tracking options here.

https://docs.servicenow.com/bundle/orlando-application-development/page/build/applications/concept/c...

 

Please mark this ACCEPTED & HELPFUL if applicable. Thanks!

Regards,
Muhammad