Page 1 of 1

Create a new record from an filtered iframe

Posted: Mon Sep 16, 2024 9:02 am
by yvesf
Hello,

I would to create a new record from a filtered iframe. I would like to know what is the best approach with nubuilder.
Here is the situation :
I created a tasks manager system in with I can easily create :
- a task and assigned it to the right people
- when I am on the people profile, I have an iframe listing all the related tasks to this people. From here I would like to create a new task.
By using the add button, I will be able to create a new task but I have to reassign to the right person. How can I be able to pass the current people as parameter from here to create a new task ?
Thx.
Attached the tasks manager which I am talking about.
09-16-2024_083935_66e7d2a72c25b_nuBuilder_backup.sql.gzip
and the related video
Video_2024-09-16_085705.gif

Re: Create a new record from an filtered iframe

Posted: Tue Sep 17, 2024 10:41 pm
by yvesf
Hello,

I have found a solution .
behind task form on custom code tab behind edit

Code: Select all

if (nuIsNewRecord()) {
 if (parent.nuGetValue('pra_user')!= "") {
     nuSetValue('tsk_assigned_to_id', parent.nuGetValue('pra_user'));
     nuHide('tsk_assigned_to_id');
 }
}
Thx,

Yves

Re: Create a new record from an filtered iframe

Posted: Wed Sep 18, 2024 12:11 am
by steven
Hi yvesf,

I think your problem would be solved best by using an extra "linking" table and a Subform.

rel.png
frm.png


And I added some styles too...

sty.png

You can find it all in nub.zip


Steven

Re: Create a new record from an filtered iframe

Posted: Wed Sep 18, 2024 7:24 am
by yvesf
Steven,

Your solution is probably better than mine as my approach is probably less in the nubuilder spirit (low code approach).
Moreover using filtering iframe costs probably more on the server if you have a lot of tasks to manage.
It means that the mindset should be different in regards to the architecture of a nubuilder app.
Many thanks for that. Appreciate a lot your feedback. If you could confirm my feelings :-).

Yves

Re: Create a new record from an filtered iframe

Posted: Thu Sep 19, 2024 8:27 am
by yvesf
@steven,

The proposed approach to implement the link between tasks and assigned user from the user profile is elegant but doesn't completely solve what I am trying to achieve. Why ?
Because I would like to activate 2 workflows to make the assignment of tasks :
Workflow 1 : From a profile, create a new task
Workflow 2 : Create a task and assign it the the right people. (not covered by your proposal)
.
What should be your proposal to implement workflow 2 ?
Subsidiary question : how can you assign a task to multiple users ?
Many thanks,

Yves

Re: Create a new record from an filtered iframe

Posted: Thu Sep 19, 2024 9:28 pm
by steven
Hi yvesf,

For Workflow 2, what I did was...

Clone the Subform Object .
Clone the Subform's surrounding Content Box. - which I forgot to change the title on.

Create a new Subform - same table but with the Lookup Object looking at Users and the task ID being the Foreign key.
Change the Lookup's Subform to look at nuuser.


People & Tasks - Video

nu.zip


Steven

Re: Create a new record from an filtered iframe

Posted: Fri Sep 20, 2024 9:33 am
by yvesf
Many thanks Steven.
But if I create a task and assign it to Bob
assigned_task.png
and select bob I don't have its related task ie task 1.
affected_task.png
If I save it without adding a task no more result; It doesn't delete the association between task and practician but it doesn't refresh the list of tasks.
Any idea ?
Thx

Re: Create a new record from an filtered iframe

Posted: Sun Sep 22, 2024 12:19 am
by steven
Hi yvesf,

Try this...

n.zip
Steven

Re: Create a new record from an filtered iframe

Posted: Mon Sep 23, 2024 10:20 am
by yvesf
excellent. Thx