FAFR - Sample script to have the additional field value appended to the actual subject line

FAFR - Sample script to have the additional field value appended to the actual subject line

Here is a sample script to be used in FAFR to have the additional field info appended to the actual subject line,

var contract=$CS.getValue("WorkOrder_Fields_UDF_CHAR5");
var subject=$CS.getValue("SUBJECT");
var new_subject = subject + " : " + contract;
if($CS.isFormSubmit()){
$CS.setValue("SUBJECT", new_subject); 
}

Below is the Field and Form Rule that you have to create it in the specific template under On Form Submit.



Please note the Field name differs for each additional field, hence replace it with the right one. You can identify the field name from the Write/Edit Custom script page.




                  New to ADSelfService Plus?

                    • Related Articles

                    • Custom Module-Based Dependent Fields with FAFR

                      In the dynamic world of IT service management, form simplicity and accuracy play a major role in how smoothly requests are handled. However, many organizations face a recurring challenge—dependent field limitations within ServiceDesk Plus. Currently, ...
                    • Script to set fields from CSV using FAFR.

                      Works in 10604 Requirement: Load Data from CSV depending on the value selected in an additional field. Usecase: Assume there are 3 additional fields for a request template, namely, "Reference number", "Payment type and "Vendor". "Reference number" is ...
                    • Script to Populate User Additional Field under Incident Template using FAFR

                      The script load the Requester Name under Incident Additional field ( As a pick list), by choosing the requester name under additional field the script populates the user additional field value. * Kindly create two additional fields under Admin -> ...
                    • How to populate requester details in request additional field

                      Requirement: Populate requester additional field information into request additional field. Usecase: Let us consider a scenario where certain employee details are imported from the Active Directory into User - Additional Fields. The business ...
                    • Custom script to add content from an additional field next to subject in a request Template

                      Please follow the below steps: * Open the desired request template and Navigate to Field and form rules. * Click "on field change" and create new rule. * Set rule execution as "On Create / Edit" * Set "Execute script" as action. * Add the below ...