0
我正在拉我的頭髮在這一個。我試圖使用SearchColumnSelectCustomField
類型的自定義字段篩選保存的搜索(請參閱下面的記錄的XML)。NetSuite SuiteTalk:自定義字段類型的搜索過濾器
如何正確轉換此類型,或者我在這裏做錯了什麼? 我不知道我錯過了什麼,但我總是最終命中誤差爲:
「無法隱式轉換類型 ‘NetSuite.com.netsuite.na1.webservices.SearchColumnSelectCustomField’ 爲「NetSuite的.com.netsuite.na1.webservices.SearchCustomField」 「
TransactionSearchAdvanced transSearchAdv = new TransactionSearchAdvanced
{
savedSearchScriptId = "customsearch_mycustomsearch"
};
SearchColumnSelectCustomField cwoNumField = new SearchColumnSelectCustomField();
cwoNumField.internalId = "custbody_consolidatedworkorder";
transSearchAdv.criteria = new TransactionSearch
{
basic = new TransactionSearchBasic
{
//Error Here, on cwoNumField
customFieldList = new SearchCustomField[]{ cwoNumField }
}
};
XML搜索結果的,沒有過濾器標準中加入:
<tranSales:basic xmlns:platformCommon="urn:common_2014_1.platform.webservices.netsuite.com">
<platformCommon:appliedToTransaction>
<platformCore:searchValue internalId="442671"/>
<platformCore:customLabel>SO #</platformCore:customLabel>
</platformCommon:appliedToTransaction>
<platformCommon:item>
<platformCore:searchValue internalId="315838"/>
</platformCommon:item>
<platformCommon:quantity>
<platformCore:searchValue>11.0</platformCore:searchValue>
</platformCommon:quantity>
<platformCommon:status>
<platformCore:searchValue>pendingBuild</platformCore:searchValue>
</platformCommon:status>
<platformCommon:transactionNumber>
<platformCore:searchValue>204</platformCore:searchValue>
<platformCore:customLabel>WO #</platformCore:customLabel>
</platformCommon:transactionNumber>
<platformCommon:customFieldList>
<platformCore:customField xsi:type="platformCore:SearchColumnBooleanCustomField" scriptId="custbody_buildcomplete" internalId="501">
<platformCore:searchValue>false</platformCore:searchValue>
</platformCore:customField>
/*********** field in question here *************/
<platformCore:customField xsi:type="platformCore:SearchColumnSelectCustomField" scriptId="custbody_consolidatedworkorder" internalId="500">
<platformCore:searchValue typeId="85" internalId="24"/>
<platformCore:customLabel>CWO #</platformCore:customLabel>
</platformCore:customField>
</platformCommon:customFieldList>
</tranSales:basic>