This topic contains 2 replies, has 0 voices, and was last updated by timgordon 6 years, 9 months ago.

  • Author
    Posts
  • #17809

    timgordon

    Does anyone have a code snippet on hand that adds a User Note to a sales order? If you have done this before I would really appreciate it if you could share the code.
    This is a cached copy. Click here to see the original post.

  • #17810

    JohnCCole

    The sales order needs to be successfully saved first but once it has, here’s a SuiteScript 1.0 example

    Code:
    var nte = new nlapiCreateRecord(‘note’);
    nte.setFieldValue(‘note’,’Some note’);
    nte.setFieldValue(‘transaction’,salesOrderInternalId);
    nlapiSubmitRecord(nte)
    2.0 way

    Code:
    var nte = record.create({
    type:’note’,
    isDynamic: true
    });

    nte.setValue({fieldId:’transaction’,value:salesOrderInternalId});
    nte.setValue({fieldId:’title’,value:’Note Title’});
    nte.setValue({fieldId:’note’, value:’Some note’});

    var strNoteID = nte.save({
    enableSourcing: true,
    ignoreMandatoryFields: true
    });

  • #17811

    timgordon

    Perfect, thats a big help, thanks John

You must be logged in to reply to this topic.