How to get Previous Row,Next Row values while Insert Line ?

pskannaa
Member Posts: 138
HI,
I need to get the values of Previous and Next row values while inserting the Line Item..why because if im going to insert the Line Item in exiting records I NEED TO CHECK BEFORE ROW TYPE AND AFTER ROW TYPE, IF IT'S 'EXT TEXT' THEN DO NOT ALLOW USER TO INSERT THOSE LINE.
Type Description......
ITEM AAAAAAA
EXT.TEXT XXXXXXXXX
EXT.TEXT YYYYYYYYYY {In between row of Ext.TExt i do not want to allow to Insert the Line
EXT.TEXT ZZZZZZZZZZ
So, Condition to check while insert trigger, how...??
Regards,
Psk
I need to get the values of Previous and Next row values while inserting the Line Item..why because if im going to insert the Line Item in exiting records I NEED TO CHECK BEFORE ROW TYPE AND AFTER ROW TYPE, IF IT'S 'EXT TEXT' THEN DO NOT ALLOW USER TO INSERT THOSE LINE.
Type Description......
ITEM AAAAAAA
EXT.TEXT XXXXXXXXX
EXT.TEXT YYYYYYYYYY {In between row of Ext.TExt i do not want to allow to Insert the Line
EXT.TEXT ZZZZZZZZZZ
So, Condition to check while insert trigger, how...??
Regards,
Psk
0
Comments
-
Hi Psk,
how about something like that in the OnInsert-Trigger:temp1.RESET; temp1.SETFILTER(ID, '<%1', ID); IF NOT temp1.FIND('+') THEN temp1.INIT; temp2.RESET; temp2.SETFILTER(ID, '>%1', ID); IF NOT temp2.FIND('-') THEN temp2.INIT; IF (temp1.TYPE = 'EXT') OR (temp2.TYPE = 'EXT') THEN ERROR('');
temp1 and temp2 are the same table on which you want to perform the insert. Determine the previous and the subsequent line and check e.g. the field "type" to determine if the record should be inserted or not.
Regards
Sascha0 -
[edit] Sent the same reply twice, sorry ...0
-
pskannaa wrote:HI,
I need to get the values of Previous and Next row values while inserting the Line Item..why because if im going to insert the Line Item in exiting records I NEED TO CHECK BEFORE ROW TYPE AND AFTER ROW TYPE, IF IT'S 'EXT TEXT' THEN DO NOT ALLOW USER TO INSERT THOSE LINE.
Type Description......
ITEM AAAAAAA
EXT.TEXT XXXXXXXXX
EXT.TEXT YYYYYYYYYY {In between row of Ext.TExt i do not want to allow to Insert the Line
EXT.TEXT ZZZZZZZZZZ
So, Condition to check while insert trigger, how...??
Regards,
Psk
Nearly same problem was posted one week ago: viewtopic.php?f=23&t=33756&p=1641040
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