Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I am trying to understand the difference between : 

- Applying a security Policy using RoleProperty as contexttype then entering a contextstring in the roles to apply the Policy on the desired roles

- Applying a security Policy using Contexstring as contexttype then entering a contextstring in the roles to apply the Policy on the desired roles

I've read the doc and here's the description of both functionalities, that still does'nt help me to understand the difference, if someone can explain it with an example it would be great.

ContextString – Set the property to this value if a global context is to be used to determine whether the policy should be applied. When required, this context string needs to be set by the application using the XDS::SetContext API.

RoleProperty – Set the property to this value if the policy is to be applied only if the user is a member of any one of a set of roles that have the ContextString property set to the same value (see Setting the policy context later in this article for details for more details).

Thanks to the answerer.

*This post is locked for comments

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi smallrider,

    Can you repeat your requirement in more functional words? I have done some XDS related to InventDim before, but indeed it is challenging. Not everything is possible. If you add the details, I will think about it.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi André,

    thank you for your answer,

    I had another contextstring applied with Roleproperty that made my testings all wrong !

    I did not enabled contextstring option using X++ and furthermore it was not filtering anything.

    That made me think the contextstring option could allow me to filter tables such as purchreqline and purchtable on fields they do not include using table relations WITHOUT filtering InventDim and InventSite ...

    Which seems impossible ...

    If you ever had this case I am really interested in having the solution btw.

    Thank you being patient and answering me many times ...

    Apologies,

    Best regards,

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    As mentioned before, the contextstring option needs to be enabled/disabled using x++ logic. Where in the system did you implement this?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi André,

    Thank you for answering,

    I've tested carefully and to making it simple :

        - with contexttype RoleProperty it filters much more data than wanted (it filters the relation table I use to filters the table wanted)

         - with contexttype contextstring it DOES NOT filter  the tables I wish (however I don't understand the difference between these two functionalities)

    BR

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi,

    I cannot understand clearly what you have done and where you have applied what context strings, what role or roles are involved or not. Maybe you need to elaborate.

    The only risk, consequence would be that there is too less or too much data filtered. You should test carefully like any other customization before applying changes to your production environment.

    In the past years I have not found a good document related to the property contexttype.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    HELP Please

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Anyone ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi,

    Thank you very much for answering,

    I am going to try to give more details about what I am trying to do, the testing I've performed and my interrogations.

    - The goal is to filter 2 tables (PurchTable, PurchReqLine) on fields that they don't have (Site) using policies via table relations (with InventDim and InventSite) and constrained tables WITHOUT FILTERING InventDim and InventSite.

    - The set up is done as described below :

       - Query on InventDimSiteID_Site1 (then Site2 and so on)

                 - Primary Table = InventDim

                             - Policy InventDimSiteID_Site1

                                          ConstrainedTable = Yes

                                          Table = PurchReqLine

                                          Table Relation = InventDim            

       - Query on InventSiteSiteID_Site1 (then Site2 and so on)

                  - Primary Table = InventSite

                             - Policy InventDimSiteID_Site1

                                          ConstrainedTable = Yes

                                          Table = PurchTable

                                          Table Relation = InventSite  

    - To apply these 2 Policies on the Role I created the contextstring :

            - PurchReqLineAndPurchTableFilter

    Now when I apply these Policies using :

                - ContextType = RoleProperty then the contextstring above

                              -> THE FILTER APPLY ALSO TO PRIMARY TABLES

                - ContextType = Contextstring then the contextstring above

                              -> THE FILTER DOES NOT WORK

    Thank you for reading and for your answer (I am also interested in any document that provides information about ContextType = ContextString

    Best Regards,

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Hi,

    The ContextString is intended to be used in x++ code to enable/disable policies.

    The RoleProperty is defined as context string on the roles. You can then link multiple roles to one or more policies with a certain context string.

    The RoleName is used to have a policy enabled for just one particular form.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Difference between ContextTypes : RoleProperty (then contextstring) and Contextstring directly

    Nobody can help ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans