Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Master Detail - View page with subpage list view - kinda working (Read 3375 times) previous topic - next topic

Master Detail - View page with subpage list view - kinda working

As someone else in the forum mentioned I have a fairly common scenario with a crm type of app.  A master accounts table with a related contacts table so contacts are always related to an account.

I have the master detail working by using a subpage on the accounts / view by using the filter list so the contacts list only shows the related contacts, but my question is this:

How do I make the "Add Contact" button pre-populate the account ID to match the current account record on the view page? So I want to add a contact for the current account. 

Any ideas?
Rich

Re: Master Detail - View page with subpage list view - kinda working

Reply #1
@rwebb‍ add an add page subpage component to the view page using page design and bind the page id to the input of your choice.

Re: Master Detail - View page with subpage list view - kinda working

Reply #2
@rwebb‍ and bind the page id to the input of your choice.

Where do I find the page id binding?  I looked at the property list to the right and it has filter by and filter value which is what I used to restrict the list grid view to only the contacts that are related to the displayed account. 

I'll keep looking but let me know where to find the page id.

Re: Master Detail - View page with subpage list view - kinda working

Reply #3
OK, I found what you were talking about - it's on the add page.  That works if I have an add page on the bottom of my view account page but that is not what I want.. 

I have an accounts view (master) where it shows all the records for account then..
a list view for contacts that shows all the contacts that are related to the displayed account with an "add contact" button.

I want it so that when I click add contact it adds the contact to the displayed account.  Does that make sense?

And is there a way to turn off these captcha's ?  It takes me like 5 tries to post a message!

Rich


Re: Master Detail - View page with subpage list view - kinda working

Reply #5
So I guess you're saying it won't work to do it the way I want to do it then?  

I don't want to do it the way it is shown in the video.  I want to be able to add sub records from the view page of the master record.  So if I'm viewing an account I will see a sub section at the bottom with all the contacts with an add contact button.  I want it to add a contact to the currently viewed account.  This is a very common scenario in CRM software.

Rich

Re: Master Detail - View page with subpage list view - kinda working

Reply #6
@rwebb‍ those are the two options, you either add the pages you want to see on a particular page as subpages or you follow the video tutorial. Based on what you are saying, the first solution is what you are looking for.

Re: Master Detail - View page with subpage list view - kinda working

Reply #7
I have the subpage - the issue is adding records from the subpage.  How do I add a record on the subpage keyed to the master account-ID?

By the way I'm very impressed with the built-in functionality.  Worst case scenario I could get the framework of my app built and then customize the code to make it do what I need.

Rich

Re: Master Detail - View page with subpage list view - kinda working

Reply #8
So is the final word that there is no way to accomplish what I need to do the way that I want to do it?

What I need to know is if there is any access to the master dataset from within the subpage/list .  I want to make it so a click on the subpage "add contact" button links to the url:  contacts/add?account=$data['id']; type of thing but I want the ID to be the Accounts ID not the Contacts ID.

Thanks.
Rich


 

Re: Master Detail - View page with subpage list view - kinda working

Reply #10
Could I provide you my PPM file and my database?

Re: Master Detail - View page with subpage list view - kinda working

Reply #11
Tried to contact you on your website chat thing - no response.  Could I possibly set up a time tomorrow to work with you on this?  If I can't get past this obstacle I'll have to move on to other things. 

Rich


Re: Master Detail - View page with subpage list view - kinda working

Reply #13
I just figured out how to do it the way I originally was trying to do it.  Instead of having the button on the Contacts List (to add a contact) I added the button to the Accounts / View page and made the link = contacts/add?account=$page_id and that worked!

Re: Master Detail - View page with subpage list view - kinda working

Reply #14
Nah, this does work for me because is not populating the $recid just referring to another page.

Maybe share your code.