How projectrules Works
The projectrules area is where you declare which Project types create which kinds of Cases and the data that will be populated on those Cases. For example:
"program": {
"projectmap": {
"projectassets": "custentity_nxc_project_assets[array]"
},
"projectrules": [{
"//": "PM Annual",
"project": [3],
"case": {
"type": 3,
"custevent_nx_case_asset": "${project.custentity_nx_asset}",
"custevent_nxc_case_assets": "${project.projectassets}",
"details": "comments"
},
"interval": 12,
"unit": "month",
"create": true
}],
},
The projectrules area has an array of objects. Each object has the following properties:
-
project - This property matches the Project type of the Project being processed. It can be written in one of two ways:
-
As an array, For example,
"project": [3,4,5]" -
As a single value. For example,
"project": [3],This means that any project type of 3 will be processed. You can also write the project value as follows:
"project": 3
-
-
case - The property is an object of field values that NetSuite sets on the Case after it's created.
In the following example:
-
Case type will be set to 3
-
Case asset field custevent_nx_case_asset will be set to the asset on the project,
${project.custentity_nx_asset} -
Case_assets multiselect field custevent_nxc_case_assets will be set to the projectassets array declared in the project map using the syntax,
${project.projectassets} -
Details field will be set to the comments field, comments
"case": {
"type": 3,
"custevent_nx_case_asset": "${project.custentity_nx_asset}",
"custevent_nxc_case_assets": "${project.projectassets}",
"details": "comments"
},