Update Field In Sales Header after record been imported?
Rikarddo
Member Posts: 80
Hello,
I have a process where i import one Sales Order from SalesForce to table Sales Header.
After the importation, it is possible to Update the Gen. Bus. Posting Group depending of the location?
For Example
I tried to use this code on the table, but when i send the sales order from Sales Force to NAV it says an error where it sayd the Document Header No. does not exist.
Should this code been written in the table or ?!
Thanks for the help
Just a note
I Have this code in the XML Port
Can i from here update Sales Header?
I have a process where i import one Sales Order from SalesForce to table Sales Header.
After the importation, it is possible to Update the Gen. Bus. Posting Group depending of the location?
For Example
IF "Sales Header"."Location Code"='MAI-AM' THEN
"Sales Header"."Gen. Bus. Posting Group"='AMOSTRAS'
"Sales Header".Modify;
I tried to use this code on the table, but when i send the sales order from Sales Force to NAV it says an error where it sayd the Document Header No. does not exist.
Should this code been written in the table or ?!
Thanks for the help
Just a note
I Have this code in the XML Port
<Sales Line> - Import::OnAfterModifyRecord()
//"<Sales Line>".VALIDATE("<Sales Line>"."No.");
IF TipoOper='DELETE' THEN
BEGIN
"<Sales Line>".DELETE(TRUE);
END
ELSE
location.GET("<Sales Line>"."Location Code");
IF location.Amostras THEN
"<Sales Line>".VALIDATE(Oferta,"<Sales Line>".Oferta::Amostra);
"<Sales Line>".MODIFY;
"<Sales Line>".AutoReserve;
Can i from here update Sales Header?
0
Best Answer
-
You can take one variable for Gen. Bus. Posting Group and write code to update it in XMLPort. You can write code on "Import::OnAfterAssignVariable()".
Let us know if it works.
Regards
Ratnesh5
Answers
-
You can take one variable for Gen. Bus. Posting Group and write code to update it in XMLPort. You can write code on "Import::OnAfterAssignVariable()".
Let us know if it works.
Regards
Ratnesh5 -
ratnesh272 wrote: »You can take one variable for Gen. Bus. Posting Group and write code to update it in XMLPort. You can write code on "Import::OnAfterAssignVariable()".
Let us know if it works.
Regards
Ratnesh
Thanks for the help
Wrote this code in Sales Header - Import::OnAfterInsertRecord() and it worked just fine!IF "Sales Header"."Location Code"='MAI-AM' THEN "Sales Header"."Gen. Bus. Posting Group":='AMOSTRAS'; "Sales Header".MODIFY; //roliveira 2018-19-01 end
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
