How to Add Trigger SetOption Dependency in a relationship field?

Hello Everyone,

I have a Relationship field "species" and target field is "breedstrain". I wan that when species = Ovine then in target field "breedstrain" have a dropdown List "Cross Breed","Dorset","Polypay","Suffolk".

I added Dependency which is in below but not working for me.
$dependencies['TSD1_Test_System_Design_1']['set_options_dep'] = array(
    'hooks' => array("all"),
    'trigger' => 'true',
    'triggerFields' => array('species','breedstrain'),
    'onload' => true,
    'actions' => array(
        array(
            'name' => 'SetOptions',
            'params' => array(
                'target' => 'breedstrain',

                'keys' => 'ifElse(equal($species,"Ovine"),createList("","Cross Breed","Dorset","Polypay","Suffolk"),ifElse(equal($species,"Canine"),createList("","Beagle","Mongrel"),ifElse(equal($species,"Porcine"),createList("","Gottingen","Hanford","LDLR","Micro Yucatan","Ossabaw","Sinclair","Yucatan"),ifElse(equal($species,"Bovine"),createList("","Holstein")))))',

                'labels' => 'ifElse(equal($species,"Ovine"),createList("","Cross Breed","Dorset","Polypay","Suffolk"),ifElse(equal($species,"Canine"),createList("","Beagle","Mongrel"),ifElse(equal($species,"Porcine"),createList("","Gottingen","Hanford","LDLR","Micro Yucatan","Ossabaw","Sinclair","Yucatan"),ifElse(equal($species,"Bovine"),createList("","Holstein")))))',
            ),
        ),
    )
);
If anyone have solution Please Help me!
Thanking you
Parents Reply Children
No Data