Hello experts,
our customer want to use a complex configuration tool (third party).
It works - but is really slow. One example: When a configuration starts, the programm first creates ~100 configuration lines and copies about 10,000 entries to a "lookup" table. The user can later select from this entries to make the new configuration.
If the configuration is finished the values in the lookup table are not longer needed and can be deleted.
I want to change the program to get it faster and first thing is to get the lookup records temporary. The problem is, that there are 11 codeunits, 2 forms and 1 table concerned and in there you find local or global variables from the lookuptable (with filters or modify / insert etc.). And the program jumps through the codeunits like a rabbit hunted by hungry dogs ...

Is it possible to get a "Navision wide" global temporary record variable?
Any suggestions?
Thanks in advance
Saga
Comments
Yes, I thought about this, but...
mustn't I do a copy loop any time I use the temp records? And this takes time too (and memory space).
Something like:
in codeunit
in single instance codeunit
And mustn't I copy modified records back to the single instance codeunit?
Please correct me.
cu
Saga
You need to keep track of insert modify and delete's off course and if you need to extract the table to a form, you need to copy all records one by one.
Maybe you can try using the findrecord and nextrecord directly on the temprecord in the singleinstancecodeunit. Don';t know if this works though, never tried it.
MySingleInstanceCU.insetRecord;
if MySingleInstanceCU.getFirst then repeat
MySingleInstanceCU.GetCurrRecord(MyRecord);
MySingleInstanceCU.DeleteRecord;
until MySingleInstanceCU.NextRect = 0;
You have to implement all these functions in the single instance codeunit.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Or is it easier and I'm just not seeing the wood for the trees?
That's what I feared ;-)
I'm currently on the long way developing...
To realize the find functions I sometimes must set the current key and filtes. That should work even if I access the records from two different codeunits with different keys and filters at the "same" time (within one function call).
What do you think? Is this possible??
Are you still refering to temporary tables? If yes, and the records are defined in different codeunits, the data in the tables might not be the same.
If no, you can filter in the same table from different codeunits at the same time. The tablelock is only implemented when you change the data.
Yes it is.
I give some examples on how to start developping:
The Codeunit (lets name it "TT"):
And now how to use it:
IF-FIND-REPEAT-NEXT
insert a record and intercept INSERT-error
insert a record and let INSERT-error generate an error
And this you can use in more objects at the same time, because the 'pointer' of the record (with a FIND-REPEAT-NEXT) remains in a local variable.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Good work.
I created a temporary recordreference-variable with dimensions.
The first dimension I created for table X and the second dimension for table Y.
I put in both some records and it was all accepted!
So, this means that a recordreference can contain DIFFERENT tables in DIFFERENT dimensions!!!!!!!!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Yep this is true. We've used this for our document module to create nesting in exporting saleslines with salesheaders etc. still using one recref.
I've just made a little test and it worked. I will now implement this in all places.
Regards
Saga
How can I realize a MODIFYALL function in a codeunit similar to the functions above?
Regards
Saga
Or write a MODIFYALL per field.
Or maybe with the help of variant.
Something like (didn't test it!) Remember that Variants don't work with all variable types.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!