Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Reduce Lookup results

Questions related to using nuBuilder Forte.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Reduce Lookup results

Unread post 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()
joecocs
Posts: 67
Joined: Wed Jul 04, 2018 4:11 pm
Location: France

Re: Reduce Lookup results

Unread post 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
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Reduce Lookup results

Unread post 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());
}
joecocs
Posts: 67
Joined: Wed Jul 04, 2018 4:11 pm
Location: France

Re: Reduce Lookup results

Unread post 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'?
Post Reply