Reference qualifier on a reference field based on another reference field

mitzaka
Mega Guru

Hi SNC,

Can anyone help me out construct my reference qualifier for the following case:

* I have a table which has two columns - a string, and a reference field (to the same table, like a parent field).

* on the task form, I have two reference fields (first for Category, and the Second for Subcategory)

* I want to place a record producer on the second field (Subcategory), so that it will only show the records which have the Category (first reference field selection) as a parent

I tried with dependent fields, but it wont' work as I think I am in the many to many case.

So I think what I need is some script include and an advanced reference qualifier on the second reference field.

If anyone has done that please share.

1 ACCEPTED SOLUTION

DilipKumar DJ
Kilo Guru

Hi Dimitar,



You should try below line in the ref qualifier of Task Table   subcategory field. Assuming pcategory is the field name of parent category in your custom table.



javascript:'pcategory=' + current.category;




View solution in original post

11 REPLIES 11

Kalaiarasan Pus
Giga Sage

In reference qualifier



javascript:'referencefieldname='+current.variables.firstvariablename


kalai - this does not help me, as I dont have variables in that case (or maybe I misunderstood you).


What I have is two fields on the TASK form



Screen Shot 2016-10-30 at 9.46.52 AM.png



Task Category - this is a reference filed to a custom table 'Task Categories' which   looks like this:


Screen Shot 2016-10-30 at 9.50.22 AM.png


Category is a string, then Parent Category is a reference field (so that I can have parent-child hierarchy of categories.


And then from the task form above, the field Task Sub-Category is again a reference field, but which aims to show only the categories from the table which have a parent the Category specified in the Task-Category reference field.



This is the reference qualifier I need to get.


Hope you can help me now that I brought in the screenshots:)


Thanks in advance!


Hello Dimitar,



Try this:


javascript:!gs.nil(current.category) ? 'parent=' + current.category : '';



Category name is a string, but the field category in the task table is a reference field.


This should work provided you change the field names.