Auto Purchase Order Posting Problem???
kishi_g
Member Posts: 162
Hi,
Iam facing one problem with purchase Orders posting. one of our client create the purchase orders and they want to post automatically. I created one Codeunit. i wrote the code below.
PurchHeader.INIT;
PurchLine.INIT;
IF PurchHeader.FIND('-') THEN
REPEAT
PurchHeader.Receive := TRUE;
PurchHeader.Invoice := TRUE;
PurchHeader.MODIFY;
PurchPost.RUN(PurchHeader);
UNTIL PurchHeader.NEXT = 0;
but iam facing one problem. suppose 10 PO's are created. In the 5th PO some Mandatory data was not given. if i run this codeunit 4 PO's will posted but after the 5th PO it was error. then it will not process the next 5 records. now i want if any records contain error it will skip that record and process the next record. it will not stop.
how can i do that????
Thanks & Regards,
kishore...
Iam facing one problem with purchase Orders posting. one of our client create the purchase orders and they want to post automatically. I created one Codeunit. i wrote the code below.
PurchHeader.INIT;
PurchLine.INIT;
IF PurchHeader.FIND('-') THEN
REPEAT
PurchHeader.Receive := TRUE;
PurchHeader.Invoice := TRUE;
PurchHeader.MODIFY;
PurchPost.RUN(PurchHeader);
UNTIL PurchHeader.NEXT = 0;
but iam facing one problem. suppose 10 PO's are created. In the 5th PO some Mandatory data was not given. if i run this codeunit 4 PO's will posted but after the 5th PO it was error. then it will not process the next 5 records. now i want if any records contain error it will skip that record and process the next record. it will not stop.
how can i do that????
Thanks & Regards,
kishore...
0
Comments
-
PurchHeader.INIT; PurchLine.INIT; IF PurchHeader.FIND('-') THEN REPEAT PurchHeader.Receive := TRUE; PurchHeader.Invoice := TRUE; //PurchHeader.MODIFY; //you do not need to save the record back, you canhave proiblems with DeadLocks on SQL... if PurchPost.RUN(PurchHeader) then begin //It was OK end else begin //There were error in this Order... end; UNTIL PurchHeader.NEXT = 0;0 -
hi Kine,
Thanks for ur reply. I gave the same code but iam facing the same problem. I gave items must have lot Numbers. I created 3 PO's. first PO i gave lot number, 2nd PO i didnt gave lot and 3rd PO i gave Lot.
i run this codeunit it will stop in the 2nd record. 3rd record was not posted.
Lot number or Externall doc number details are mentioned in Codeunit-90.
how can i do that??
Thanks & regards,
kishore...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 324 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
