The CreatorCon Call for Content is officially open! Get started here.

Data Lookup for extended table?

k0a1a
Kilo Expert

Hi Community,

I extended the table incident and now I want to expand out-of-the-box Priority Data Lookup onto this new table.

So I created new entry in dl_definition with the Source Table = MyNewTable and all other options (including Matcher Table) exactly like in "Priority Lookup", the ootb Data Lookup Definition for incident. I also replicated Matcher Field Definitions and Setter Field Definitions.

And then... nothing happens! Priority is still automatically calculated in incident, but not in MyNewTable.

Is anyone aware of any caveats here? - thanks in advance!

10 REPLIES 10

Please confirm if the source_table field on your matcher field definition records and setter field definition is your custom table and not the incident table. You can add the field on list layout or check XML of these records.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Yes that's the case, checked on both Matcher Field Definitions and on the Setter Field Definition, see one of them below.



screenshot2.png


k0a1a
Kilo Expert

In the meantime I tried to inherit from dl_u_priority and specify this new table as Matcher Table, and recreate any Matcher/Setter Field Definitions, and populate new table with some value pairs... with the same zero result though, lookup doesn't work for the table which extends incident.


k0a1a
Kilo Expert

Found similar issue Two datalookup definitions with same matcher table


not satisfied at all though, gonna raise it on HI...


Michael Kaufman
Giga Guru

I know I am late to this discussion, however if someone runs into this...



Says here in the wiki.



Data Lookup Definitions are not inherited by extension tables. For example, a Data Lookup Definition on the Task table cannot match values on the Incident incident table.



Here is a workaround to get around that issue for Priority Data Lookup.   Just make a script to lookup the values instead from the table.



Here is an example client script



Client Script: Set Priority


Inherited: true




function onChange(control, oldValue, newValue, isLoading) {


if (isLoading){


return;


}



if(newValue == ''){


g_form.setValue('u_priority', '');


return;


}


var grPriorityList = new GlideRecord('dl_u_priority');


grPriorityList.addQuery('impact', g_form.getValue('u_impact'));


  grPriorityList.addQuery('urgency', g_form.getValue('u_urgency'));


grPriorityList.query(setPriority);


function setPriority(grPriorityList) {


if (grPriorityList.next()) {


g_form.setValue('u_priority', grPriorityList.priority);


}


}


}