Requisition

You use the requisition record to initiate the purchase process for goods and services needed within your company.

This record is available only when the Requisitions feature is enabled, at Setup > Company > Enable Features, on the Transactions subtab. In the UI, you access this record at Transactions > Purchases/Vendors > Enter Requisitions.

For help working with this record in the UI, see Entering a Requisition.

The internal ID for this record is purchaserequisition.

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

For information about scripting with this record in SuiteScript, see the following help topics:

Supported Script Types

The requisition record is scriptable in both client and server SuiteScript.

All three user events are supported: beforeLoad, beforeSubmit, and afterSubmit.

Supported Functions

The requisition record is fully scriptable, which means that the record can be created, updated, copied, deleted, and searched using SuiteScript. It can also be transformed.

Code Samples

The following sample shows how to add a requisition record and perform other basic tasks.

          // Requisition SuiteScript name

var recType = record.Type.PURCHASE_REQUISITION;



// Create and Add Record

var purchaseReq = record.create({

    type: recType,

    isDynamic: true

})

purchaseReq.setValue({

    fieldId: 'location',

    value: 1

});

purchaseReq.setSublistValue({

    sublistId: 'expense',

    fieldId: 'account',

    line: 1,

    value: 59

});

purchaseReq.setSublistValue({

    sublistId: 'expense',

    fieldId: 'amount',

    line: 1,

    value: 2.3

});

var recId = purchaseReq.save();



// Load and Update

purchaseReq = record.load({

    type: recType,

    id: recId

});

purchaseReq.setValue({

    fieldId: 'memo',

    value: 'memo'

});

var recId2 = purchaseReq.save();



// Search

var result = search.create({

    type: search.Type.TRANSACTION,

    filters: [{

        name: 'internalId',

        operator: search.Operator.ANYOF,

        values: recId

    }],

    columns: [{

        name: 'memo'

    }]

});

// Copy

var purchaseReq2 = record.copy({

    type: recType,

    id: recId

});

var rec2Id = purchaseReq2.save();



// Transformation (Initialization)

var purchaseOrder = record.transform({

    fromType: recType,

    fromId: rec2Id,

    toType: record.Type.PURCHASE_ORDER

});



purchaseOrder.setValue({

    fieldId: 'entity',

    value: '105'

});

var poId = purchaseOrder.save();



// Delete records

var delRecId1 = record.delete({

    type: record.Type.PURCHASE_ORDER,

    id: poId

});

var delRecId2 = record.delete({

    type: recType,

    id: recId

});

var delRecId3 = record.delete({

    type: recType,

    id: rec2Id

}); 

        

Related Topics

General Notices