How do I have a selected database object shared across all screens?

0
For example, if a Customer object is retrieved when a user first logs in and the Customer object has an association to Asset objects he/she owns how do I create a separate Assets page that lists the assets for that customer only and allows me to add, modify and delete assets?
asked
2 answers
0

Hi Brett,

 

You can accomplish this by passing the customer object to the assets page, and using datagrid with data source "over an association" to display the customer's assets.

Here is one possible solution.

 

 

The page has a dataview of Customer, and a datagrid inside of it that is displaying through the association from customer to assets.

Template grids and list views also have this data source in case you want to use one of those to display your information.

I'm not sure how you are retrieving/displaying your customer object when a user logs in, but you can use a microflow button with the customer as a parameter to pass it to a new page.

Hope this helps!

 

answered
0

I'm assuming a customer and user are intrinsically linked (i.e., the user is the customer or the user belongs to a customer, then create an association between Administration.Account and Customer. Make sure that is set either when the user is created or when they log in.

 

From there, on any page where you need the Customer object, either pass that customer object to the page using a microflow as Austin suggests, or use a data view sourced via microflow. Either way, in the microflow, use the $currentUser variable and retrieve the Customer over association. Note you'll need to use an inheritance split and cast the $currentUser into an Account object before retrieving the Customer. From there (just as Austin describes) you can add a data grid inside this data view with all of the customer's assets.

answered