Set a field value based on two other fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2017 05:38 PM
I have a field called "CostCenter" and it is based on the value in the "CARSDept" field and the "DeskCode" field. I have created a second table with all three fields in it that contain all the possible values as a lookup. I need to find the matching CostCenter value based on the other two fields that are in my import file when i do an insert. Can someone help me with the script.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2017 07:19 PM
I will give it my best try in the morning, I am watching OU beat up on TCU.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2017 12:15 PM
Berny, I have a screen shot below: The "DeskCode" and the "Billing Dept" are provided in my import file and I need to lookup the Cost center. I have 150 combinations of these 3 values (see second screen shot). your assumption that they filter down is not correct. I think I need a business rull.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 06:14 AM
Hi Jim,
This seems similar to how an incident's priority depends on the impact and urgency. See if a using a data lookup definition works for you. It can apply only for record inserts if you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2019 07:39 AM
Hi,
You can create two Client Scripts, both are onChange() type. One is depend on CostCenter and second is depend on DeskCode.
Both codes are this same
Example below
function onChange() {
//Type appropriate comment here, and begin script below
var dept = g_form.getValue('CostCenter');
var base = g_form.getValue('DeskCode');
if (base == 'DUB'){
if(dept == 'Engineering'){
g_form.setValue('costcenter','ABE89');
}