Skip to Content
0
Jun 08, 2017 at 08:19 PM

How to create an Inbound delivery using CreateWithReference function.

464 Views

Dear everyone,

I tried to create an Inbound delivery using CreateWithReference function (With Reference to purchase order).

I have tried the below code. It is not working. Please correct me, to resolve this issue.

var poQry = PurchaseOrder.QueryByElements;
var paraPO = poQry.CreateSelectionParams();

paraPO.Add(poQry.ID.content, "I", "EQ" , "190");
var resultPO = poQry.Execute(paraPO);
if(resultPO.Count() > 0)
{
	var POIns = resultPO.GetFirst();
	var createID = InboundDelivery.CreateWithReference(POIns, "ECPO", true, "test");
	if (createID.IsSet()) //Value not set
	{
		this.ID = createID.ID.content;
	}
}

Thanks in advance

Sankaran A