SlideShare a Scribd company logo
1 of 9
Download to read offline
Driving field level validations using
Javascript API in Oracle Talent Acquisition
Cloud
Jiju Vengal
Oracle Consulting
www.peoplesofthrms.blogspot.com
Table of Contents
1 INTRODUCTION..........................................................................................................3
2 Understanding the javascript api..............................................................................4
3 APPLICATION OF javascript functionS in tee 14a ..................................................5
3.1 Calculating and Setting offer components....................................................................5
4 CONCLUSION .............................................................................................................9
1 INTRODUCTION
One of the common requirements in a number of Taleo Enterprise Edition implementations, is the need
to set the value of specific fields based on the value of other fields in a form. A typical example of this
is the need to calculate the components of salary based on the basic salary entered in the offer grid.
The traditional solution for such a requirement is to use Taleo Connect Client to extract data from a
form, carry out data manipulation and import the data back into the specific fields.
An elegant alternative to the above approach is the use of delivered Javascript APIs within Taleo
Enterprise Edition to manipulate data and populate required fields, from within the browser session
itself. This approach brings forth the following advantages:
a) Data manipulation can be carried out at the time of working on a form itself – thereby providing
real time calculation and validation of data.
b) Business users can invoke the javascript directly from the browser, thereby eliminating any
need to involve IT to run TCC scripts.
c) Javascript is a common and powerful language, thus complex logic for data manipulation can
be implemented using this method.
This paper examines the Javascript API functionality that is available in Taleo Enterprise Edition 14A
and provides examples of implementing the Javascript API for field manipulation.
2 UNDERSTANDING THE JAVASCRIPT API
Taleo Enterprise Edition provides a number of Javascript functions within the Candidate, Requisition and Offer forms.
While the support of Javascript on Offer grid is available only from version 14A, prior versions support Javascript
functions on Candidate and Requisitions forms. In this paper, the functions available in 14A will be detailed.
The primary purpose of the Javascript APIs is to provide a mechanism for users to interact with the data in the forms
and apply customer specific logic. The following main Javascript functions are available in version 14A
Function Purpose Example syntax
getLoggedInUserAttribute Returns the value of an attribute of
the user currently logged in
Recruiting Center
Takes as input the ID of the
attribute for which to return the
value (ex: loginname,
employeeId)
javascript:getLoggedInUserAttribute("loginname");
viewSource Opens a new page with a list of all
the fields that can be interacted
with.
javascript: viewSource();
getTextInControl Returns the value of a specific
field in the form. This function can
be utilised to extract the value of a
field in a form.
javascript: getTextInControl("requisitionTitle");
setTextInControl Sets the value of a specific field in
a form. This function can be used
to override the value of a field in a
form. It is to be noted that not all
fields in a form can be
manipulated using this function.
To see the fields that can be set a
value on, use the “viewSource”
function to first retrieve the list of
fields in a form and the attribute
whether a value can be set or not.
javascript: setTextInControl("requisitionTitle", “new
value");
As can be seen above, the various Javascript functions can be effectively utilised to manipulate data that is available in
a Requisition, Candidate or Offer forms. The two primary functions of use will be:
(a) getTextInControl
(b) setTextInControl
getTextInControl can be utilised to read data from a specific field on the form and extract the information. This
information can be utilised further to manipulate data in a form or be used to write to a file.
setTextInControl is extremely useful, as it provides us with the ability to programmatically manipulate data on a form.
With the programming capability provided by Javascript, this function can be used to set a value to a field, based on
complex calculations.
3 APPLICATION OF JAVASCRIPT FUNCTIONS IN TEE 14A
The Javascript functions can be invoked directly on the browser, using the Bookmark or Favourite functionality available
in most browsers. Most browsers support the ability to add a javascript function call as a bookmark/favourite. Once this
is done, users can simply execute the script by clicking on the bookmark when the user is in the appropriate form in
TEE. The below section details examples on using the Javascript API in TEE.
3.1 Calculating and Setting offer components
Problem Statement:
In many countries, the various components of salary is calculated based on the base salary. Thus, it might be
required to automatically calculate the components once the base salary is entered.
Let us take a simple example where there is a salary component called “Provident Fund” which is calculated as 12 %
of the basic Annualized Salary. A screenshot of the offer grid and relevant fields is given below:
The requirement is that the value of Provident Fund field should be automatically calculated based on the value
entered in the Annualized Salary field.
Solution Approach:
The solution can be broken down into the following steps:
(a) Use the getTextInControl Javascript function to retrieve the value entered in the Annualized Salary field.
(b) Multiple the value returned by getTextInControl by 0.12
(c) Use the setTextInControl Javascript function to set the value of the Provident Fund field, to the value
calculated in step (b).
Sample Javascript code:
The Javascript code that can be used to carry out the above requirement is given below:
javascript:(function()
{var x= getTextInControl("salary");
var y=x * 0.12;
setTextInControl("EBA_5fName_5fOUDF",y);}
())
Details of the code is given below:
(a) The function getTextInControl is used to read the value in the field salary and return to variable “X”. “Salary”
is the field id corresponding to the “Annualized Salary” field.
(b) Variable “X” which holds the value of Annualized Salary is multiplied by 0.12 and the result is stored in
variable “Y”.
(c) The function setTextInControl is used to set the value of “Provident Fund” field with the value present in
variable “Y”.
(d) “EBA_5fName_5fOUDF” is the field id corresponding to the “Provident Fund” field.
How to get the Field Id of the fields on a form?
Use the Javascript function “javascript: viewSource();” to open up a new page with the Field Ids of the fields on
a form that can be manipulated using the Javascript API.
Adding the code as a Bookmark:
To execute the above code and to carry out automatic calculation of provident fund field, it is required to add the
above code as a Bookmark on a browser, in this case Mozilla Firefox. The steps to add a bookmark will vary based on
the browser being used. Adapt the appropriate methodology for the browser of your choice.
The following steps can be followed to add as a bookmark:
(a) Open any browser, let’s say Mozilla Firefox
(b) Click on the option to “Show All Bookmarks”
(c) Select the “New Bookmark” option:
(d) Enter an appropriate name and paste the javascript code in the “Location” field. In other browsers, location
field could correspond to URL. Paste in the appropriate field.
(e) Click on “Add” to add the bookmark.
Seeing the API in action:
In this section, we will see how to invoke the API to automatically calculate the value of the Provident Fund field in the
offer gird.
(a) Access the Offer Grid in Edit mode of a candidate:
(b) As can be seen above, Annualized Salary has been entered. Next step is to use the Bookmark to
automatically calculate the value in Provide Fund (PF) field.
(c) Access the Favourite/Bookmark menu and click on the added Bookmark that contains the Javascript to
calculate value of the Provident Fund field. Click on the Bookmark.
(d) After clicking on the Bookmark, it will be seen that the calculated value is automatically populated in the
“Provident Fund” field. A sample screenshot is given below:
As can be seen from this example, the Javascript API method provides a real time means of updating data in a form.
This can be carried out by business users simply by clicking a browser bookmark and thus is an efficient mechanism
to handle data manipulations on forms.
4 CONCLUSION
The Javascript API is a powerful tool that can aid in the real time interaction with data in Requisition, Candidate and
Offer Forms. This method can be effectively utilised to provide elegant solutions to requirements which require real time
manipulation of data in the above three forms. Over and above the business scenario detailed in this paper, there are
a number of use cases where this feature can be utilised. Some of the potential use cases are detailed below:
(a) Extraction of information from forms
(b) Validation of data on forms, including overriding manually entered data with calculated values
(c) Issuing warning/error messages based on field validations
Consultants and System Administrators are encouraged to make use of this functionality to extend the features of the
product and to drive up end user productivity.

More Related Content

Recently uploaded

100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...
100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...
100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...hyt3577
 
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)Delhi Call girls
 
