Modifying fields in OnInsert trigger using RecordRef
Comments
-
rocatis wrote:Let me quote the online help:
Are you sure the help is correct?
You want to transfer the rec to a recref, change some fieldvalues, and move the recref to rec?
SET and GET does this, but maybe it's not my day and I don't get it. :-$0 -
Even if SETTABLE (through RecRef) worked as intended it would not work for this situation since he is attempting to modify a record that hasn't officially been created yet.0
-
ajhvdb wrote:rocatis wrote:Let me quote the online help:
Are you sure the help is correct?
:evil: :evil: :evil: :evil:
NO! Man, that's just plain idiotic! I can't believe I've wasted half a day because the online help is in error... :roll:
You're of course right: SETTABLE does exactly what I need.
My code now looks like this:RecRef.GETTABLE(Rec); FunctionThatDoesStuff(RecRef); RecRef.SETTABLE(Rec);
And it works...SET and GET does this, but maybe it's not my day and I don't get it. :-$
Oh, you're getting it alright - and so is the guy that wrote that online help if I ever get my hands on him :x
THANKS A LOT!Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
Xypher wrote:Even if SETTABLE (through RecRef) worked as intended it would not work for this situation since he is attempting to modify a record that hasn't officially been created yet.
GETTABLE and SETTABLE works in the same way as TRANSFERFIELDS: it's not a prerequisite that the record actually exists in the database. They just transfer field values.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
Shrug, I just remember SETTABLE not working (specifically with transferring filters)...
lRecRef.GETTABLE(MyTable); FOR i := 1 TO lRecRef.FIELDCOUNT DO BEGIN lFieldRef := lRecRef.FIELD[i]; lFieldRef.SETFILTER(lFieldFilter[i]); END; lRecRef.SETTABLE(MyTable);
But that didn't work, so I had to resort to using...MyTable.SETVIEW(lRecRef.GETVIEW);
0 -
rocatis wrote:GETTABLE and SETTABLE works in the same way as TRANSFERFIELDS: it's not a prerequisite that the record actually exists in the database. They just transfer field values.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions