1

我是与 Netsuite 集成的新手。我在 Netsuite 应用程序中创建了一条自定义记录和一些字段以及值,现在我想从 Web 服务请求中获取这些值。我得到标签,但我无法获得价值。

CustomRecordType record = (CustomRecordType)response.getRecord();     
CustomRecordTypeFieldList fields = record.getCustomFieldList();     
CustomRecordCustomField[] crcf = fields.getCustomField(); 

for(CustomRecordCustomField c:crcf) 
{ 
    System.out.println(c.getLabel()); 
}
4

2 回答 2

1

customRec.setTypeId("626"); customRec.setInternalId("202");

ReadResponse response=_port.get(customRec);

CustomRecord record=(CustomRecord)response.getRecord();
CustomFieldList fields=record.getCustomFieldList();

CustomFieldRef[] crcf=fields.getCustomField();
int i=1;
Map<String,Object> test=new HashMap<String,Object>();
for(CustomFieldRef c:crcf)
{
    System.out.println(c.getScriptId());
    if(c instanceof StringCustomFieldRef)
    {
        test.put(p.getProperty(c.getScriptId()),((StringCustomFieldRef)c).getValue());
    }else if(c instanceof DateCustomFieldRef)
    {
        test.put(p.getProperty(c.getScriptId()),((DateCustomFieldRef)c).getValue().getTime());
    }
    else if(c instanceof LongCustomFieldRef)
    {
        test.put(p.getProperty(c.getScriptId()),((LongCustomFieldRef)c).getValue());
    }
    //System.out.println(c.getLabel()+" fieldtypes:  "+c.getFieldType().getValue());
i++;
}
for(Map.Entry<String,Object> entry:test.entrySet())
{
    System.out.println(entry.getKey()+"--->"+entry.getValue());
于 2014-06-05T11:46:19.660 回答
0

这是 C# 或 Java——不是我的强项。但是,在加载记录后,您应该能够执行以下操作:

记录.字段名

于 2014-03-19T18:20:04.880 回答