Click or drag to resize
WebCrmApiSearchOrganisation Method
Returns a list of Organisation_ID’s (max 10000). The list is sorted by name.

Namespace: dk.webCRM.ApiSync.WebService
Assembly: dk.webCRM.ApiSync.WebService (in dk.webCRM.ApiSync.WebService.dll) Version: 2.0.0.5 (2.0.0.5)
Syntax
public SearchOrganisationResult SearchOrganisation(
	int searchFieldNumber,
	string searchValue,
	string postcode,
	SearchOptions options
)

Parameters

searchFieldNumber
Type: SystemInt32
Identifies type of data used for the search:
  • 1: Organisation name or organisation name – division name.
  • 2: Telephone or fax number (Telephone 2 or fax for B2C version).
  • X: Custom field value. X can be 101 to 116 (= custom field 1 to 16).
  • Y: Extra custom field value. Y can be 201 to 208 ( = extra custom field 1 – 8 ).
searchValue
Type: SystemString
Value used for the search. It may include "%" in the beginning or end as wild cards. Search value must not exceed 50 characters in length.
postcode
Type: SystemString
It can be blank or contain a postcode to limit the search.
options
Type: dk.webCRM.ApiSync.BusinessLayer.EnumsSearchOptions
Enables specify additional search options: IgnoreCase: indicates whether to ignore case.

Return Value

Type: SearchOrganisationResult
Returns error status and a list of organisation ID’s.
Remarks
When searching with searchFieldNumber = 1 (organisation/division name), the options parameter is ignored and the search uses a special case in-sensitive search algorithm where all spaces and special characters such as / , . - are ignored. AS, A/S, APS, IS, I/S, LTD, INC, GMBH, SA, AB, at the end of the name must be omitted in the search. AS, A/S, IS, I/S, SA, AB, at the beginning of the name must be omitted in the search.
Examples
// Login and get a webservice ticket
WebCrmApiSoapClient proxy = new WebCrmApiSoapClient();
ErrorStatus errorStatus;
TicketHeader ticket = proxy.Authenticate("cm1111aaaaaa", "username", "password", out errorStatus);

// Search
 SearchOrganisationResult result = SearchOrganisation(ticket, 1, "Johnson", "", SearchOptions.None);
See Also