2017-09-26 89 views
0

我正在使用NetSuite WSDL。我被困在過去兩天的這個錯誤。我在互聯網上搜索,但無法找到解決方案。NetSuite錯誤:CustomFieldRef是抽象類型,無法實例化

我嘗試使用Python添加在NetSuite的一個custom field但我得到的錯誤

zeep.exceptions.Fault: org.xml.sax.SAXException: {urn:core_2017_1.platform.webservices.netsuite.com}CustomFieldRef is an abstract type and cannot be instantiated 

任何形式的幫助將appretiated。提前致謝。

回答

0

列表我用SelectCustomFieldRef代替CustomFieldRef解決的問題。即

new_record['companyName']= 'test_clinic1' 
new_record['firstName']= 'test_clinic_first_name1' 
new_record['altName']= 'test_clinic1' 
new_record['lastName']='test_last__clinic_name2' 
record = RecordRef(internalId=1, type='subsidiary') 
new_record['subsidiary'] = record 

customField= SelectCustomFieldRef() 
customField.internalId='285' 
customField.scriptId='custentity_profile_type' 
customField.value={ 
       'name': 'Clinic', 
       'internalId': '2', 
       'externalId': None, 
       'typeId': '31' 
      } 

new_record['customFieldList']=CustomFieldList(customField) 
1

該錯誤幾乎不言自明,儘管沒有幫助,除非您已經理解它。

如果你想編輯/創建自定義字段,你必須實例化正確的類型。

例如在Java中

StringCustomFieldRef strCF = new StringCustomFieldRef(); 
strCF.setInternalId(cfNSKey); 

你可以得到的類型在Netsuite docs

+0

如果你能在python中給出一個示例代碼將會很有幫助。 –

+0

這將是但我不知道。基本的概念是你需要創建一個具體的類型。提供Java是因爲這就是我所擁有的。 – bknights

+0

你能提供沙盒NetSuite的鏈接嗎? –

相關問題