RecordRef validated value
bulentherdem
Member Posts: 5
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... ] (*,)
What will I do? what's the proper method to refresh the recordref data in codeunit... ] (*,)
0
Comments
-
I didn't understand completely the problem, but I think you should refresh your recordreference (and maybe also your fieldreference) after you changed the value in the form. Your recordreference probably still has the old record-version.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
after that, try to use
yourRecordRef := yourFieldRef.Record;
0 -
Dear friends, my problem is :
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. )
0 -
And where are you calling MODIFY for the RecordRef, after you change the field??? ;-)0
-
dear kine,
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)
0 -
Can you post the complete code?
Probably there is something not in the correct place (or not all in the code)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Well, actually I need to find out whether it is possible to refresh 'recordref' or 'fieldref.VALUE'.
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.
0 -
At a certain moment, when you decide to refresh the record,you can just put:
RecordReference.FIND('=');I am not sure if after that you need to do again to have the new fieldvalue in the fieldreference:FieldReference := RecordReference.FIELD(SomeFieldID);
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
