The field value can be set in several ways.
For a field with a single time:
//Set the email without specifying the type. Context.data.client_email = Context.fields.client_email. create('username@example.com');
// Set the email with specifying the type. Context.data.client_email = {
type: EmailType.SomeType,
email: 'username@example.com'
};
Field with the Multiple type:
//Set the email without specifying the type. Context.data.client_email_list = Context.fields.client_email_list. create('username@example.com');
// Set the email with specifying the type. Context.data.client_email_list = Context.fields.client_email_list. create('username@example.com', EmailType.SomeType);
Email
The field value can be set in several ways. For a field with a single time:
//Set the email without specifying the type. Context.data.client_email = Context.fields.client_email. create('username@example.com');
// Set the email with specifying the type. Context.data.client_email = { type: EmailType.SomeType, email: 'username@example.com' };
Field with the Multiple type:
//Set the email without specifying the type. Context.data.client_email_list = Context.fields.client_email_list. create('username@example.com');
// Set the email with specifying the type. Context.data.client_email_list = Context.fields.client_email_list. create('username@example.com', EmailType.SomeType);
// Set multiple email addresses with specifying types. Context.data.client_email_list = [ { type: EmailType.Home, email: 'username001@example.com' }, { type: EmailType.Main, email: 'username002@ example.com' }, { type: EmailType.Work, email: 'username003@example.com' } ];
Please note that when working with scripts, email format validation is not performed.