Pregunta

I am trying to retrieve a personal view's fetchxml (owned by another user than the one making the requests to the organization service) by doing such:

        public static UserQuery RetrieveUserQuery(string userQueryName)
        {

            string xmlFetch = @"<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'> 
                                    <entity name='userquery'>
                                        <attribute name='fetchxml'/>
                                        <filter type='and'>
                                            <condition attribute='name' value='{0}' operator='eq'/>
                                        </filter>
                                    </entity>
                                </fetch>";

            xmlFetch = string.Format(xmlFetch, userQueryName);

            try
            {
                var ent = Helper.XrmProxy.RetrieveMultiple(new FetchExpression(xmlFetch));

                if (ent.Entities.Count() == 0)
                    return null;
                if (ent.Entities.Count() > 1)
                    throw new Exception("More than one view with same name found!");

                return ent.Entities[0].ToEntity<UserQuery>();

            }
            catch
            {
                throw;
            }
        }

But it seems we can only do so by using the same credentials on the organization service than the ones owning the view.

Is this really the case ? Is there any bypass ?

This method always returns null (0 entities retrieved). The credentials used on the organization service are System Administrator so I thought I'd have access to it even if it wasn't shared...

¿Fue útil?

Solución

Personal view is owned only the user made until and unless it is shared with another user. Even the system admin cannot access the personal view of another user

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top