Phone Type Field in Web services

By | September 25, 2014

Hi folks! Web Services is a methodology which gives developers to add out of the box functionalities in web applications. Sage CRM also support web services and provides very authentic way to work with them. Working with web services is quite complex task and sometimes tricky..!!
New Stuff: Increase the size of Search SQL text
I was working on an assignment of developing a module to retrieve person details using Sage CRM web services. And I wish to share my code snippet with you’ll. This snippet will help you in fetching person details easily with multiple phone numbers of different type.
<snippet>
ewarebaselist CRMPhoneList = new ewarebaselist();
phone CRMSinglePhone;
CRMPhoneList = CRMPerson.phone;
for (int i = 0; i <= CRMPhoneList.records.GetUpperBound(0); i++)
{
CRMSinglePhone = (phone)CRMPhoneList.records[i];
int phoneid = CRMSinglePhone.phoneid;
string PhoneType = “”;
queryrecordresult PhoneLinkRecordResult = CRMService.queryrecord(“plink_type”, “plink_phoneid=” + phoneid.ToString(), “phonelink”, “plink_linkid”);
crmrecord[] PhoneLinkRecordList = PhoneLinkRecordResult.records;
for (int intCount = 0; intCount < PhoneLinkRecordList.Length; intCount++)
{
recordfield[] myFieldList = PhoneLinkRecordList[intCount].records;
for (int intCount2 = 0; intCount2 < myFieldList.Length; intCount2++)
{
recordfield myField = (recordfield)myFieldList[intCount2];
PhoneType = myField.value;
}
}
}
</snippet>
Hope this will help you..!!!
Also Read:
1) Get Active tab through client side scripting
2) CRM Email Manager Service failed to start
3) Get impressive reports by adjusting Report Styles in Sage CRM
4) Linked selection fields through client side scripting
5) Synchronize Dropdown feature in GUMU Sage CRM – Sage ERP X3