Click or drag to resize
WebCrmApiReturnFieldDescription Method
Returns meta data for the specified entity field.

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 ReadFieldDescriptionResult ReturnFieldDescription(
	DataEntityType entityType,
	long fieldID
)

Parameters

entityType
Type: dk.webCRM.ApiSync.BusinessLayer.EnumsDataEntityType
Entity type.
fieldID
Type: SystemInt64
Index of the entity field.

Return Value

Type: ReadFieldDescriptionResult
Returns error status and meta data for the specified field.
Remarks
Note that this method does not return the real field names used in the database. Instead it returns the mapping keys that are to be used all over the API service. In fact only RetrieveByQuery method is referring actual field names.
Examples
// Login and get a webservice ticket.
WebCrmApiSoapClient proxy = new WebCrmApiSoapClient();
ErrorStatus errorStatus;
TicketHeader ticket = proxy.Authenticate("cm1111aaaaaa", "username", "password", out errorStatus);

// Get meta data.
ReadFieldDescriptionResult result = proxy.ReturnFieldDescription(ticket, DataEntityType.Organisations, 120);

// Output list of field keys to console. The field key may look like "5_System_ID" or "5_Number".
Console.WriteLine(result.Metadata.DatabaseFieldKey);

// The below is an example of field key usage. It adds new opportunity to webCRM.
WebCrmData opportunityData = new WebCrmData
{
    Pairs = new KeyValuePair[] {
        new KeyValuePair("5_System_ID", "0"),
        new KeyValuePair("5_oppOrgRelationId", "1"),
        new KeyValuePair("5_Number", "000019") }
};
WriteToWebCrmResult writeResult =
    proxy.WriteToWebcrm(ticket, DataEntityType.Opportunities, 97, 0, opportunityData);

// End session.
errorStatus = proxy.EndSession(ticket);
See Also