Reduce Lookup results

Questions related to using nuBuilder Forte.

Re: Reduce Lookup results

Postby joecocs » Tue Jan 28, 2020 12:27 am

Sorry,

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

https://forums.nubuilder.com/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
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

Re: Reduce Lookup results

Postby kev1n » Tue Jan 28, 2020 1:20 am

Code: Select all
$('#your_object').val($('#other_object').val());
kev1n
 
Posts: 969
Joined: Mon Oct 15, 2018 2:13 am

Re: Reduce Lookup results

Postby joecocs » Tue Jan 28, 2020 7:04 am

Thank's
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

Re: Reduce Lookup results

Postby admin » Tue Jan 28, 2020 2:51 pm

joecocs,

There is a new JS function available to change the filter on Run::iFrames https://wiki.nubuilder.net/nubuilderforte/index.php/Javascript#nuFilterRun

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

nufil.png
nufil.png (65.86 KiB) Viewed 1772 times



Steven
admin
Site Admin
 
Posts: 3348
Joined: Mon Jun 15, 2009 9:53 am

Re: Reduce Lookup results

Postby joecocs » Wed Feb 05, 2020 8:02 pm

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.net/nubuilderforte/index.php/Javascript#nuFilterRun

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

nufil.png



Steven
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

Re: Reduce Lookup results

Postby joecocs » Tue Feb 11, 2020 2:28 am

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.
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

Re: Reduce Lookup results

Postby kev1n » Tue Feb 11, 2020 4:52 pm

You can add an onchange event to an object and call nuFilterRun() to refresh the run object (Iframe).

https://wiki.nubuilder.net/nubuilderfor ... ustom_Code


Don't forget to replace aaa and bbb with your Object Ids.
kev1n
 
Posts: 969
Joined: Mon Oct 15, 2018 2:13 am

Re: Reduce Lookup results

Postby joecocs » Tue Feb 11, 2020 6:42 pm

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
Dossiers for construction sites
Dossier.png (26.12 KiB) Viewed 1721 times


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
Contributors in the dossier
Intervenants.png (49.6 KiB) Viewed 1721 times


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
List of contributors not refresh
Tiers.png (52.11 KiB) Viewed 1721 times


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 diagram
Capture d’écran 2020-02-11 à 09.53.56.png (181.25 KiB) Viewed 1721 times


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 :)
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

Re: Reduce Lookup results

Postby kev1n » Tue Feb 11, 2020 9:51 pm

What does your Javascript code look like?
kev1n
 
Posts: 969
Joined: Mon Oct 15, 2018 2:13 am

Re: Reduce Lookup results

Postby joecocs » Tue Feb 11, 2020 11:26 pm

In the mainFORM, in the list of objects in the first Run::Frame:

List objects.png
Liste objects
List objects.png (113.01 KiB) Viewed 1716 times


in the Javascript Code onchange event:

JScript onchange.png
onchange event
JScript onchange.png (82.32 KiB) Viewed 1716 times


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
joecocs
 
Posts: 64
Joined: Wed Jul 04, 2018 11:41 pm
Location: France

PreviousNext

Return to General