How to rollback if the import is failed?

julkifli33
Member Posts: 1,092
hi all , i create i report to import to sales header and sales line (1 file inserted to these 2 tables)
my code is first insert into sales header off course
and then i inserted to sales line... using Sales Header."No." become Sales Line."Document No."
but sometimes if i want to add Sales Line, it got an error because we haven't input the item
but it still create the header....
if we import once again, it will create sales header and sales line, which is will be redundant
so... what should i do, to prevent it create sales header before it check that sales line is correct
thanks
my code is first insert into sales header off course
and then i inserted to sales line... using Sales Header."No." become Sales Line."Document No."
but sometimes if i want to add Sales Line, it got an error because we haven't input the item
but it still create the header....
if we import once again, it will create sales header and sales line, which is will be redundant
so... what should i do, to prevent it create sales header before it check that sales line is correct
thanks
0
Comments
-
Hi,
Temporary table may be useful.
I think first insert in temporary table of Sales Header and line .If no error after all records passed then insert temporary into real tables.Regards,
Hemant
They can conquer who believe they can.0 -
I suggest to use RIM tool here. This will give us the list of errors at the time of importing--
Regards,
Raveendran.BS0 -
1) There must be some COMMIT in the process. Just use the client monitor to find it.
2) The commit is not in standard I assume. It seems like bad concept.0 -
kine wrote:1) There must be some COMMIT in the process. Just use the client monitor to find it.
2) The commit is not in standard I assume. It seems like bad concept.Looking for part-time work.
Nav, T-SQL.1 -
That's a good trick. =D>0
-
Applause indeed!! =D>
This will save me a lot of time the next time I have to search for a commit.Reijer Molenaar
Object Manager0 -
rmv_RU wrote:kine wrote:1) There must be some COMMIT in the process. Just use the client monitor to find it.
2) The commit is not in standard I assume. It seems like bad concept.
=D>
WOW that is brilliant.
It makes you think two things. First, D'oh why didn't I think of that. And Second, isn't it great that after all these years in Navision I can still learn something new.David Singleton0
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