certificateControl.createCertificate(options)

Note:

The content in this help topic pertains to SuiteScript 2.0 and SuiteScript 2.1.

Method Description

Creates a certificate record on the Certificates page using a file from the File Cabinet.

Note:

Your role must have Create, Edit, or Full access to the Certificate Access permission to create certificates using SuiteScript.

Returns

certificateControl.Certificate

Supported Script Types

Server scripts

For additional information, see SuiteScript 2.x Script Types.

Governance

10 units

Module

N/certificateControl Module

Since

2019.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.file

file

required

A File Object Members object. The file must already be uploaded to the File Cabinet.

2019.2

options.password

string

optional

If applicable, the password associated with your digital certificate. The script ID of an API secret can be accepted. For more information, see Secrets Management.

2019.2

options.scriptId

string

optional

The desired script ID of the certificate record. The script ID is automatically prefixed with custcertificate.

2019.2

options.description

string

optional

The description of the certificate record.

2019.2

options.subsidiaries

number[] or string[]

optional

The internal ID of subsidiaries associated with the certificate in either number or string format.

2019.2

options.restrictions

number[] or string[]

optional

The internal ID of employees selected in the Restricted to Employees field for a certificate. You can enter the internal ID in either number or string format.

2019.2

options.notifications

number[] or string[]

optional

The internal ID of employees selected in the Copy Employees field on the certificate record. You can enter the internal ID in either number or string format.

2019.2

options.name

string

required

The name of the certificate record.

2019.2

options.weekReminder

boolean

optional

The setting for the Expiration Reminder : Week checkbox.

2019.2

options.monthReminder

boolean

optional

The setting for the Expiration Reminder : Month checkbox.

2019.2

options.threeMonthsReminder

boolean

optional

The setting for the Expiration Reminder : 3 Months checkbox.

2019.2

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/certificateControl Module Script Samples.

              //Add additional code
...
var fileObj = file.load({
        id: 'SuiteScripts/dsa.p12'
    });
    var options = {
        file : fileObj,
        password : '022b490ad4334c7e86a8304f937ec68f',
        name : 'testCert',
        description : 'testDescription',
        scriptId : '_testid',
        subsidiaries : [1,3],
        weekReminder : false,
        monthReminder : true,
        threeMonthsReminder : false
    };
    var newCertificate = cc.createCertificate(options);
    newCertificate.save();
...
//Add additional code 

            

Related Topics

General Notices