You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SuiteScript技术问题:如何查询库存调拨子记录的字段ID

Got it, let's figure out how to get those subrecord line item field IDs for your bin transfer Restlet. Here are the most straightforward methods I've used in NetSuite:

1. Check the NetSuite UI (Quickest for most cases)
  • Navigate to the Bin Transfer form (Transactions > Inventory > Bin Transfers) and start creating a new transfer.
  • Hover over the label of the subrecord field you need (like inventory detail bin or quantity), right-click, and select "Inspect" (using Chrome/Firefox dev tools). Look for the id attribute of the associated input element – it’ll typically be formatted like inventorydetail_<fieldid> or just the raw field ID itself.
  • If you have Customization Mode enabled (Setup > Company > Enable Features > SuiteCloud > Customization), click the field label and select "Customize Field" – the field ID will be prominently displayed at the top of the field setup page.
2. Use the REST API Browser
  • Go to Setup > Integration > REST API Browser.
  • Search for the binTransfer record type, expand it, and locate the subrecord you’re working with (like inventoryDetail or the line item sublist).
  • Click into the subrecord, and you’ll see a full list of available fields with their official IDs – this is perfect because it directly maps to the structure you need for your Restlet payload.
3. Log Field IDs via SuiteScript (For tricky cases)

If the UI methods don’t work, whip up a quick SuiteScript 2.x snippet to load a sample bin transfer and log the subrecord fields:

require(['N/record'], function(record) {
    // Replace 123 with a valid existing bin transfer ID
    var binTransfer = record.load({
        type: record.Type.BIN_TRANSFER,
        id: 123
    });
    var lineCount = binTransfer.getLineCount({sublistId: 'inventory'});
    if (lineCount > 0) {
        var inventoryDetail = binTransfer.getSublistSubrecord({
            sublistId: 'inventory',
            fieldId: 'inventorydetail',
            line: 0
        });
        var subFieldIds = inventoryDetail.getFields();
        log.debug('Inventory Detail Field IDs', subFieldIds);
    }
});

Deploy this as a scheduled script or scriptlet, run it, and check the script logs – it’ll spit out every field ID for that subrecord.

4. Check the Customization Workbook

If you have access, go to Customization > Workbook > Customization Workbook. Search for the Bin Transfer record, drill down to the target subrecord, and you’ll find a complete list of fields with their IDs.

Once you have the correct field IDs, you can structure your Restlet payload to include them in the subrecord section. For example:

{
    "inventory": [
        {
            "item": 456,
            "quantity": 10,
            "inventoryDetail": {
                "inventoryAssignment": [
                    {
                        "bin": 789,
                        "quantity": 10
                    }
                ]
            }
        }
    ]
}

内容的提问来源于stack exchange,提问作者jebeeee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 09:12:22