I use a recordRef variable for a function in codeunit and I call this function from onvalidate event. But after form runs and I change the value for a field, in codeunit fieldref.value doesn't be the updated value.
What will I do? what's the proper method to refresh the recordref data in codeunit... ] (*,)
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
After defining a recordref, writing the code is as below:
RecordRef.OPEN(anyTable);
FieldRef := RecordRef.FIELD(anyField);
IF RecordRef.FIND('-') THEN REPEAT
MESSAGE(FieldRef.VALUE);
UNTIL (RecordRef.NEXT = 0)
Firstly we run the code. For example we have 3 records.
For 'anyField' field values : '1', '2', '3'. respectively '1','2','3' message will be displayed.
Then I change the 'anyField' value from '2' to '99'.
When I recall above code, while expecting '1','99','3' to display, I see '1','2','3'.
I think this is related with transection. require to refresh data.
Is there a way to see the updated value??
(By the way, I'm new in navision. )
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
just before RecordRef.OPEN(anyTable);
==> RecordRef.MODIFY;
RecordRef.OPEN(anyTable);
FieldRef := RecordRef.FIELD(anyField);
IF RecordRef.FIND('-') THEN REPEAT
MESSAGE(FieldRef.VALUE);
UNTIL (RecordRef.NEXT = 0)
Probably there is something not in the correct place (or not all in the code)
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
After Refreshing the recordref that related table, It will be possible to see the changed data.
I call MODIFY (updating a record) from another any form object.
Dear friends, If you think this is confusing, ignore my post. I'll try to find another solution.
Thanks all nevertheless.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!