# slxGetCompetitorID

### slxGetCompetitorID(competitorName)

Check the COMPETITOR table for the competitor name and return the ID if found.

### slxGetCompetitorID(competitorName, displayErrors)

Check the COMPETITOR table for the competitor name and return the ID if found. If there are no matches or multiple matches on the competitor name, an error message will be thrown.

## Arguments

Argument | Data Type | Description
competitorName | string | name of the competitor to check
displayErrors | boolean | If true and the name does not match, an error will be thrown DEFAULT FALSE

## Returns

String - valid competitor ID if found.

## Description

The OPPORTUNITY table contains three virtual fields that allow you to link opportunities. They are:

- vfContactID - link the opportunity to a contact

- vfProductID - link the opportunity to a product

- vfCompetitorID - link the opportunity to a competitor

When creating Opportunity records, you will normally want to link the opportunity to a competitor. If you have the Competitor table as a parent of the Opportunity table, will automatically fill in the vfCompetitorID field.

If you do not have the Competitor table as a parent of Opportunity, you may want to use this function to get the correct competitor id, and then map this to the vfCompetitorID field.

## Examples

Example | Returns | Description
slxGetCompetitorID("Acme Corp") | ID if found |

## See Also

slxGetContactId(), slxGetProductID()