Rollback - Make to Order

saurabhabh
Member Posts: 17
Hi,
I have a situation where in i have modified the Codeunit-83 (Sales-Quote to Order(Yes/No).
I have some customized code which makes use of the SalesHeader Number that the method
What i want is that if the customization that i have done fails, then i want to rollback the entire above transaction.
i.e
- No new Sales Order should be created.
- Sales Quote should not be deleted and everything should be restored to the earlier state.
I did try to make the below change. But it doesn't work .
I think that s because a commit happens in the code unit
Please let me know how to rollback the entire thing.
I have a situation where in i have modified the Codeunit-83 (Sales-Quote to Order(Yes/No).
I have some customized code which makes use of the SalesHeader Number that the method
SalesQuoteToOrder.GetSalesOrderHeader(SalesHeader2);fills in the 'SalesHeader2'.
What i want is that if the customization that i have done fails, then i want to rollback the entire above transaction.
i.e
- No new Sales Order should be created.
- Sales Quote should not be deleted and everything should be restored to the earlier state.
I did try to make the below change. But it doesn't work .
SalesQuoteToOrder.RUN(Rec); SalesQuoteToOrder.GetSalesOrderHeader(SalesHeader2); //Purpose : Make use of the SalesHeader Number set in SalesHeader2 and do some processing. retVal := saurabh.doProcessing(Rec, SalesHeader2); IF (retVal = 0) THEN //Processing success BEGIN COMMIT; MESSAGE(Text001,"No.",SalesHeader2."No."); END ELSE //Processing Failed BEGIN //The ERROR('') will quietly rollback the data changes, //and the ASSERTERROR will capture the error, allowing the code execution to continue. ASSERTERROR ERROR(''); MESSAGE(Text002,"No.",SalesHeader2."No."); END;
I think that s because a commit happens in the code unit
SalesQuoteToOrder.RUN(Rec);
Please let me know how to rollback the entire thing.
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