SBX - Search With Button

SBX - Forum Post Title

How to fetch user owned dashboards for a different user???

Microsoft Dynamics CRM Forum

Amandeep Singh asked a question on 7 Jun 2019 8:36 AM

Question Status

Suggested Answer

Hi all,

I am recently facing this issue as i am trying to query userform entity to fetch all the personal dashboards of a particular user using below query in my console application.

The problem is that the query is working fine when i am giving the same user credentials for crm to connect to my console application as for the user which i want to retrieve the personal dashboards i.e the ownerid for the owner of personal dashboards but when i am giving the different ownerid for the user to retrieve its dashboards than it is not returning its dashboards. It is returning the entity count as 0.

QueryExpression query = new QueryExpression("userform");
query.ColumnSet.AddColumns("name", "userformid", "ownerid", "type");
query.Criteria.AddCondition("ownerid", ConditionOperator.Equal, "00000-0000-0000-0000-00000000000");
query.Orders.Add(new OrderExpression("name", OrderType.Ascending));

EntityCollection personalDashboardsCollection = _service.RetrieveMultiple(query); // retrieve collection of personal dashboards...

Thanks in advance!! :)

Reply
Tyler S responded on 7 Jun 2019 10:28 AM
My Badges

I think there is credential issue involved as other user do not have the permission to access personal view.  Have you try to re-create it as system view, or share access of this personal view to the new user you intend to grant access to?

Reply
Amandeep Singh responded on 7 Jun 2019 11:17 AM

Hi Tyler,

Many thanks for responding back.

I have tried giving the user system admin role as well. Actually what i think the issue is that it is only fetching the personal dashboards if the user is same as the logged in user of Crm otherwise it is returning the count as 0 for other user. As personal dashboards and views cannot be accessed by other users except the one owner. Because when i changed the login credentials i was able to fetch its dashboards also.

Actually the user for which we want to fetch the personal dashboards has left the organisation so we don't have credentials for that user so we want to retrieve those dashboards and change their owner to some other user

Reply
Tyler S responded on 7 Jun 2019 11:25 AM
My Badges
Suggested Answer

Actually, you could share the personal dashboard by having the owner of that dashboard to log in, go to that dashboard and choose SHARE DASHBOARD ribbon.

You can modify read/write permission given to each individual user.  You also have to make sure the other user have access to the entities and fields used in the dashboard or the records will not be returned.

Reply
Amandeep Singh responded on 7 Jun 2019 11:59 AM

The owner has left the organisation we don't have its credentials that's why i want to retrieve his dashboards and assign it to some other users.

Reply
Tyler S responded on 7 Jun 2019 12:11 PM
My Badges

I see, is this cloud environment?  If it is, the user credential should be governed by office 365 admin portal under user, you should be able to reset the password and access his account.

Reply
Amandeep Singh responded on 8 Jun 2019 12:10 AM

Basically i want to do it for on premise 365..

Reply
Suggested Answer

Hi Amandeep

I think you could consider one of the two options below

01. Ask your domain or system admin to reset the password for that AD account and log in as that user and Share the dashboard with a team or any user you would like to share it with.

02. This option is not supported but it is a possibility. Since you are on-prem, you have direct access to SQL.  You could think about changing the owenerid of the record in dbo.UserFormBase table.  This an unsupported option, please try on a copy or test instance first. Only try this option if the Option1 is not possible at all and you desperately need access to the dashboard.

Reply
Amandeep Singh responded on 8 Jun 2019 10:54 AM

Hi Kokulan,

Thanks for responding back.

I can't comment on your first option as i am  trying to get the account reset if possible cuz it is the best and easiest practice.

Already tried with the second option but it was having some adverse effects cuz some users were complaining that they were facing difficulty in viewing some dashboard that's why i tried it from a console app but then i have to face the issue which i have mentioned  in the beginning.

Reply
Tyler S responded on 7 Jun 2019 11:25 AM
My Badges
Suggested Answer

Actually, you could share the personal dashboard by having the owner of that dashboard to log in, go to that dashboard and choose SHARE DASHBOARD ribbon.

You can modify read/write permission given to each individual user.  You also have to make sure the other user have access to the entities and fields used in the dashboard or the records will not be returned.

Reply
Suggested Answer

Hi Amandeep

I think you could consider one of the two options below

01. Ask your domain or system admin to reset the password for that AD account and log in as that user and Share the dashboard with a team or any user you would like to share it with.

02. This option is not supported but it is a possibility. Since you are on-prem, you have direct access to SQL.  You could think about changing the owenerid of the record in dbo.UserFormBase table.  This an unsupported option, please try on a copy or test instance first. Only try this option if the Option1 is not possible at all and you desperately need access to the dashboard.

Reply

SBX - Two Col Forum

SBX - Migrated JS