Identify which field has been modify in table

vijay_g
Member Posts: 884
Hi
can any body help me out in finding the paticular modified field in table.(i.e if i modify UOM then changed field (i.e unit of measure )is reflect on modify trigger.)
can any body help me out in finding the paticular modified field in table.(i.e if i modify UOM then changed field (i.e unit of measure )is reflect on modify trigger.)
0
Answers
-
there are 2 ways : you can check Currfieldno, this has the number of the field the USER changed. it is NOT filled when changing something via code. teh other way is comparing every field in Rec with the same in xRec in the OnModify trigger1
-
How it will work..?
i have just put message('%1',CurrFieldNo) on modify trigger of item table and at run time i am modifying to description then system returns 0 why? ](*,)0 -
vijay_g wrote:How it will work..?
i have just put message('%1',CurrFieldNo) on modify trigger of item table and at run time i am modifying to description then system returns 0 why? ](*,)0 -
it has solved thxxxx0
-
there are 2 ways : you can check Currfieldno, this has the number of the field the USER changed. it is NOT filled when changing something via code. teh other way is comparing every field in Rec with the same in xRec in the OnModify trigger
I have also this question, but avoid to handle the page itself. There could be several other Page objects to the same Table object, but to handle every page individually is not the way I think.
To have a general solution, which field was changed, check COD423 "Change Log Management"
It's seems doing a simple iteration to check which field's value is changed (Rec vs xRec):[External] LogModification(VAR RecRef : RecordRef) IF RecRef.ISTEMPORARY THEN EXIT; IF NOT IsLogActive(RecRef.NUMBER,0,1) THEN EXIT; xRecRef.OPEN(RecRef.NUMBER); xRecRef."SECURITYFILTERING" := SECURITYFILTER::Filtered; IF xRecRef.READPERMISSION THEN BEGIN IsReadable := TRUE; IF NOT xRecRef.GET(RecRef.RECORDID) THEN EXIT; END; FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN FldRef := RecRef.FIELDINDEX(i); xFldRef := xRecRef.FIELDINDEX(i); IF IsNormalField(FldRef) THEN IF FORMAT(FldRef.VALUE) <> FORMAT(xFldRef.VALUE) THEN IF IsLogActive(RecRef.NUMBER,FldRef.NUMBER,1) THEN InsertLogEntry(FldRef,xFldRef,RecRef,1,IsReadable); END;
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