📚 SAP Business One SDK Help

DeleteSalesOpportunitySourceSetup Method
See Also  Example
pISalesOpportunitySourceSetupParams
The key of the source to be deleted.

Description

Deletes an existing source.

The source is specified by its key (Num), which is contained in the SalesOpportunitySourceSetupParams object passed to the method.

Syntax

Visual Basic
Public Sub DeleteSalesOpportunitySourceSetup( _
   ByVal pISalesOpportunitySourceSetupParams As SalesOpportunitySourceSetupParams _
) 

Parameters

pISalesOpportunitySourceSetupParams
The key of the source to be deleted.

Remarks

You cannot delete a sales opportunity source that is associated with a sales opportunity.

Example

Deleting a sales opportunity source (C#)Copy Code
SalesOpportunitySourceSetupParams sourceParams = sourceService.GetDataInterface( 
    SalesOpportunitySourcesSetupServiceDataInterfaces.sosssSalesOpportunitySourceSetupParams) as SalesOpportunitySourceSetupParams; 
 
// Make sure that a record with SequenceNo = 1 exists 
sourceParams.SequenceNo = 1; 
 
Console.WriteLine("Delete a SalesOpportunitySourceSetup object with key=" + sourceParams.SequenceNo.ToString()); 
try 

    sourceService.DeleteSalesOpportunitySourceSetup(sourceService.GetSalesOpportunitySourceSetup(sourceParams)); 

catch (Exception ex) 

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

See Also