Prabhu
Prabhu

Reputation: 927

How to get record by Id without recordType in netsuite?

I could get record by below code

record.load(recordType, id)

For above function, both args are required.

Any way to get record by id alone without recordType in netsuite suitescript 2.0?

Upvotes: 1

Views: 3465

Answers (1)

Emerson Minero
Emerson Minero

Reputation: 608

That is not possible, you do have to get the recordType but in case your records are transactions such as: Sales Orders, Purchase Orders, Invoices, etc.

You can use the following code to get the recordType only having the id:

                    var recordType = search.lookupFields({
                         type: search.Type.TRANSACTION,
                         id: your_record_id,
                         columns: 'type'
                    });

then you can use the record.load for your needs.

Upvotes: 6

Related Questions