on 02-05-2019 12:16 PM
Hi I need to update itm9 table for UOM and price however its not updating it their is a price in the system for every itm9 item So my code is as follows.
public void UpdateUom(string ItemCode,int PriceListToUpdate,double amountToAdd)
{
SAPbobsCOM.Items oMM = null;
oMM = (SAPbobsCOM.Items)company.GetBusinessObject(BoObjectTypes.oItems);
int lretcode = 0;
if (oMM.GetByKey(ItemCode))
{
bool need2update = false;
for (int p = 0; p < oMM.PriceList.Count; p++)
{
oMM.PriceList.SetCurrentLine(p);
if (oMM.PriceList.PriceList == PriceListToUpdate)
{
amountToAdd = oMM.PriceList.Price + amountToAdd;
oMM.PriceList.UoMPrices.PriceList = PriceListToUpdate;
oMM.PriceList.UoMPrices.Price = amountToAdd;
oMM.PriceList.UoMPrices.UoMEntry = 52;
oMM.PriceList.UoMPrices.Auto = BoYesNoEnum.tNO;
oMM.PriceList.Currency = "GBP";
need2update = true;
break;
}
}
if (need2update)
{
lretcode = oMM.Update();
if (lretcode != 0)
log.Debug(string.Format("(pricelist){0}-{1}", company.GetLastErrorCode(), company.GetLastErrorDescription()));
}
}
}
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.