0 votes


I'm trying to filter multi-select field in category based on value chosen in lookup on Main tab in Cases. I've tried to achieb this by adding this piece of JS to MacroEditSCustom

            var newDataAjaxURL = "dialog?_macro=JsonDynaMultiValueListCaseCat&_macrofile=MacroAjax&edithandle=<%GetEditHandle()%>&field=CATEGORY-CASE$GENERAL-F_CATEGORY&casetype=" + $('#CASETYPE').val();
            var $FieldName = $("#CATEGORY-CASE$GENERAL-F_CATEGORY")
                $FieldName.attr('data-ajax-url', newDataAjaxURL);

and the definition in MacroAjaxCustom

JsonDynaMultiValueListCaseCat {[<%Delay(0)%>RunQuery(id='DynaMultiValueListCaseCat', 
    SQL='Select F_CATEGORY as F_CATEGORY_EN, * from LK_CASE_CATEGORY CC where f_case_type like :param1 and disabled = 0 order by k_sort',
    <%Delay(0)%>GetDataGrid(query='DynaMultiValueListCaseCat', count=-1, norecords='', sort='F_CATEGORY_<%GetLanguage()%>' , nolinefeed=T, templatetext=|[<#repeat>


Plus changing CASETYPE in Forms with definition LOOKUPMASTER and add it in FormFieldsEditCustom

field.LOOKUPMASTER {[<%GetEdit("$FIELD$", type="LOOKUP", onchange="JavaScript:CebPerform('CEB_STATE');")%>]}

so every time user chooses new value it refresh the page and set new URL on attribute "data-ajax-url".

It works fine if i save directly the case, but if i hit the button "apply" then it's not working, even the attribute has the right URL, but on clicking on the field i get the standard ajax-url

enter image description here

enter image description here

Please advise.
Thank you for your help in advance.
Best Regards.

asked in Efficy/ Client side by (559 points)

1 Answer

0 votes


I did the same custom as you using the js module features instead of the MacroEditS file and I did reproduce your behavior and I havn't find an easy solution. Maybe using the native select2 feature and constructor by script would be the best way to do it.

please if you consider it please remember to double check the concatenated selected values string in db if you didn't use the standard c efficy constructor (macro)

answered by (986 points)
1,225 questions
1,493 answers
328 users