Bonus

You can use the bonus record to award different types of bonuses to your employees. To use bonus records, the Compensation Tracking feature must be enabled in your account. For help working with this record in the user interface, see Recording Base Pay Compensation for an Employee.

The internal ID for this record is bonus.

See Bonus Record Action for the action associated with this record. For more information about actions and macros, see Overview of Record Action and Macro APIs.

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:

Supported Script Types

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

Supported Functions

The following SuiteScript functionality is supported:

  • Read

  • Create

  • Update

  • Copy

  • Delete

  • Search

Usage Notes

If a payroll item is associated with the bonus type for the bonus record:

  • The update function is not available.

  • SuitePeople U.S. Payroll determines the status of the bonus. Workflows cannot see these statuses, so you should not use status changes as event triggers.

Script Sample

The following sample shows how to award a bonus.

            require(['N/record'], function (record) {
    var employeeId = 659;     // id of selected employee 
    var bonusTypeId = 1;      // id of previously created bonus type NOTE: bonus type must have same subsidiary as selected employee
    var percentage = 25;      // set percentage of employee salary for given bonus 
    var bonusStatus = 'none'; // bonus status ('none', ready_to_pay', 'being_processed', 'paid', 'cancelled')
    var awardDate = new Date('12/24/2020'); // date in MM/DD/YYYY format
 
    var bonus = record.create({
        type: record.Type.BONUS
    });
 
    bonus.setValue({
        fieldId: 'bonusemployee',
        value: employeeId 
    });
    bonus.setValue({
        fieldId: 'bonustype',
        value: bonusTypeId 
    });
    bonus.setValue({
        fieldId: 'bonusawarddate',
        value: awardDate
    });
    bonus.setValue({
        fieldId: 'bonusstatus',
        value: bonusStatus
    });
    bonus.setValue({
        fieldId: 'bonusamountpercentage',
        value: percentage
    });
 
    bonus.save();
}); 

          

Related Topics

General Notices