NetSuite错误:CustomFieldRef是一种抽象类型,无法实例化

时间:2017-09-26 10:30:58

标签: python wsdl netsuite

我正在研究NetSuite WSDL。我过去两天都坚持这个错误。我在互联网上搜索过但无法找到解决方案。

我尝试使用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

任何形式的帮助都会受到鼓舞。提前谢谢。

2 个答案:

答案 0 :(得分:2)

我使用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 :(得分:0)

除非您已经理解错误,否则该错误几乎是不言自明的,但没有帮助。

如果要编辑/创建自定义字段,则必须实例化正确的类型。

e.g。在Java中

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

您可以在Netsuite docs

中获取类型列表