Page 3 of 3

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 4:06 pm
by kev1n
I don't have time to look through everything right now.

Is Form_Gestion_Intervenants a run object? onchange doesn't seem to be triggered for this kind of object. Therefore we need to place the code somewhere else (maybe in the form's custom code field)

Another thing to check in the meantime. If you paste and execute this code in the developer console (F12), will you get a value back?

Code: Select all

$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val()

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 4:56 pm
by joecocs
thanks again for your help,

I tried to put the code in the 'custom code field' with the following code:

Code: Select all

if(!nuMainForm() && nuFormType() == 'edit') {
    
    nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
}
but it doesn't work either.

I tested in the debug console and I have my reference !!!

I would like to do otherwise to test, can we get my reference which is in the Run :: Frame to assign it to a field in the 'MainForm'?
Capture d’écran 2020-02-11 à 16.51.18.png
So I can get away with a pirouette !

Thanks

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 5:10 pm
by kev1n
Is the form type really edit or is it browse?

Could you try each of these different codes to see if an alert box is displayed?

Code: Select all

if(!nuMainForm() && nuFormType() == 'edit') {  
    alert("hello!");
    nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
}

Code: Select all

if(!nuMainForm() && nuFormType() == 'browse') {  
    alert("hello!");
    nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
}

Code: Select all

if(nuFormType() == 'browse') {  
    alert("hello!");
    nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
}

Code: Select all

if(nuFormType() == 'edit') {  
    alert("hello!");
    nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
}

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 5:48 pm
by joecocs
So The mainForm is Browse & edit, the first Run::Frame is Browse & edit and the second Run::Frame is Browse & edit type.

in the first code i've the alert when i select 1 line in my first Run::Frame.
in the second code i've the alert when my mainForm is in edit mode and the first Run::Frame is filter (is the same time).
in the third code i've the alert when my mainForm is in edit mode and the first Run::Frame is filter (is the same time).
in the last code i've the alert when i select 1 line in my first Run::Frame.

But the second Run ::Frame is not refresh or filter... :cry:

can we get my reference which is in the Run :: Frame to assign it to a field in the 'MainForm'?