RecruZone - Your Recruiting Bounty marketplace
RecruZone - Your Recruiting Bounty marketplaceRecruZone - Your Recruiting Bounty marketplace
RecruZone - Your Recruiting Bounty marketplaceDavide Donghi
 
Mastering Vendor Selection and Partnership Management
Mastering Vendor Selection and Partnership ManagementMastering Vendor Selection and Partnership Management
Mastering Vendor Selection and Partnership ManagementBoundless HQ
 
Webinar - How to set pay ranges in the context of pay transparency legislation
Webinar - How to set pay ranges in the context of pay transparency legislationWebinar - How to set pay ranges in the context of pay transparency legislation
Webinar - How to set pay ranges in the context of pay transparency legislationPayScale, Inc.
 
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjan
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In ArjanArjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjan
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjanparisharma5056
 
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate Investments
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate InvestmentsPerry Lieber Your Trusted Guide in the Dynamic World of Real Estate Investments
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate InvestmentsPerry Lieber
 
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...Jasper Colin
 
Mercer Global Talent Trends 2024 - Human Resources
Mercer Global Talent Trends 2024 - Human ResourcesMercer Global Talent Trends 2024 - Human Resources
Mercer Global Talent Trends 2024 - Human Resourcesmnavarrete3
 
Cleared Job Fair Handbook | May 2, 2024
Cleared Job Fair Handbook  |  May 2, 2024Cleared Job Fair Handbook  |  May 2, 2024
Cleared Job Fair Handbook | May 2, 2024ClearedJobs.Net
 

