Script Context Type Values for each scripts

1. User Event Scripts (UE)

Used to determine the action triggering the event:

  • create: A record is being created.
  • edit: A record is being edited.
  • view: A record is being viewed.
  • delete: A record is being deleted.
  • xedit: A record is edited in inline edit mode.
  • approve: A record is being approved.
  • reject: A record is being rejected.
  • cancel: A record is being canceled.
  • copy: A record is being copied.
  • print: A record is being printed.
  • email: A record is being emailed.
  • quickview: A record is being viewed in quick view mode.

2. Client Scripts (CS)

Used to determine the interaction type on the record:

  • create: A record is being created.
  • edit: A record is being edited.
  • view: A record is being viewed.
  • copy: A record is being copied.

3. Suitelet Scripts

Suitelet scripts don’t typically use context.type for execution differentiation, as they are invoked based on requests. Instead, you would use request.method to check for:

  • GET: Handling a GET request.
  • POST: Handling a POST request.

4. Scheduled Scripts

For scheduled scripts, context.type is not used to differentiate execution types, as they are triggered by the scheduling mechanism.

5. RESTlet Scripts

Similar to Suitelets, RESTlets use the HTTP request method to determine execution:

  • GET: Retrieve data.
  • POST: Create data.
  • PUT: Update data.
  • DELETE: Delete data.

6. Map/Reduce Scripts

For Map/Reduce scripts, context.type is used to identify the script stage:

  • getInputData: Identifies the input stage.
  • map: Identifies the map stage.
  • reduce: Identifies the reduce stage.
  • summarize: Identifies the summarize stage.

7. Workflow Action Scripts

Workflow action scripts use:

  • workflowaction: Identifies execution within a workflow action.

8. Portlet Scripts

Portlet scripts use context.mode to determine the portlet type:

  • list: A list portlet.
  • form: A form portlet.
  • html: An HTML portlet.

Leave a comment

Your email address will not be published. Required fields are marked *