Use debugger to step into the method and let us know when exactly it fails (in the case that it still won’t be obvious what’s wrong). And don’t forget to mention your version of AX.
Yea, I did. But now I think I am able to suppress the exception by using following;
num = NumberSeq::newGetNumFromCode(<>, NumberSeqScopeFactory::createDefaultScope(), true, true);
As, fourth optional parameter of NumberSeq::newGetNumFromCode(,true); says not to throw exception on missing reference.
boolean _dontThrowOnMissingRefSetUp = false,
As I said earlier, I have created number sequence from organization administration without writing any code (EDT, class, parameters table etc. stuff) so no reference was generated and I think I was getting exception due to this. Please verify.
So… you’re using AX2012 and there is no number sequence for the given code and (default) scope, correct? What do you expect then? Use would have to use a valid combination of number sequence code and scope.
Yea, I think I’m done! Thanks for you help, and by the way your posts always help a lot, and I created an account on this blog just to get support from you.