Recently uploaded (10)

100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...
100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...
100%Safe delivery(+971558539980)Abortion pills for sale..dubai sharjah, abu d...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Vinod Nagar East (Delhi)
 
RecruZone - Your Recruiting Bounty marketplace
RecruZone - Your Recruiting Bounty marketplaceRecruZone - Your Recruiting Bounty marketplace
RecruZone - Your Recruiting Bounty marketplace
 
Mastering Vendor Selection and Partnership Management
Mastering Vendor Selection and Partnership ManagementMastering Vendor Selection and Partnership Management
Mastering Vendor Selection and Partnership Management
 
Webinar - How to set pay ranges in the context of pay transparency legislation
Webinar - How to set pay ranges in the context of pay transparency legislationWebinar - How to set pay ranges in the context of pay transparency legislation
Webinar - How to set pay ranges in the context of pay transparency legislation
 
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjan
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In ArjanArjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjan
Arjan Call Girl Service #$# O56521286O $#$ Call Girls In Arjan
 
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate Investments
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate InvestmentsPerry Lieber Your Trusted Guide in the Dynamic World of Real Estate Investments
Perry Lieber Your Trusted Guide in the Dynamic World of Real Estate Investments
 
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...
Will Robots Steal Your Jobs? Will Robots Steal Your Jobs? 10 Eye-Opening Work...
 
Mercer Global Talent Trends 2024 - Human Resources
Mercer Global Talent Trends 2024 - Human ResourcesMercer Global Talent Trends 2024 - Human Resources
Mercer Global Talent Trends 2024 - Human Resources
 
Cleared Job Fair Handbook | May 2, 2024
Cleared Job Fair Handbook  |  May 2, 2024Cleared Job Fair Handbook  |  May 2, 2024
Cleared Job Fair Handbook | May 2, 2024
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Field level validations in Taleo using Javascript API

  • 1. Driving field level validations using Javascript API in Oracle Talent Acquisition Cloud Jiju Vengal Oracle Consulting www.peoplesofthrms.blogspot.com
  • 2. Table of Contents 1 INTRODUCTION..........................................................................................................3 2 Understanding the javascript api..............................................................................4 3 APPLICATION OF javascript functionS in tee 14a ..................................................5 3.1 Calculating and Setting offer components....................................................................5 4 CONCLUSION .............................................................................................................9
  • 3. 1 INTRODUCTION One of the common requirements in a number of Taleo Enterprise Edition implementations, is the need to set the value of specific fields based on the value of other fields in a form. A typical example of this is the need to calculate the components of salary based on the basic salary entered in the offer grid. The traditional solution for such a requirement is to use Taleo Connect Client to extract data from a form, carry out data manipulation and import the data back into the specific fields. An elegant alternative to the above approach is the use of delivered Javascript APIs within Taleo Enterprise Edition to manipulate data and populate required fields, from within the browser session itself. This approach brings forth the following advantages: a) Data manipulation can be carried out at the time of working on a form itself – thereby providing real time calculation and validation of data. b) Business users can invoke the javascript directly from the browser, thereby eliminating any need to involve IT to run TCC scripts. c) Javascript is a common and powerful language, thus complex logic for data manipulation can be implemented using this method. This paper examines the Javascript API functionality that is available in Taleo Enterprise Edition 14A and provides examples of implementing the Javascript API for field manipulation.
  • 4. 2 UNDERSTANDING THE JAVASCRIPT API Taleo Enterprise Edition provides a number of Javascript functions within the Candidate, Requisition and Offer forms. While the support of Javascript on Offer grid is available only from version 14A, prior versions support Javascript functions on Candidate and Requisitions forms. In this paper, the functions available in 14A will be detailed. The primary purpose of the Javascript APIs is to provide a mechanism for users to interact with the data in the forms and apply customer specific logic. The following main Javascript functions are available in version 14A Function Purpose Example syntax getLoggedInUserAttribute Returns the value of an attribute of the user currently logged in Recruiting Center Takes as input the ID of the attribute for which to return the value (ex: loginname, employeeId) javascript:getLoggedInUserAttribute("loginname"); viewSource Opens a new page with a list of all the fields that can be interacted with. javascript: viewSource(); getTextInControl Returns the value of a specific field in the form. This function can be utilised to extract the value of a field in a form. javascript: getTextInControl("requisitionTitle"); setTextInControl Sets the value of a specific field in a form. This function can be used to override the value of a field in a form. It is to be noted that not all fields in a form can be manipulated using this function. To see the fields that can be set a value on, use the “viewSource” function to first retrieve the list of fields in a form and the attribute whether a value can be set or not. javascript: setTextInControl("requisitionTitle", “new value"); As can be seen above, the various Javascript functions can be effectively utilised to manipulate data that is available in a Requisition, Candidate or Offer forms. The two primary functions of use will be: (a) getTextInControl (b) setTextInControl getTextInControl can be utilised to read data from a specific field on the form and extract the information. This information can be utilised further to manipulate data in a form or be used to write to a file. setTextInControl is extremely useful, as it provides us with the ability to programmatically manipulate data on a form. With the programming capability provided by Javascript, this function can be used to set a value to a field, based on complex calculations.
  • 5. 3 APPLICATION OF JAVASCRIPT FUNCTIONS IN TEE 14A The Javascript functions can be invoked directly on the browser, using the Bookmark or Favourite functionality available in most browsers. Most browsers support the ability to add a javascript function call as a bookmark/favourite. Once this is done, users can simply execute the script by clicking on the bookmark when the user is in the appropriate form in TEE. The below section details examples on using the Javascript API in TEE. 3.1 Calculating and Setting offer components Problem Statement: In many countries, the various components of salary is calculated based on the base salary. Thus, it might be required to automatically calculate the components once the base salary is entered. Let us take a simple example where there is a salary component called “Provident Fund” which is calculated as 12 % of the basic Annualized Salary. A screenshot of the offer grid and relevant fields is given below: The requirement is that the value of Provident Fund field should be automatically calculated based on the value entered in the Annualized Salary field. Solution Approach: The solution can be broken down into the following steps: (a) Use the getTextInControl Javascript function to retrieve the value entered in the Annualized Salary field. (b) Multiple the value returned by getTextInControl by 0.12 (c) Use the setTextInControl Javascript function to set the value of the Provident Fund field, to the value calculated in step (b). Sample Javascript code: The Javascript code that can be used to carry out the above requirement is given below: javascript:(function() {var x= getTextInControl("salary"); var y=x * 0.12; setTextInControl("EBA_5fName_5fOUDF",y);} ())
  • 6. Details of the code is given below: (a) The function getTextInControl is used to read the value in the field salary and return to variable “X”. “Salary” is the field id corresponding to the “Annualized Salary” field. (b) Variable “X” which holds the value of Annualized Salary is multiplied by 0.12 and the result is stored in variable “Y”. (c) The function setTextInControl is used to set the value of “Provident Fund” field with the value present in variable “Y”. (d) “EBA_5fName_5fOUDF” is the field id corresponding to the “Provident Fund” field. How to get the Field Id of the fields on a form? Use the Javascript function “javascript: viewSource();” to open up a new page with the Field Ids of the fields on a form that can be manipulated using the Javascript API. Adding the code as a Bookmark: To execute the above code and to carry out automatic calculation of provident fund field, it is required to add the above code as a Bookmark on a browser, in this case Mozilla Firefox. The steps to add a bookmark will vary based on the browser being used. Adapt the appropriate methodology for the browser of your choice. The following steps can be followed to add as a bookmark: (a) Open any browser, let’s say Mozilla Firefox (b) Click on the option to “Show All Bookmarks” (c) Select the “New Bookmark” option:
  • 7. (d) Enter an appropriate name and paste the javascript code in the “Location” field. In other browsers, location field could correspond to URL. Paste in the appropriate field. (e) Click on “Add” to add the bookmark. Seeing the API in action: In this section, we will see how to invoke the API to automatically calculate the value of the Provident Fund field in the offer gird. (a) Access the Offer Grid in Edit mode of a candidate: (b) As can be seen above, Annualized Salary has been entered. Next step is to use the Bookmark to automatically calculate the value in Provide Fund (PF) field.
  • 8. (c) Access the Favourite/Bookmark menu and click on the added Bookmark that contains the Javascript to calculate value of the Provident Fund field. Click on the Bookmark. (d) After clicking on the Bookmark, it will be seen that the calculated value is automatically populated in the “Provident Fund” field. A sample screenshot is given below: As can be seen from this example, the Javascript API method provides a real time means of updating data in a form. This can be carried out by business users simply by clicking a browser bookmark and thus is an efficient mechanism to handle data manipulations on forms.
  • 9. 4 CONCLUSION The Javascript API is a powerful tool that can aid in the real time interaction with data in Requisition, Candidate and Offer Forms. This method can be effectively utilised to provide elegant solutions to requirements which require real time manipulation of data in the above three forms. Over and above the business scenario detailed in this paper, there are a number of use cases where this feature can be utilised. Some of the potential use cases are detailed below: (a) Extraction of information from forms (b) Validation of data on forms, including overriding manually entered data with calculated values (c) Issuing warning/error messages based on field validations Consultants and System Administrators are encouraged to make use of this functionality to extend the features of the product and to drive up end user productivity.