I have a customfieldlist in an invoice. I have retrieved the internalid of the Customfield and I want to get the value represented by the internalId. I've shown a snippet of my code below that gets the value I want, but it goes from 1 minute to 8 minutes processing time by adding the ReadResponse section. Am I violating some covenant here?
Thanks in advance for any help..
------------------------------------------------------------------------- Record[] records = response.recordList;
Invoice PinnInvoice;
CustomRecordRef myCRR = new CustomRecordRef();
CustomRecord CRR = new CustomRecord();
myCRR.typeId = "2";
for (int i = 0, j = (response.pageIndex - 1) * response.pageSize; i < records.Length; i++, j++)
{
PinnInvoice = (Invoice)records[i];
dr = dt.NewRow();
dr["LeaseName"] = "";
CustomFieldRef[] fields = PinnInvoice.customFieldList;
foreach(CustomFieldRef fieldRef in fields)
if (fieldRef is SelectCustomFieldRef && (fieldRef as SelectCustomFieldRef).internalId == "custbody1")
{
ListOrRecordRef LeaseRef = (fieldRef as SelectCustomFieldRef).value;
myCRR.internalId = LeaseRef.internalId.ToString();
ReadResponse rr = mNetSuiteService.get(myCRR);
if (rr.status.isSuccess)
{
CRR = (CustomRecord)rr.record;
dr["LeaseName"] = CRR.name.ToString();// rr.LeaseRef.internalId.ToString();
}
}
dt.Rows.Add(dr);
}
dt.AcceptChanges();
}
------------------------------------------------------------------------