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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

XDS with temporary tables

(0) ShareShare
ReportReport
Posted on by 5

Hello everyone,

I want to add an XDS policy to select the sales types allowed to the current user only. To do so, I was adviced to create a query that attach the SalesTypeTable to a temporary table MySalesTable (of type TempDB). 

The xds() method in this temp table handles the selection based on the conditions mentioned above. However, when i try to select from the regular salesTypeTable, no line gets selected for some reason. 

}

public class MySalesTable extends common
{


    public RefreshFrequency xds()
    {
        MySalesTable mySales;

        WorkerTable worker;
        WorkerGroupTable workerGroup;
        select firstonly workerGroup join worker where worker.WorkerGroup == workerGroup.RecId && worker.Worker == HcmWorkerLookup::currentWorker();

        SalesTypeTable salesTypeTable;

        insert_recordset mySales(SalesType)
            select SalesType from salesTypeTable;

        return RefreshFrequency::PerSession;
    }

}

Regards,

Jamal

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,805 Super User 2025 Season 2 on at

    Hi Jamal,

    Is the SalesTypeTable restricted in an XDS policy? If so, the current method will not work as it tries to find records in the SalesTypeTable which is restricted for the user.

    The coding is retrieving a record from the WorkerGroupTable, but this is not considered to fill the temporary table. What is the actual condition for knowing what sales types are allowed per user?

  • Suggested answer
    huijij Profile Picture
    19,811 on at

    Hi partner,

    As André mentioned the details, and you didn't mention whether you set up a security policy, and you didn't show the class to handle operations related to required security policy.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 692 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 558 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 364 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans