web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

XDS issue in D365.

(0) ShareShare
ReportReport
Posted on by 471

Hi, I have created a policy, which restricts the user to see only a specific retail store for the role "Retail Store manager".

0842.Security.JPG

However, when I try to restrict the data in Retail statements by adding RetailStatementTable and RetailTransactionTable to the policy. It is removing all the data.

please guide me in this.

Regards,

MC verma

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Hi Chiranjeevim7,

    Can you please confirm that users with Retail Store manager role can see only allowed stores ? Because if they cannot see any there is an issue with a query and it restricts them from seeing all stores and all transactions.

    Trace parser is usually helpful with XDS issues, it allows you to capture SQL query and analyze it.

  • André Arnaud de Calavon Profile Picture
    304,711 Super User 2026 Season 1 on at

    Hi Chiranjeevim,

    Can you also provide information about the query which is used for this security policy?

  • VermaMC Profile Picture
    471 on at

    Thanks ievgen and Andre.

    The users with retail store manager can see only those stores which are assigned to them.

    Let me share the query to you.

    Query:

    Security2.JPG

    Temp Table:

    Security2.JPG

    XDS method:

    public RefreshFrequency XDS()
    {
    xxx_RetailStoreSecurityTableTmp retailStoreSecurityTableTmp;
    RetailStoreTable retailStoreTable;
    RetailStoreAddressBook retailStoreAddressBook;
    DirAddressBookParty dirAddressBookParty;
    DirPersonUser dirPersonUser;

    unchecked(Uncheck::XDS)
    {
    SecurityRights rights = SecurityRights::construct();

    rights.populateSelectableCompanies();

    while select retailStoreTable
    exists join retailStoreAddressBook
    where retailStoreAddressBook.StoreRecId == retailStoreTable.RecId
    exists join dirAddressBookParty
    where dirAddressBookParty.AddressBook == retailStoreAddressBook.AddressBook
    exists join dirPersonUser
    where dirPersonUser.PersonParty == dirAddressBookParty.Party
    && dirPersonUser.User == curUserId()
    {
    retailStoreSecurityTableTmp.StoreNumber = retailStoreTable.StoreNumber;
    retailStoreSecurityTableTmp.insert();
    }
    }
    return RefreshFrequency::PerSession;
    }

    Please let me know if any thing else needed.

    Regards,

    MC Verma

  • Mea_ Profile Picture
    60,286 on at

    Hi Verma MC,

    Query looks ok for me. Can you please follow my previous advice and use trace parser \sql profiler to get actual SQL query ? It's the easiest way to find what is wrong.

  • André Arnaud de Calavon Profile Picture
    304,711 Super User 2026 Season 1 on at

    Hi Verma,

    Can you indicate if you have setup and assigned address books? The query is filtering on this feature.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans