📚 SAP Business One SDK Help

UpdateSalesOpportunityCompetitorSetup Method
See Also  Example
pISalesOpportunityCompetitorSetup
The data for the competitor to be updated. The SalesOpportunityCompetitorSetup object must contain the key of the object to be updated.

Description

Updates an existing competitor.

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

Syntax

Visual Basic
Public Sub UpdateSalesOpportunityCompetitorSetup( _
   ByVal pISalesOpportunityCompetitorSetup As SalesOpportunityCompetitorSetup _
) 

Parameters

pISalesOpportunityCompetitorSetup
The data for the competitor to be updated. The SalesOpportunityCompetitorSetup object must contain the key of the object to be updated.

Example

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

    SalesOpportunityCompetitorSetupParams getLine; 
    SalesOpportunityCompetitorSetup updateLine; 
    getLine = (SalesOpportunityCompetitorSetupParams)oCompetSrv.GetDataInterface(SalesOpportunityCompetitorsSetupServiceDataInterfaces.socssSalesOpportunityCompetitorSetupParams); 
 
    //update a record 
    //please note that the SequenceNo should be the Competitor ID of a record in DB 
    getLine.SequenceNo = 30; 
 
    updateLine = oCompetSrv.GetSalesOpportunityCompetitorSetup(getLine); 
    updateLine.Details = "updated memo"; 
    updateLine.Name = "updated name"; 
    updateLine.ThreatLevel = ThreatLevelEnum.High; 
    oCompetSrv.UpdateSalesOpportunityCompetitorSetup(updateLine); 

catch (Exception ex) 

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

See Also