My customer was having a third party application where they were querying for the system forms and one of the requirement was to find the system forms based on userid. Basically they would have a user guid based on which they need to find all the system forms of type = Main, the user have access to it.
Honestly I haven’t used something like that so far because a requirement never came along. However a bit of search and found this wonderful request which you can use.
RetrieveFilteredFormsRequest request = new RetrieveFilteredFormsRequest();
request.EntityLogicalName = “account”;
request.SystemUserId = ((WhoAmIResponse)client.Execute(new WhoAmIRequest())).UserId;
request.FormType = new OptionSetValue(2); // here pass in appropriate value for Main/ Quick create/ Quick view etc.
RetrieveFilteredFormsResponse response = (RetrieveFilteredFormsResponse)client.Execute(request);
var systemForms = response.SystemForms;
foreach(var form in systemForms)
{
Console.WriteLine($”FormId: {form.Id}”);
}
To get additional details you would need to take the formid and query further for additional details like formxml.
Hope this helps!
Debajit Dutta
(Dynamics MVP)
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.