Skip to main content

Notifications

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

  • Suggested answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: XDS with temporary tables

    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.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,971 Super User 2025 Season 1 on at
    RE: XDS with temporary tables

    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?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans