Page 2 of 3

Re: Reduce Lookup results

Posted: Mon Jan 27, 2020 3:57 pm
by joecocs
Sorry,

after several attempts and having browsed the forum out of curiosity, I found this thread :

https://forums.nubuilder.cloud/viewtopic.php?f=19&t=10130

explaining what I am trying to do to assign values ​​to objects in an iframe but i have another question, what is the syntax in JS to assign the value of one object in another in the same form ?

Thank

Re: Reduce Lookup results

Posted: Mon Jan 27, 2020 4:50 pm
by kev1n

Code: Select all

$('#your_object').val($('#other_object').val());

Re: Reduce Lookup results

Posted: Mon Jan 27, 2020 10:34 pm
by joecocs
Thank's

Re: Reduce Lookup results

Posted: Tue Jan 28, 2020 6:21 am
by admin
joecocs,

There is a new JS function available to change the filter on Run::iFrames https://wiki.nubuilder.cloud/ ... uFilterRun

Code: Select all

nuFilterRun('bbb',$("#aaa").contents().find("#cus_phone").val())
(This filters an iFrame from the value in another iFrame)
nufil.png

Steven

Re: Reduce Lookup results

Posted: Wed Feb 05, 2020 11:32 am
by joecocs
Thank's Steven,

But where i put this code, in JsScript of 'bbb' or in 'aaa' or in Filter of 'bbb' ?

after several tries I can not find how to integrate this code ... :?

i'm a newbie :oops:
admin wrote:joecocs,

There is a new JS function available to change the filter on Run::iFrames https://wiki.nubuilder.cloud/ ... uFilterRun

Code: Select all

nuFilterRun('bbb',$("#aaa").contents().find("#cus_phone").val())
(This filters an iFrame from the value in another iFrame)
nufil.png

Steven

Re: Reduce Lookup results

Posted: Mon Feb 10, 2020 5:58 pm
by joecocs
I am trying to learn to use 'nuBuilder', 'Jscript' and 'PHP' at the same time, but there are logics which I do not master yet... :oops:

if you would help me understand where to integrate your command 'nuFilterRun ', :geek:

thank you.

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 8:22 am
by kev1n
You can add an onchange event to an object and call nuFilterRun() to refresh the run object (Iframe).

https://wiki.nubuilder.cloud/ ... ustom_Code


Don't forget to replace aaa and bbb with your Object Ids.

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 10:12 am
by joecocs
Thanks Kev1n,

I tried but it doesn't work. :cry:

When I select a record in Frame 'aaa', the frame 'bbb' is not filtered or refreshed. :roll:

That's why I'm a bit lost on the nuBuilder mechanisms.

To be a little more specific about what I want, here are 3 photos:

I wish in a dossier for construction sites,
Dossier.png
I choose or I create a contributor in the dossier (customer, suppliers, communities, manufacturers), I can have several in this dossier and they can be in other dossiers.
Intervenants.png
and when I select a contributor, I would like to see the file of this contributor in the Frame below, but it doesn't work.
Tiers.png
If it can work, it will allow me to filter a list of contacts for this contributor in the 'Contacts' tab.

Just for the complete explanation, the diagram of my database
Capture d’écran 2020-02-11 à 09.53.56.png
The principle seems simple, with MS Access I know how to do it, but here I am a little confused, so if you can help me on an early solution :)

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 1:21 pm
by kev1n
What does your Javascript code look like?

Re: Reduce Lookup results

Posted: Tue Feb 11, 2020 2:56 pm
by joecocs
In the mainFORM, in the list of objects in the first Run::Frame:
List objects.png
in the Javascript Code onchange event:
JScript onchange.png
I've :

Code: Select all

nuFilterRun('Form_Gestion_Tiers',$("#Form_Gestion_Intervenants").contents().find("#Ref_Tiers_Intervenants").val());
The “#Ref_Tiers_Intervenants“ is a lookup 'Tiers' seen in my previous post in third picture

Thanks for your time