This topic contains 2 replies, has 0 voices, and was last updated by AnaMG 7 years, 3 months ago.

  • Author
    Posts
  • #18358

    AnaMG

    Does anybody know what the fieldId is for the salesteam subrecord?

    I have been trying different names, I cannot find documentation about it.

    I tried: salesteam, salesteamteam

    Code:
    require([‘N/record’],
    function(record){

    var soRecord = record.load({ type : record.Type.SALES_ORDER, id:552371, isDynamic : false });

    soRecord.insertLine({sublistId:’salesteam’,line:0});

    var salesteamSubrecord = soRecord.getSublistSubrecord({sublistId : ‘salesteam’, fieldId : ‘???????’, line:0});

    salesteamSubrecord.setValue ({ fieldId : ‘isprimary’, value : true});

    var id = soRecord.save({ enableSourcing : true, ignoreMandatoryFields:true });

    function execute(){
    }
    return {
    execute: execute

    };

    });
    Thank you very much in advance,

    Ana
    This is a cached copy. Click here to see the original post.

  • #18359

    Lakshmi Narayana

    Hi Ana I hope this helps.. soRecord.getSublistSubrecord({sublistId : ‘salesteam’, fieldId–> : ’employee’, line:0});

  • #18360

    AnaMG

    I got this one to work, it is a customer not a sales order

    Code:
    require([‘N/record’],
    function(record){

    var custRecord = record.load({ type : record.Type.CUSTOMER, id: 1417121, isDynamic : false });

    custRecord.insertLine({sublistId: ‘salesteam’, line:0});

    custRecord.setSublistValue({
    sublistId:’salesteam’,
    fieldId: ‘salesrole’,
    value: ‘-2′,
    line: 0
    });
    custRecord.setSublistValue({
    sublistId:’salesteam’,
    fieldId: ’employee’,
    value: 1183656,
    line: 0
    });
    custRecord.setSublistValue({
    sublistId:’salesteam’,
    fieldId: ‘isprimary’,
    value: true,
    line: 0
    });
    custRecord.setSublistValue({
    sublistId:’salesteam’,
    fieldId: ‘contribution’,
    value: 0.00,
    line: 0
    });

    var id = custRecord.save({ enableSourcing : true, ignoreMandatoryFields:true });

    function execute(){
    }
    return {
    execute: execute

    };

    });
    Thanks

You must be logged in to reply to this topic.