C# NetSuite WebServices: Get value from custom field in saved search (ItemSearchAdvanced)

淺唱寂寞╮ 提交于 2019-12-02 03:17:25

Try setting scriptId with the ID of the field ("custitem_xyz"). That should work.

Before 2013 one would use internalId, but since then it changed to scriptId.

You would need to loop over the CustomRecord items in the customFieldList. I then usually check for a specific type so I can cast to the correct object, but with some reflection you could probably avoid that.

foreach (Record r in mySearchResponse.recordList){
  foreach (CustomFieldRef cr in ((CustomRecord)r).customFieldList){
    if (cr.GetType().Name == "SelectCustomFieldRef"){
      if (((SelectCustomFieldRef)cr).scriptId == "my_custom_field"){
        internalID = ((CustomRecord)r).internalId;
      }
    }
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!