Hey All,
I've been trying to build a small app to work with our CRM and came up with the idea of a work order app that can give one of my coworkers the entire work order history for a particular customer.
What I currently have is a home screen, another screen with a gallery for the contacts, another screen with a customer detail form page, and the same for work orders (5 screens in total). I am finding it a little difficult to make a button to see a gallery of the work orders tied to the customer we have in the system. I am hoping for a little help in trying to either make a button do the sorting or if there is some filtering step I am missing in the work order gallery.
Any help would be greatly appreciated!
Update,
Today I tried to set the button's OnSelect to be:
UpdateContext({vFilter:'DataCardValue1'}) //This hopefully set the contact name to a variable
and the galWork Items to be:
Filter(galWork,vFilter in PrimaryContactName_DataCard2) //hoping to filter the gallery by the variable.
DataCardValue1 is where the customer's name is stored in the customer table.
PrimaryContactName_DataCard2 is where the customer's name is stored in the work order table.
I believe to be on the right track but still coming up short. again, any assistance would be appreciated. Thank you for the help and your time.
Hey, thank you for reaching out and sorry for the late reply.
I appreciate the assistance; however, I believe I may have failed to give enough information on the situation as I am unsure of what you mean by this. I apologize for this as I am still a new user.
We use dynamics 365 as the source of data for our company. We mostly use it for work order and customer management. There are views for both contacts and work orders. There is also a column in the work order view where customers tied to the work order are and is the reason why I thought this would be a very nice app to tie the two together.
In PowerApps currently have a gallery for work orders (galWorkOrder) on one screen, a gallery for contacts (galContacts) on another screen, and detail screens for work orders and contacts with forms tied to their respective galleries. When you click on the item in the gallery, it will take you to the corresponding screen with its information populating a form on the new screen.
I have a button on the contact detail screen called "Work History". The goal was to filter the work order gallery by the "contact name" field in the contact detail form which is called "primary contact" in our work orders. What I currently have the OnSelect for the button set to is as such:
Set(varCurrentRecord, ThisItem);
EditForm(frmContactDetails);
Navigate('Work Order Screen');
This has been throwing errors though and is my reason for turning to this site for help. With your prior comment, would I need to use the gallery.select command on the button and or change the gallery on work orders to accomplish this task.
Thank you again for the assistance!
Hello,
Once the person selects the Customer in the Gallery, that's all you need.
You should be able to Filter the screen that shows all the list of work orders by the customerid (or aka contantid/accountid).
So on your Customer Detail, I am assuming you are using the GalleryXXX.Selected from the Contact List to populate the View of data?
Do the same for your work orders.
Apologies, I could be missing what you want :-0) but I hope that helps. Let me know.
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
WarrenBelz
106
Most Valuable Professional
MS.Ragavendar
73
stampcoin
52