---
url: >-
  /flow/guide/scripting-reference/functions/trading-partner/activatepartnerbywhere.md
---

# ActivatePartnerByWhere

## Declaration

`function TFloActionManager.ActivatePartnerByWhere(aWhere: string): boolean;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
Action.ActivatePartnerByWhere('where partnertype=1 and supplierid=''ABC''')
end;
```

## Description

Finds and activates a Trading Partner based on the filter provided by aWhere parameter. aWhere is a where clause for a SQL query. You can use any fields from the FLO_TRADINGPARTNERS table in the Flow configuration database to build your where clause.

The fields in the FLO_TRADINGPARTNERS table include:

* FID (type guid)
* MODULENAME (type varchar) - corresponds to [Partner Name](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/#partner-name)
* PARTNERTYPE (type integer) - corresponds to [Partner Type](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#partner-type)
* CUSTOMERID (type varchar) - corresponds to [Your ID for them as customer](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#your-id-for-them-as-customer)
* TPSUPPLIERID (type varchar) - corresponds to [Their ID for you as supplier](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#their-id-for-you-as-supplier)
* SUPPLIERID (type varchar) - corresponds to [Your ID for them as supplier](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#your-id-for-them-as-supplier)
* TPCUSTOMERID (type varchar) - corresponds to [Their ID for you as customer](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#their-id-for-you-as-customer)
* MEMBERID (type varchar) - corresponds to [Custom Id](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#custom-id)
* USERNAME (type varchar) - corresponds to [User Name](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#user-name)
* USERPASS (type varchar (encrypted)) - corresponds to [User Password](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/general-tab/#user-password)

Also see [Trading Partner Attributes](/flow/guide/administering-flow/configuring-flow/trading-community/trading-partner/trading-partner-attributes)
