Copy link to clipboard
Copied
I'm hoping if someone can tell me if this is even possible.
I have a dropdown list of work orders the user can select from which populates the number to another field called WO1. The WO1 text field also has a custom calculation script that adds a slash and period to the number ie. /11223344.
Is it possible for the user to be able to enter custom text in the same dropdown text field without choosing from the list and still have what they entered populate to the WO1 text field?
Thanks!
//CUSTOM KEYSTROKE ON DROPDOWN TEXT FIELD
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["WO1","UnitofMeasure1"]);
else
SetFieldValuesWO1(event.value);
}
//JAVASCRIPT DOCUMENTATION
var WOData = { "112233 Inspection":{ WO: "112233",
UOM: "Hrs" },
"445566 General Maintenance":{ WO: "445566",
UOM: "Hrs" },
"778899 Customer Service" :{ WO: "778899",
UOM: "Hrs" }};
function SetFieldValuesWO1(cWOName)
{
this.getField("WO1").value = WOData[cWOName].WO;
this.getField("UnitofMeasure1").value = WOData[cWOName].UOM;
}
//CUSTOM KEYSTROKE IN WO TEXT FIELD
if (event.value) event.value = "\\" + event.value + ".";
Copy link to clipboard
Copied
I've added a document that will hopefully help explain what I'm trying figure out. I have a custom calculation script in the WOEmp1 and WOEmp2 text fields that populate the work order numbers on dropdown list and the absence type chosen. I currently have a seperate text field next to Work Order # set up so the work orders on the dropdown list populates there. This is a fillable text field which I also need to populate to WOEmp1 and WOEmp2. Optionally, the dropdown list could be fillable, either way I need to have the fillable text populate. How can I do this?
Another option I was thinking could be to add a custom calculation script to the WO1 text field based on what's been entered in another text field. The problem is one of the text fields I need to populate may need to be manually entered. I'm struggling with how to do this.
//CUSTOM CALCULATION SCRIPT
var a ="";
if (this.getField("AbsencePayType1").value == "Vacation"){
a="123";
} else if (this.getField("WorkOrders1").value == "112233 Inspection "){
a="112233";
} else if (this.getField("WorkOrders1").value == "445566 General Maintenance "){
a="445566";
} else if (this.getField("WorkOrders1").value == " 778899 Customer Service "){
a="778899";
}
event.value = a;