PdcPuchaseInvoiceLineList.AddLineWithoutPO: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
AddLineWithoutPO(CalcNr, MatPos, MatNr as String) as [[PdcPurchaseInvoiceLine]] | AddLineWithoutPO(CalcNr, MatPos, MatNr as String) as [[PdcPurchaseInvoiceLine]]. | ||
Materialposition is optional. | |||
== Description == | == Description == | ||
The method adds a purchase invoice line linked to a | The method adds a purchase invoice line linked to a calculation, optionally to a material position. | ||
== Notes == | == Notes == | ||
Line 11: | Line 12: | ||
<source lang="vb"> | <source lang="vb"> | ||
dim objPI | |||
dim objPIList | |||
dim objPIL | |||
dim strCalcNr | |||
dim strMatPos | |||
dim strMatNr | |||
set objPI = pdc.Logistics.PurchaseInvoices.Active | |||
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 "Line" & objPIL.Pos & " added(" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind | |||
else | |||
mmo_Log.Lines.Add pdc.LastError | |||
end if 'IsValid(objPIL) | |||
end if 'IsValid(objPIList) | |||
else | |||
msgbox "No purchase invoice found." | |||
end if 'IsValid(objPI) | |||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available since | Available since July 2015 (Version 5.1 onwards) |
Latest revision as of 11:05, 19 August 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 objPI
dim objPIList
dim objPIL
dim strCalcNr
dim strMatPos
dim strMatNr
set objPI = pdc.Logistics.PurchaseInvoices.Active
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 "Line" & objPIL.Pos & " added(" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind
else
mmo_Log.Lines.Add pdc.LastError
end if 'IsValid(objPIL)
end if 'IsValid(objPIList)
else
msgbox "No purchase invoice found."
end if 'IsValid(objPI)
Availability
Available since July 2015 (Version 5.1 onwards)