📚 SAP Business One SDK Help

UpdateCashDiscount Method
See Also  Example
pICashDiscount
The data for the cash discount to be updated. The CashDiscount object must contain the key of the object to be updated.

Description

Updates an existing cash discount. 

The data for the cash discount, including the key of the cash discount to be updated, is contained in the CashDiscount passed to the method. To update a cash discount, you must first retrieve it using the GetCashDiscount method.

Syntax

Visual Basic
Public Sub UpdateCashDiscount( _
   ByVal pICashDiscount As CashDiscount _
) 

Parameters

pICashDiscount
The data for the cash discount to be updated. The CashDiscount object must contain the key of the object to be updated.

Remarks

If the ByDate property is changed, all old lines in DiscountLines must first be deleted.

Example

Updating a cash discount (C#)Copy Code
CashDiscountParams getLine; 
SAPbobsCOM.CashDiscount updateLine; 
getLine = (CashDiscountParams)oCDCSrv.GetDataInterface(SAPbobsCOM.CashDiscountsServiceDataInterfaces.cdsCashDiscountParams); 
 
getLine.Code = "Code"; 
updateLine = oCDCSrv.GetCashDiscount(getLine); 
updateLine.Name = "NewName"; 
 
oCDCSrv.UpdateCashDiscount(updateLine);

See Also