Performance and Security Flashcards
What should we do with mission critical User Event scripts if we want to account for any errors or misfires?
Create a “clean up” scheduled script to make sure user events performed as they should have.
True or False?
User Event scripts can trigger other user event scripts.
False
UE scripts cannot trigger other UE scripts
What should we do with common code that is used across multiple User Event scripts?
Create a custom module, or a “library”, that contains that common code.
True or False?
It is should NOT read sensitive field values from a User Event script
True.
As a best practice, how can we limit the scope of a User Event from within the script itself?
We can use the context object, and context.UserEventType enum to define a limit the scope of a UE script
When should we use the afterSubmit entry point in a User Event script?
When using an operation that depends on the submitted record already being committed to the database
When updating transaction line items in a beforeSubmit script we must ensure that the line item totals, net taxes and discounts are equal to what 4 fields?
summarytotal
discounttotal
shippingtotal
taxtotal
Why is creating many UE scripts for a single record discouraged?
It greatly increases load times and hinders user experience
To set a field on a record or make any changes to a record being submitted, which entry point should we use?
beforeSubmit
Any post-processing operations of a current record should be done in what user event?
afterSubmit
If you want to store a value during a beforeLoad operation and then read that value during an afterSubmit operation in the same script, as a best practice, what should you do?
Create a hidden custom field on the form to store the value. Value stored in beforeLoad in this field and then the value is retrieved from this field in afterSubmit
What does the execution context setting on a User Event specify?
How and when a UE is triggered. (e.g., Only trigger from UI, Only trigger from Suitelet, etc…)
Limit the amount of script execution in UE scripts. Time taken to execute should be less than..?
5 seconds
What should we use to test performance of user event scripts deployed to a specific record type?
The Script Performance Monitor SuiteApp
What should we use for debugging a User Event?
The debugger; statements on the browser console
This statement can also be used in the SuiteScript Debugger to help debug server scripts
True or False?
Activities on a hosted website can trigger server-side scripts
True
Scripts on Sales Order, Case, and Customer records also execute in response to web activities.
True or False?
We should use inline editable child custom records when processing child records during UE on a parent record
True
What 4 things can we do to optimise search filters?
◦ Filter inactive records
◦ Shorter date range
◦ Faster operators (e.g. starts with, between, and within are faster than contains or formulas)
◦ Remove unnecessary columns
Why should we try to combine searches of the same record type by using merged filters where possible?
This improves performance by reducing search instances
How many results does N/search return?
N/search returns the first 1000 results
If we want N/search to return more results, what can we do, and what is the limit?
Can return a resultSet, but the limit is 4000 results
Alternatively, can use pagination for N/search to return more than 1000 results
When returning a large dataset with N/search:
If a record that originally fit the search criteria is updated and no longer fits the criteria, what happens?
It is skipped by the search.
In this case, some records that were originally included in the search results may not be returned, and the total number of returned records may be smaller than the original total number of results.
When returning a large dataset with N/search:
If new records are created that fit the search criteria, what happens?
They are also returned.
The total number of returned records may be higher after you page through the results than the original total number of results, and duplicate results may be returned.
When returning a large dataset with N/search:
If a record from the first results page is updated and it no longer fits the criteria when going through subsequent pages of search results, what could be a concern?
Results may be missing.
For example, if a record from the first results page is updated and it no longer fits the criteria, another record now fits into page one. However, because earlier pages are skipped when going through subsequent pages of search results, this record is not returned.