How does a scoped app call NumberManager or global.NumberManager

Paul Neuville
Tera Expert

In a non-scoped app you would simply call

         incnum = new NumberManager("incident");

to get the next incident number in a sequence.

How is that done in a scoped app.

I tried these permutations:

incnum = new global.NumberManager('incident');

incnum = global.NumberManager(ninc.sys_meta.name).getNextObjNumberPadded();

 

all get errors similiar to:

llegal access to package_private script include NumberManager: caller not in scope rhino.global

The incident table has "Accessible from" set to "All Applications scopes".

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @.kjh ,

have a look on Script Include "NumberManager":

find_real_file.png

 

OOTB only access from global scope (and NOT from scoped application!) is allowed.

You have 2 ways for solving that issue:

  • You change "Accessible from" to "All application scopes". This would create a skipped record the next upgrade you have to take care about.
  • You implement a "proxy script include" in global scope, which calls NumberManager and is invoked by your scoped application. The disadvantage is, that this extra script include is not part of your scoped application and has to be deployed separately. 

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

View solution in original post

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @.kjh ,

have a look on Script Include "NumberManager":

find_real_file.png

 

OOTB only access from global scope (and NOT from scoped application!) is allowed.

You have 2 ways for solving that issue:

  • You change "Accessible from" to "All application scopes". This would create a skipped record the next upgrade you have to take care about.
  • You implement a "proxy script include" in global scope, which calls NumberManager and is invoked by your scoped application. The disadvantage is, that this extra script include is not part of your scoped application and has to be deployed separately. 

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Stumbled across this post... for completeness, if you do this from a scoped app you can't use the "sys_meta.name" in the call to the script include you typically would. To get this work you just need to put the string of that table name instead...ie:

incnum = global.NumberManager('incident').getNextObjNumberPadded();

 

Paul Neuville
Tera Expert

Thanks for your reply. It seems service now did not intend for scoped apps to work with the OOTB tables completely.

Hi @.kjh 

it depends on why you want to call NumberManager directly. Normally it is not needed as you configure your number settings at "Number Maintenance".

Kind regards
Maik