Hi all,
Let me explain what I am trying to do: I am using the "Contacts" entity, and I have the field "Relationship Type" to show what type of contact a person is. Some types of contacts need all the fields and subgrids shown, whereas other types only need some.
So far I have tried creating different views and forms, but I was only able to choose fields (not subgrids) to be shown by using views, and forms can obviously show both fields and subgrids, but I found out that I can't determine the form type by using my "Relationship Type" field (can only use security roles).
So is there something I am missing about views or forms, or is there other functionality that does what I described above?
Any help appreciated! :)
*This post is locked for comments
Thanks guys, realized that I could just set a tab to be default open or closed, making things much simpler and "update-proof" for my needs. Thanks again :)
It really depends on the differences between the different types of relationships as to whether you need a different form or you can simple hide/show sections/fields. If there so many differences you may be better having a different form and using the technique described here - ms-dynamics-crm2011.blogspot.co.uk/.../how-to-change-form-type-dynamically.html
Personally though I try to avoid dynamically changing the form and use the hide/show method.
Hope this helps,
Scott
For CRM 2013 forms scripting the SDK is here: msdn.microsoft.com/.../jj602964.aspx
You can access the tab containing the section: var tab = Xrm.Page.ui.tabs.get('TABNAME');
and then you can find the section: var section = tab.sections.get('SECTIONNAME');
then you can use section.setVisible(true/false) to set the visibility
If for example on the Account form you need to show various sub-grids of contacts then you would need to know what relationship types you have on related contacts to that particular account record before you set the sub-grids visibility.
That can be done via a REST call and you can find samples if you download the SDK for your CRM version and look at ...SDK\SampleCode\JS\RESTEndpoint
Thanks for the reply. I was hoping it wouldn't involve javascript, but it seems like that is the most likely solution right now. Do you know any good resources for learning how to do this?
This may depend on how many Relationship Types you have and how dynamic those values are.
If the number is fairly small and the values are static, then you can create views on the Contact for each type. Then on the forms where you want to show the sub-grids you can add a sub-grid for each view in different sections and then using a javascript you can hide/show all sections except for the relevant ones.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156