How can use script Id in Following code to get an out put example given below.
SearchBooleanCustomField searchFilterTodayInvoice = new SearchBooleanCustomField();
//searchFilterTodayInvoice.internalId = "2605";
searchFilterTodayInvoice.scriptId = "custrecord_pos_invoice_today";
searchFilterTodayInvoice.searchValue = true;
searchFilterTodayInvoice.searchValueSpecified = true;
SearchBooleanCustomField searchFilterPaymentNotReceived = new SearchBooleanCustomField();
//searchFilterPaymentNotReceived.internalId = "2514";
searchFilterPaymentNotReceived.scriptId = "custrecord_pos_invoice_payment_received";
searchFilterPaymentNotReceived.searchValue = false;
searchFilterPaymentNotReceived.searchValueSpecified = true;
//SearchMultiSelectCustomField Search_Location_Id = new SearchMultiSelectCustomField();
//Search_Location_Id.scriptId = "custrecord_pos_invoice_location";
//Search_Location_Id.internalId = "2507";
//Search_Location_Id.operatorSpecified = true;
//Search_Location_Id.@operator = SearchMultiSelectFieldOperator.anyOf;
//ListOrRecordRef List_Pos_Location = new ListOrRecordRef();
//List_Pos_Location.internalId = Location_Id_Label.Text;
//Search_Location_Id.searchValue = new ListOrRecordRef[] { List_Pos_Location };
CustomRecordSearchBasic CRSB = new CustomRecordSearchBasic();
CRSB.isInactive = new SearchBooleanField();
CRSB.isInactive.searchValue = false;
CRSB.isInactive.searchValueSpecified = true;
CRSB.recType = new RecordRef();
CRSB.recType.internalId = "316";
CRSB.recType.name = "customrecord_pos_invoice";
CRSB.customFieldList = new SearchCustomField[] { searchFilterTodayInvoice, searchFilterPaymentNotReceived };
SearchResult res = _service.search(CRSB);
res.pageSize = 500;
res.pageSizeSpecified = true;
var C = 0;
Record[] searchRecords = res.recordList;
if (searchRecords != null && searchRecords.Length >= 1)
{
List<CustomRecord> Modifiers_CustomRecord = searchRecords.Select(t => (CustomRecord)t).ToList();
POS_Invoice = new string[searchRecords.Length];
POS_Invoice_Id = new string[searchRecords.Length];
foreach (CustomRecord t in Modifiers_CustomRecord)
{
POS_Invoice[C] = t.customRecordId;
POS_Invoice_Id[C] = t.internalId;
C++;
}
}
int ID;
List<System.Web.UI.WebControls.ListItem> items = new List<System.Web.UI.WebControls.ListItem>();
items.Add(new System.Web.UI.WebControls.ListItem("Please Select", "0"));
for (ID = 0; POS_Invoice != null && ID < POS_Invoice.Length; ID++)
{
items.Add(new System.Web.UI.WebControls.ListItem(POS_Invoice[ID], POS_Invoice_Id[ID]));
}
ddlStandByInvoiceId.Items.AddRange(items.ToArray());
In above example there is one line like CRSB.recType.internalId = "316";
but instead 316 ID I want script ID. Is it possible or not?
-2