📚 SAP Business One SDK Help

UpdateSalesOpportunityReasonSetup Method
See Also  Example
pISalesOpportunityReasonSetup
The data for the reason to be updated. The SalesOpportunityReasonSetup object must contain the key of the object to be updated.

Description

Updates an existing reason.

The data for the reason, including the key of the reason to be updated, is contained in the SalesOpportunityReasonSetup object passed to the method. To update a reason, you must first retrieve it using the GetSalesOpportunityReasonSetup method.

Syntax

Visual Basic
Public Sub UpdateSalesOpportunityReasonSetup( _
   ByVal pISalesOpportunityReasonSetup As SalesOpportunityReasonSetup _
) 

Parameters

pISalesOpportunityReasonSetup
The data for the reason to be updated. The SalesOpportunityReasonSetup object must contain the key of the object to be updated.

Example

Updating a sales opportunity reason (C#)Copy Code
try 

    SalesOpportunityReasonSetupParams getLine; 
    SalesOpportunityReasonSetup updateLine; 
    getLine = (SalesOpportunityReasonSetupParams)oReasonSrv.GetDataInterface(SalesOpportunityReasonsSetupServiceDataInterfaces.sorssSalesOpportunityReasonSetupParams); 
      
    //please note that the SequenceNo should be the ID of an existing record. 
    getLine.SequenceNo = 28; 
      
    updateLine = oReasonSrv.GetSalesOpportunityReasonSetup(getLine); 
    updateLine.Description = "Updated reason"; 
    updateLine.Sort = 150; 
    oReasonSrv.UpdateSalesOpportunityReasonSetup(updateLine); 

catch (Exception ex) 

    Interaction.MsgBox(ex.Message, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); 

See Also