Continuation line within Dependency php file

I have a Dependency file using SetOptions to present a DD List.  The reason I am using a Dependency file is there is more than one conditions involved so my understanding is I can't build a Dependent Dropdown list within Studio as that only allows one 'parent'

The DD List is quite verbose and it is critical that I get the key values and label values aligned, otherwise the incorrect key will go into the database.

To make the file more readable so that maintenance is accurate, I'd like to break the label options into different lines. I'm not a php guru so am wondering which syntax I can use as a line break. I've tried the ; as shown below but this does not appear to work. The QRR succeeds but the DD list is not presenting.

Original: (labels actually are on one line)

$dependencies['RevenueLineItems']['setoption_dep_Attest2020'] = array(
'hooks' => array("edit","save"),
// 'trigger' => 'true',
'trigger' => 'and(equal($sym_service_line_c, "1"), equal($sym_adv_std_year_c, "2020"))',
'triggerFields' => array('sym_adv_std_year_c', 'sym_service_line_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetOptions',
'params' => array(
'target' => 'sym_adv_std_matter_c',
'keys' => 'createList("", "19", "2", "9", "5", "11", "10", "4", "8", "12", "3", "7", "6", "15", "16", "17", "18", "100", "101", "21", "20", "13", "14", "99")',
'labels' => 'createList("blank", "Label A", "Label B", "Label C", "Label D", "Label E", "Label F", "Label G", "Label H", "Label I", "Label J", "Label K", "Label L", "Label M", "Label N", "Label O", "Label P", "Label Q", "Label R", "Label S", "Label T", "Label U", "Label V", "Label W")'
),
),
),
);

Revised : (line breaks)

$dependencies['RevenueLineItems']['setoption_dep_Attest2020'] = array(
'hooks' => array("edit","save"),
// 'trigger' => 'true',
'trigger' => 'and(equal($sym_service_line_c, "1"), equal($sym_adv_std_year_c, "2020"))',
'triggerFields' => array('sym_adv_std_year_c', 'sym_service_line_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'SetOptions',
'params' => array(
'target' => 'sym_adv_std_matter_c',
'keys' => 'createList("", "19", "2", "9", "5", "11", "10", "4", "8", "12", "3", "7", "6", "15", "16", "17", "18", "100", "101", "21", "20", "13", "14", "99")',
'labels' => 'createList(;
"blank",;
"Label A",;
"Label B",;
"Label C",;
"Label D",;
"Label E",;
"Label F",;
"Label G",;
"Label H,;
"Label I",;
"Label J",;
"Label K",;
"Label L",;
"Label M",;
"Label N",;
"Label O",;
"Label P",;
"Label Q",;
"Label R",;
"Label S",;
"Label T",;
"Label U",;
"Label V",;
"Label W")'
),
),
),
);


Thank you

Parents Reply Children
  • Hi 

    Thanks for responding. The Dependency will present a DD List based on options chosen on 2 other fields. The full DD List in Studio has over 100 entries and will grow over time. So the user chooses a Service Line and a Year and the Dependency file offers up an abbreviated list based on those choices.

    The example above is one section of the Dependency file covering one of those choice combinations - 'only' 23 items in the DD list

    FYI, the keys list are fixed ids needed for a separate database we are integrating with - hence their apparent random order, as the labels are being presented in alphabetical order.

    I'm trying to make the code more readable for maintenance purposes and having the 23 label options on one line is difficult to read (I've used Label A, Label B as examples. The real labels are longer)

    So I'm trying to use a line break character (I could be totally wrong in my understanding for that need) such that the Dependency file sees the Labels CreateList line as one line. I think if I put the choices on different lines without some kind of continuation indicator it doesn't present the list. So I have made the assumption it does need some kind of continuation indicator and I simply tried the ; as I've seen this is some general php posts - hence my original question.

    Hope that makes sense.

    Neil