vingeance
(Vincent-Simon Bolduc)
1
I need to perform Quantity Adjustments using the REST API.
The BO is Erp.BO.InventoryQtyAdjSvc. Epicor makes a few calls in its own Quantity Adjustment app :
- NegativeInventoryTest
- PreSetInventoryQtyAdj
- SetInventoryQtyAdj
- GetInventoryQtyAdjForPart
An Epicor Function called from the REST API seems like a good way to handle this.
Following this old topic, I expect a few people here having already created a similar function.
Maybe someone would be willing to share its function? 
1 Like
klincecum
(Kevin Lincecum)
2
I got one somewhere but busy putting out fires.
Maybe someone will get back to you before I’m done.
2 Likes
ntt2901
(Thành Nguyễn)
3
this function work for me.
try
{
this.CallService<Erp.Contracts.InventoryQtyAdjSvcContract>(invAdj =>
{
var ds = invAdj.GetInventoryQtyAdj(this.partNum, this.uomCode);
if (ds.InventoryQtyAdj == null || ds.InventoryQtyAdj.Count == 0)
{
this.output = "No adjustment row returned. Check if PartNum or UOM is invalid.";
return;
}
var row = ds.InventoryQtyAdj[0];
row.PartNum = this.partNum;
row.WareHseCode = this.warehseCode;
row.BinNum = this.binNum;
row.AdjustQuantity = -this.shipLineQty;
row.ReasonCode = "ADD";
row.RowMod = "U";
string pkTrans;
invAdj.SetInventoryQtyAdj(ref ds, out pkTrans);
this.output = "Inventory adjust success!";
});
}
catch (Exception ex)
{
this.output = "Error message: " + ex.Message;
}
2 Likes