Hello World,
That's a tough one for those experts out there. O:)
I want the No. Series Codeunit to apply one No. Series or another depending on which user is loaded and from which form is the current one (although No.Series CU is hardly called directly from a form).
So my idea is to keep a var in the No. Series Codeunit and keep informing the CU of the current form by some mod in Application Managment. Basically because I would be hard to mantain a modification from each form to No. Series and also because if you have 2 different forms it has to pick the real current one even if you just changed (being CU1 the only one executed in between)
With some Windows DLL you can control windows from the current or running programs but can't retrieve information from a particular Window (form) inside Navision. Don't even dear to ask the ID (they'll sentence you three days rounding about ParnerSource

)
Well, any ideas?
Comments
Maybe you can add a new field and initialise this on the NewRecord trigger.
This allows you to change the code in the NoSeries function.
This will save you all the trouble of changing cu. 1 and stuff like that.
I'm afraid it doesn't solve the problem though.
It's necessary to have different No.Series depending on the form so for instance a Sales Header type Invoice should get a different No.Series if got from form A than if got from form B and also depending on the user. This is stored in a table like that:
1 Form
2 User
3 No. Series
While in the table, I can't know which form is managing the table so... I also would like NOT to modify every table and NOT to modify every form but instead only NoSeriesManagement and Application Management.
Mission Impossible still waiting for a genius 8)
Use a Master number series for the form(s) and then identify which Related number series to select based on a new field in the No Series (eg user / role / dimenson value x)
It seems that they can't remember / create the apropiate No.Series for each document #-o
I would probably add a function to the No Series codeunits to set the form ID before calling it for a new number, and modify it to look in that new table for which series to use.
That way you'd still have to modify all tables that use the numbering series though, good luck taking on that problem
RIS Plus, LLC
A table:
-Form
-User
-No. Series
-Current Form (which is unique per subgroup of record with the same user)
That way, unless two users enter with the same ID you would have a unique form selected when asigning a new Number
Two modifications in the NoSeriesManagment codeunit:
-In GetNextNo and InitSeries to use the No.Series from the coss-refered table instead of the one that is coming.
One modification in the table itself:
-Function UpdateCurrentForm(FormID) which will blank all Current Form fields for sub selection of the same User and tick the particular one. ( :twisted: :twisted: :twisted: For some stupid reason doesn't let me do neither a MODIFY or MODIFYALL in the table. :twisted: :twisted: :twisted: Neither let me do so in I move the whole lot to the codeunit. It says: "You cannot make any changes in the database from this trigger" :twisted: :twisted: :twisted: )
So I don't need to change any table! 8)
Only the original problem remains. How to know from CU1 which form is being created or moved to ("what about if the user has 15 windows open"). Otherwise I will have to use the OnFindRecord in each form which is a solution I can't be excited about. :?
RIS Plus, LLC
RIS Plus, LLC