Notifications
Announcements
No record found.
Hi everyone
i m trying to grey out " release to warehouse" button depending on a specific value of column in sales table and all this for a specific role
i m working in pharmaceutical industry and we have added a column in sales tables to define if the sale order contains psychoactive drug or not so if it is, the " release to warehouse" sould be greyed out
please can you help me
Peace
Hi Pharma,
Usually, you need to make the next steps:
1. Change "AutoDeclaration for the button to "Yes" on a form to be able to access the button from the code.
2. On active method for data source after "super" you call enable method on button variable with true or false (button.enabled(false))
3. if you want to implement this change only for a specific role you have several options
3.1. Make a copy of button with new privilege and give access to the specific role and remove access to the old button
3.2. Add parameter with the role selection and implement the function to check if the user has a role from parameters - similar to blog.andrewhuey.com/.../
In addition to the reply from Sergei... It might be the case that there is existing logic in the application which controls the behavior of this button. In that case, you have to extend this logic with your requirements.
hi Sergei
thank you for your response
so i am a beginner and i want to know more about the solution you ve proposed
i m stucked on step 2
where can i find this 'active method"
thank you
If you can't find the active method on a datasource, you can right click the method node and choose to create a new override method for active().
Here is also documentation about avialable methods on form data sources.
docs.microsoft.com/.../methods-on-a-form-data-source
hi
thank you so much
but i have one more question , i want to use your function " IsUserInRole "
my question is how to get the AOT rolename of a role for example "SalesManager" role
thank you by advance
which ax function could give me the aotname of a role
for example i want to use your function IsUserInRole
how can i get the argument rolename for a "SalesManger" Role for example
hope i ve been explicit
At least the system table SecurityRole contains the information you are looking for.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader