Getting the value of a custom field from a workspace using javascript api
Content
Hi All,
I have a browser control on a workspace with a script that runs onLoad. The purpose of this script is to perform some validation on a custom date field (prevent an agent from entering a future date). The issue I'm facing is that I can not get the value of my custom field (which is a custom field on incident). The variable is always showing as undefined. I have included some relevant code snippets below. For now I'm just comparing the current month to the custom field month.
Version
FEB 2016Code Snippet
function CheckDate(){ //get the current date var curDate = new Date(); var curDay = curDate.getDate(); var curMonth = curDate.getMonth()+1; var curYear = curDate.getFullYear(); //get the custom incident custom field var recDate = window.external.Incident.GetCustomFieldByName("c$receipt_date"); //if the date custom field is not null if(recDate){ //get the day, month and year of the custom field var recDay = recDate.getDate(); var recMonth = recDate.getMonth()+1; var recYear = recDate.getFullYear(); //if the recmonth is greater than current month if (recMonth > curMonth){
0