More about XML creation and the Record.XML property

1 minute read time.

Another way of creating XML feeds from Sage CRM is to use the XML property of the COM Record object.

The XML property is available in all currently supported releases of Sage CRM.

Example Usage

var myRecord = CRM.FindRecord("person","pers_companyid=24");
Response.Expires=-1;
Response.ContentType = "text/xml"

while (!myRecord.eof) //eof checks for end of data and instantiates query
{
Response.Write(myRecord.XML);
myRecord.NextRecord();
}

This would return a result that looked like


26
24
33
6
Mr.
Arnold
Ball


Male

CEO






1
617
742-3677
[email protected]
1
617
742-3678

2009-01-06T15:01:00.000
1
2009-01-06T15:01:00.000
1899-12-30T00:00:00.000




1899-12-30T00:00:00.000
-2147483638




1899-12-30T00:00:00.000

1899-12-30T00:00:00.000

The XML property describes the data in the returned row as XML. The XML would be repeated if more rows were in the record set.

Note.

This will work for custom for entities but for all entities the prefix on the column names for the table must be exactly 4 characters long. This is a preset value assumed in the dll.

Please see the article "Creating XML feeds from Sage CRM". The article provides an include file for helping create XML feeds. It also discusses the return of XML using a query object.