This topic contains 3 replies, has 0 voices, and was last updated by gourisankar 5 years, 9 months ago.

  • Author
    Posts
  • #21270 Score: 0

    adityasrivalli
    • Contributions: 0
    • Level 1

    Need help in understanding how we can access the custom fields set on the address subrecord.

    Basically I am loading the customer record in dynamic mode and read the custom field values on the address subrecord using the subrecord view sublist API's , no luck ended up with errors invalid subrecord operation.

    Tried using the record API, viewSubrecord() => resulted in SSS_INVALID_FIELD_ON_SUBRECORD_OPERATION.

    Request ideas on how to achieve this.

    Thank you,
    This is a cached copy. Click here to see the original post.

  • #21271 Score: 0

    seifer
    • Contributions: 0
    • Level 1

    Hi there

    You've got the same problem I posted over a year ago at https://usergroup.netsuite.com/users…ress-subrecord

    Unfortunately, I never worked out a solution.

    Good luck. Hopefully someone figures this out.

    Maybe time to explore doing this in SuiteScript 2.0 ?

    Kane

  • #21272 Score: 0

    adityasrivalli
    • Contributions: 0
    • Level 1

    I tried using an inline Suitelet to extract the required info on the client script that worked as expected.

    HTML Code:
    function testClient(type){
    var url = nlapiResolveURL('SUITELET', 142, 'customdeploy1');
    var val = nlapiRequestURL("https://system.netsuite.com/"+url+"&custparam_cu=7");
    nlapiSetFieldValue('memo',val.getBody());
    }

    function suiteletFromClient(request,response){
    var cu = request.getParameter('custparam_cu');
    var rec = nlapiLoadRecord('customer',cu);
    var addr = rec.viewLineItemSubrecord('addressbook','addressbookaddress',1);
    var val = addr.getFieldValue('custrecord14');
    response.write(val);
    }

  • #21273 Score: 0

    gourisankar
    • Contributions: 0
    • Level 1

    Hi Aditya,

    var cu = request.getParameter('custparam_cu'); var record = nlapiLoadRecord('customer', cu,{recordmode: 'dynamic'});

    record.selectLineItem('addressbook', 1);

    var subrecord = record.viewCurrentLineItemSubrecord('addressbook', 'addressbookaddress');

    var country = subrecord.getFieldValue('custrecord14');

You must be logged in to reply to this topic.