Web Services methods

Methods are actions invoked from the client computer, such as adding, updating, or deleting information on the Sage CRM server. Web Services methods send synchronous requests that are committed automatically. Once committed, Sage CRM Web Services handle the request and returns a response. The client application handles the response accordingly.

All inserts should typically be performed on an entity basis. However, to facilitate integration, you can update a company or person with address, phone, and email information. In many systems, a single contact record represents company, person, phone, email, and address information.

The following is a list of Web Services methods defined in the WSDL file:

Method

Description

logon

Logs the client on to the server and starts a session.

logoff

Logs off the client from the server and terminates the session.

query

Executes a query on a specified object based on a where clause, and returns a record or record set that satisfies the query.

Returns results in batches. You specify batch size in the Maximum number of records to return option. For more information, see Configuring Web Services.

Each batch is accompanied by a flag called More. If More is True, there are more records waiting on the server for that query. Call Next to get the next batch of data. If anything other than Next is called, the query is closed.

next

Returns the next batch of records matching a query.

Each batch is accompanied by a flag called More. While More is True, you can continue to call Next until all batches have been returned, and More is False.

queryentity

Returns a record if you supply an object and its ID.

Example:

Copy
queryentity(company, 42)

queryid

Returns an object of type aisid.

For more information, see Abstract objects.

If you query the database with a where clause, a date, IDs, and flags denoting whether the record was created, updated, or deleted since that date, are returned. This is useful for data synchronization.

queryidnodate

Returns an object of type aisid. For more information, see Abstract objects.

To return specific objects, use a where clause.

getmetadata

Returns a list of Sage CRM field types to provide metadata about the requested table.

getdropdownvalues

  Returns a list of drop-down fields for a specified table, and the values that Sage CRM expects for each field.

add

Adds records or lists of records to a specified object.

Example:

Copy
add("company", NewCompany1, New Company2, New Company3)

addresource

Adds a user as a resource. This user is not a fully enabled user. This method facilitates data migration.

update

Updates records or lists of records for a specified object.

altercolumnwidth

Resizes a column width to ensure compatibility with third-party databases, for example, ACT!.

delete

Deletes records or lists of records for a specified object.

This method cannot delete records from the following tables, because they contain historical data:

  • newproduct
  • uomfamily
  • productfamily
  • pricing
  • pricinglist

addrecord

Adds records or lists of records to a specified object.

This method has a different signature than the add method and uses the lists of fields in the crmrecord type.

queryrecord

Executes a query on a specified object based on a where clause, and returns a record or record set that satisfies the query.

This method has a different signature than the query method and uses the lists of fields in the crmrecord type.

nextqueryrecord

Returns the next batch of records matching a queryrecord. Each batch is accompanied by a flag called More. While More is True, you can continue to call Next until all batches are returned. More is then False.

updaterecord

Updates records or lists of records for a specified object.

This method has a different signature than the update method and uses the lists of fields in the crmrecord type.

getallmetadata

Returns a list of fields associated with all tables and some type information.

getversionstring

Returns the Sage CRM version number.