Click or drag to resize
WebCrmApiReturnAllFieldDescription Method
Returns meta data for all fields.

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 ReadAllFieldsDescriptionResult ReturnAllFieldDescription()

Return Value

Type: ReadAllFieldsDescriptionResult
Returns error status and meta data of all fields.
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.
ReadAllFieldsDescriptionResult result = proxy.ReturnAllFieldDescription(ticket);

// Output list of field keys to console.
foreach (FieldMetadata field in result.MetadataArray)
{
    Console.WriteLine(field.DatabaseFieldKey);
}

/*
    The above 'foreach' section will output field keys like the following:
     ....
    5_Number
    5_Description
    5_Contact
    5_Responsible
    5_Opp_2nd_Responsible
    5_Date
    ....
    5_System_ID
    5_oppOrgRelationId
    ....
 */

// 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