Tutorial by Examples: c

To create \DateTimeImmutable in PHP 5.6+ use: \DateTimeImmutable::createFromMutable($concrete); Prior PHP 5.6 you can use: \DateTimeImmutable::createFromFormat(\DateTime::ISO8601, $mutable->format(\DateTime::ISO8601), $mutable->getTimezone());
var JSONObject = { stringProp: 'stringProp', booleanProp: false, intProp: 8 } var JSONString = JSON.stringify(JSONObject); console.log(JSONString); /* output * {"stringProp":"stringProp","booleanProp":false,"intProp":8} */
var JSONObject = { stringProp: 'stringProp', booleanProp: false, intProp: 8 } var JSONString = JSON.stringify(JSONObject, null, 2); console.log(JSONString); /* output: * { * "stringProp": "stringProp", * "booleanProp": false, * "...
Usually you'll end up creating models which will contain a state, and that state will be changing during the lifespan of the object. AASM is a finite state machine enabler library that can help you out with dealing with having an easy passing through the process design of your objects. Having some...
A broadcast join copies the small data to the worker nodes which leads to a highly efficient and super-fast join. When we are joining two datasets and one of the datasets is much smaller than the other (e.g when the small dataset can fit into memory), then we should use a Broadcast Hash Join. The f...
The Client Script is one of the more commonly used, and complex, script types available to you. As its name implies, the Client Script runs in the browser, i.e. on the client side. It is the only script type that runs on the client side; all others will execute on the server side of NetSuite. The p...
Closely related to the Client Script is the User Event Script. The events of this Script type are again fired when a record is being loaded or saved, but it instead runs on the server side. As such, it cannot be used to respond immediately to field changes, but it also is not limited to only users i...
There are two types of scripts we can leverage for running background processing on a specific, regular interval; these are the Scheduled and the Map/Reduce scripts. Note that the Map/Reduce script type is only available in SuiteScript 2.0. The Scheduled script is available for both 1.0 and 2.0. Th...
Often we will want to build custom UI pages in NetSuite; enter the Suitelet. The Suitelet script is designed for building internal, custom UI pages. Pages can be free-form HTML, or they can utilize NetSuite's UI Builder APIs to construct forms that follow NetSuite's look and feel. When it is deploy...
Using the Mass Update script, we can build custom Mass Updates for users to perform. This functions just like a normal Mass Update, where the user selects the type of Mass Update, builds a search that returns the records to update, and then each search result is passed individually into the custom M...
Workflows can be somewhat limited in their functionality; for example, workflows cannot interact with line items. The Workflow Action script type is intended to be invoked by a Workflow to add scripting functionality to accomplish what the workflow itself cannot. Workflow Actions have a single onAc...
Lastly, we have the Bundle Installation script type, which provides several events that allow us to interact with the installation, update, and uninstallation of a particular bundle. This is a rarely-encountered script type, but important to be aware of nonetheless. The Bundle Installation includes...
To add a background-image rule via the CSSOM, first get a reference to the rules of the first stylesheet: var stylesheet = document.styleSheets[0].cssRules; Then, get a reference to the end of the stylesheet: var end = stylesheet.length - 1; Finally, insert a background-image rule for the bo...
This is a step by step guide to set up the automated build process using Jenkins CI for your Android projects. The following steps assume that you have new hardware with just any flavor of Linux installed. It is also taken into account that you might have a remote machine. PART I: Initial setup on ...
First of all, Ensure that the user which will be running this call has the Change backup settings and control backup process privilege. # # TC Backup Launcher # Script to launch a backup on the TeamCity Server # Param( [Parameter(Mandatory=$true)][string]$username, [Parameter(Mandato...
PHP lacks a build-in function to encrypt and decrypt large files. openssl_encrypt can be used to encrypt strings, but loading a huge file into memory is a bad idea. So we have to write a userland function doing that. This example uses the symmetric AES-128-CBC algorithm to encrypt smaller chunks of...
Suppose you have two views ViewA and ViewB Instance of ViewB is created inside ViewA, so ViewA can send message to ViewB's instance, but for the reverse to happen we need to implement delegation (so that using delegate ViewB's instance could send message to ViewA) Follow these steps to implement t...
Move to the SQL Server Management Studio menu bar (ALT) Activate the menu for a tool component (ALT+ HYPHEN) Display the context menu (SHIFT+F) Display the New File dialog box to create a file (CTRL+N) Display the Open Project dialog box to open an existing project (CTRL+SHIFT+0) Display the ...
The ClassLoader needs to provide a ProtectionDomain identifying the source of the code: public class PluginClassLoader extends ClassLoader { private final ClassProvider provider; private final ProtectionDomain pd; public PluginClassLoader(ClassProvider provider) { this...

Page 637 of 826