📚 SAP Business One SDK Help

AddSalesOpportunityCompetitorSetup Method
See Also  Example
pISalesOpportunityCompetitorSetup
The data for the new competitor.

Description

Adds a competitor.

Syntax

Visual Basic
Public Function AddSalesOpportunityCompetitorSetup( _
   ByVal pISalesOpportunityCompetitorSetup As SalesOpportunityCompetitorSetup _
) As SalesOpportunityCompetitorSetupParams

Parameters

pISalesOpportunityCompetitorSetup
The data for the new competitor.

Return Type

Contains the key (CompetId) of the new competitor.

Example

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

     SalesOpportunityCompetitorsSetupService oCompetSrv; 
     oCompetSrv = (SalesOpportunityCompetitorsSetupService) 
         (MainModule.oCmpSrv.GetBusinessService(ServiceTypes.SalesOpportunityCompetitorsSetupService));                
 
     SalesOpportunityCompetitorSetup addLine; 
     addLine = (SalesOpportunityCompetitorSetup)oCompetSrv.GetDataInterface( 
          SalesOpportunityCompetitorsSetupServiceDataInterfaces.socssSalesOpportunityCompetitorSetup); 
      
     addLine.Name = "competitor1"; 
     addLine.ThreatLevel = ThreatLevelEnum.Medium; 
     addLine.Details = "Discount"; 
     oCompetSrv.AddSalesOpportunityCompetitorSetup(addLine); 

catch (Exception ex) 

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

See Also