PdcPuchaseInvoiceLineList.AddLineWithoutPO: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
<source lang="vb"> | <source lang="vb"> | ||
dim objPIList | |||
dim objPIL | |||
dim strCalcNr | |||
dim strMatPos | |||
dim strMatNr | |||
if IsValid(objPI) then | |||
set objPIList = objPI.PurchaseInvoiceLineList | |||
if IsValid(objPIList) then | |||
strCalcNr = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_ORDNR") | |||
strMatPos = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_POS") | |||
strMatNr = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_MATN") | |||
set objPIL = objPIList.AddLineWithoutPO(strCalcNr, strMatPos, strMatNr) | |||
if IsValid(objPIL) then | |||
mmo_Log.Lines.Add "Regel " & objPIL.Pos & " toegevoegd (" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind | |||
else | |||
mmo_Log.Lines.Add pdc.LastError | |||
end if 'IsValid(objPIL) | |||
end if 'IsValid(objPIList) | |||
else | |||
msgbox "Kies of maak eerst een inkoopfactuur." | |||
end if 'IsValid(objPI) | |||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available since March 2015 (From version 5.0 onwards). | Available since March 2015 (From version 5.0 onwards). |
Revision as of 12:30, 13 April 2015
Declaration
AddLineWithoutPO(CalcNr, MatPos, MatNr as String) as PdcPurchaseInvoiceLine. Materialposition is optional.
Description
The method adds a purchase invoice line linked to a calculation, optionally to a material position.
Notes
Code example
dim objPIList
dim objPIL
dim strCalcNr
dim strMatPos
dim strMatNr
if IsValid(objPI) then
set objPIList = objPI.PurchaseInvoiceLineList
if IsValid(objPIList) then
strCalcNr = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_ORDNR")
strMatPos = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_POS")
strMatNr = GetAnyField("DM_MATLINES", "DM_ID", edt_MatNr.Text, "DM_MATN")
set objPIL = objPIList.AddLineWithoutPO(strCalcNr, strMatPos, strMatNr)
if IsValid(objPIL) then
mmo_Log.Lines.Add "Regel " & objPIL.Pos & " toegevoegd (" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind
else
mmo_Log.Lines.Add pdc.LastError
end if 'IsValid(objPIL)
end if 'IsValid(objPIList)
else
msgbox "Kies of maak eerst een inkoopfactuur."
end if 'IsValid(objPI)
Availability
Available since March 2015 (From version 5.0 onwards).