Delete Purchase Line Quotes using webservice and xml

Rikarddo
Member Posts: 80
I have a codeunit published as webservice which has two functions. One that imports purchase quotes using an xml and another that edits those same purchase quotes using another xml.
This is the structure of my lines:
Node Name NodeType Source Type Data Source
Lines Element Table <Purchase Line> (Purchase Line)
Type Element Text <Type>
CodProd Element Text <CodProd>
Desc Element Text <Desc>
Variant Element Text <Variant>
Qtd Element Text <Qtd>
PrecVend Element Text <PrecVend>
LineNo Element Text <LineNo>
Vasilham Element Text <Vasilhame>
This is my xml code Import:
It works fine for insertion. My goal here is to use the other xml to edit the quotes already inserted. But I don't know how?
I was trying to make a "fake import", first delete the lines and then insert only the lines that were remaining?
Can someone give me some tips?
This is the structure of my lines:
Node Name NodeType Source Type Data Source
Lines Element Table <Purchase Line> (Purchase Line)
Type Element Text <Type>
CodProd Element Text <CodProd>
Desc Element Text <Desc>
Variant Element Text <Variant>
Qtd Element Text <Qtd>
PrecVend Element Text <PrecVend>
LineNo Element Text <LineNo>
Vasilham Element Text <Vasilhame>
This is my xml code Import:
<Purchase Line> - Import::OnAfterInitRecord() "<Purchase Line>"."Document Type":="Purchase Header"."Document Type"; "<Purchase Line>"."Document No.":="Purchase Header"."No."; //line+=10000; "<Purchase Line>"."Line No.":=line; "<Purchase Line>".Type:=Type; CASE Type OF 2: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::Item; END; 5: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::"Charge (Item)"; END; 0: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::" "; END; END; "<Purchase Line>"."No.":=CodProd; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".Quantity:=Quantidade ELSE "<Purchase Line>".Quantity:=0; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>"."Direct Unit Cost":=Preco; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".Description:=Desc ELSE "<Purchase Line>".Description:=''; "<Purchase Line>"."Variant Code":=Variante; <Purchase Line> - Import::OnBeforeInsertRecord() "<Purchase Line>"."Document Type":="Purchase Header"."Document Type"; "<Purchase Line>"."Document No.":="Purchase Header"."No."; line+=10000; "<Purchase Line>"."Line No.":=line; "<Purchase Line>".Type:=Type; CASE Type OF 2: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::Item; END; 5: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::"Charge (Item)"; END; 0: BEGIN "<Purchase Line>".Type:="<Purchase Line>".Type::" "; END; END; "<Purchase Line>"."No.":=CodProd; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".VALIDATE("No."); IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".Quantity:=Quantidade ELSE "<Purchase Line>".Quantity:=0; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>"."Direct Unit Cost":=Preco ELSE "<Purchase Line>"."Direct Unit Cost":=0; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>"."Unit Cost":=Preco ELSE "<Purchase Line>"."Unit Cost":=0; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>"."Unit Cost (LCY)":=Preco ELSE "<Purchase Line>"."Unit Cost (LCY)":=0; IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".Description:=Desc ELSE "<Purchase Line>".Description:=''; "<Purchase Line>"."Variant Code":=Variante; //"<Purchase Line>".VALIDATE(Amount); IF "<Purchase Line>".Type<>"<Purchase Line>".Type::" "THEN "<Purchase Line>".UpdateAmounts; <Purchase Line> - Import::OnAfterInsertRecord() IF Vas = TRUE THEN BEGIN line+=10000; "<Purchase Line>".vsCreateContainerLine; END; <Purchase Line> - Import::OnBeforeModifyRecord() <Purchase Line> - Import::OnAfterModifyRecord() <Purchase Line> - Export::OnPreXMLItem() <Purchase Line> - Export::OnAfterGetRecord() //line+=10000; IF Vas = TRUE THEN BEGIN line+=10000; "<Purchase Line>".vsCreateContainerLine; END;
It works fine for insertion. My goal here is to use the other xml to edit the quotes already inserted. But I don't know how?
I was trying to make a "fake import", first delete the lines and then insert only the lines that were remaining?
Can someone give me some tips?
0
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
The Question is too big to understand.
You want to delete the Purchase Quote from Web service and this is getting called from some different platform??
Its possible and very simple whats the challenge that you are facing?Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/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