Re: SV: [development-axapta] How to show field hidden by user in X++
Thanks for the responses. I tried what somanna suggested, but it didn't work. I talked with our client, and they said that it's good enough that the whole form cannot be altered (which can be done with parameters in the form). At least it solves the problem, although it's a little like beating a fly with a sledgehammer. But it would be nice to know if it's even possible to do such a thing at runtime, denying the ability to alter a form field instead of the whole form. --- In development-axapta@yahoogroups.com, Dahlsgaard Jan j...@... wrote: very bad idea. You are changing code in aot on runtime, and unless you change it back, it will be like that next time you open the form, and also all other places this field is used. There might even be a problem with missing X++ license, or if the user doesn't have access to SysDevelopment. Fra: development-axapta@yahoogroups.com [mailto:development-axa...@yahoogroups.com] På vegne af somanna gl Sendt: 5. februar 2009 04:45 Til: development-axapta@yahoogroups.com Emne: Re: [development-axapta] How to show field hidden by user in X++ str Property; TreeNode TreeNode; str Name; ; Name = CustTable; TreeNode = TreeNode::findNode(Data Dictionary\\Tables\\ /*+ Table*/); if (TreeNode) { ttsbegin; Property = TreeNode.AOTgetProperties(); Property = SetProperty(Property, visible, Yes); TreeNode.AOTsetProperties(Property); TreeNode.AOTcompile(); TreeNode.AOTsave(); } From: christian.myrvold christian.a.myrv...@... mailto:christian.a.myrvold%40gmail.com To: development-axapta@yahoogroups.com mailto:development-axapta%40yahoogroups.com Sent: Monday, February 2, 2009 6:45:33 PM Subject: [development-axapta] How to show field hidden by user in X++ Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris [Non-text portions of this message have been removed]
RE: SV: [development-axapta] How to show field hidden by user in X++
Hi I was able to disable the hide functionality entirely in all forms by placing code in the SysSetupFormRun class. If you add the line of code below into the class' init() method before the super call you'll find that the Hide option is not available on the context menu in any form. this.form().design().allowUserSetup(false); When I did this I felt it a little too restrictive so used a new security key to determine whether the code should be executed (so that only some users were denied the right to change their form setup) and I included the option to override this entirely on some forms using an optional method placed on forms that still need to have form setup and accessed through reflection. So, my bit of code looks like this... if ( new DictSecurityKey(SecurityKeyNum(GhsHideShow)).rights() AccessType::Delete ) { // User doesn't normally have rights to use Hide/Show - check if there is form level override if ( formHasMethod(this, IdentifierStr(GhsAlwaysEnableHideShow)) ) { // Form has override - check how it should be applied formRunObj = this; if ( ! formRunObj.GhsAlwaysEnableHideShow() ) { // Override not enabled - so disable Show/Hide ( form setup!) this.form().design().allowUserSetup(false); } } else { // Nor form override so just disable Show/Hide ( form setup!) this.form().design().allowUserSetup(false); } } Regards Malcolm Burtt Touchstone Group People - Partnership - Solutions From: development-axapta@yahoogroups.com [mailto:development-axa...@yahoogroups.com] On Behalf Of christian.myrvold Sent: 10 February 2009 07:59 To: development-axapta@yahoogroups.com Subject: Re: SV: [development-axapta] How to show field hidden by user in X++ Thanks for the responses. I tried what somanna suggested, but it didn't work. I talked with our client, and they said that it's good enough that the whole form cannot be altered (which can be done with parameters in the form). At least it solves the problem, although it's a little like beating a fly with a sledgehammer. But it would be nice to know if it's even possible to do such a thing at runtime, denying the ability to alter a form field instead of the whole form. --- In development-axapta@yahoogroups.commailto:development-axapta%40yahoogroups.com, Dahlsgaard Jan j...@... wrote: very bad idea. You are changing code in aot on runtime, and unless you change it back, it will be like that next time you open the form, and also all other places this field is used. There might even be a problem with missing X++ license, or if the user doesn't have access to SysDevelopment. Fra: development-axapta@yahoogroups.commailto:development-axapta%40yahoogroups.com [mailto:development-axapta@yahoogroups.commailto:development-axapta%40yahoogroups.com] På vegne af somanna gl Sendt: 5. februar 2009 04:45 Til: development-axapta@yahoogroups.commailto:development-axapta%40yahoogroups.com Emne: Re: [development-axapta] How to show field hidden by user in X++ str Property; TreeNode TreeNode; str Name; ; Name = CustTable; TreeNode = TreeNode::findNode(Data Dictionary\\Tables\\ /*+ Table*/); if (TreeNode) { ttsbegin; Property = TreeNode.AOTgetProperties(); Property = SetProperty(Property, visible, Yes); TreeNode.AOTsetProperties(Property); TreeNode.AOTcompile(); TreeNode.AOTsave(); } From: christian.myrvold christian.a.myrv...@... mailto:christian.a.myrvold%40gmail.com To: development-axapta@yahoogroups.commailto:development-axapta%40yahoogroups.com mailto:development-axapta%40yahoogroups.com Sent: Monday, February 2, 2009 6:45:33 PM Subject: [development-axapta] How to show field hidden by user in X++ Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
Re: [development-axapta] How to show field hidden by user in X++
strProperty; TreeNodeTreeNode; str Name; ; Name = CustTable; TreeNode = TreeNode::findNode(Data Dictionary\\Tables\\ /*+ Table*/); if (TreeNode) { ttsbegin; Property = TreeNode.AOTgetProperties(); Property = SetProperty(Property, visible, Yes); TreeNode.AOTsetProperties(Property); TreeNode.AOTcompile(); TreeNode.AOTsave(); } From: christian.myrvold christian.a.myrv...@gmail.com To: development-axapta@yahoogroups.com Sent: Monday, February 2, 2009 6:45:33 PM Subject: [development-axapta] How to show field hidden by user in X++ Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris
SV: [development-axapta] How to show field hidden by user in X++
very bad idea. You are changing code in aot on runtime, and unless you change it back, it will be like that next time you open the form, and also all other places this field is used. There might even be a problem with missing X++ license, or if the user doesn't have access to SysDevelopment. Fra: development-axapta@yahoogroups.com [mailto:development-axa...@yahoogroups.com] På vegne af somanna gl Sendt: 5. februar 2009 04:45 Til: development-axapta@yahoogroups.com Emne: Re: [development-axapta] How to show field hidden by user in X++ str Property; TreeNode TreeNode; str Name; ; Name = CustTable; TreeNode = TreeNode::findNode(Data Dictionary\\Tables\\ /*+ Table*/); if (TreeNode) { ttsbegin; Property = TreeNode.AOTgetProperties(); Property = SetProperty(Property, visible, Yes); TreeNode.AOTsetProperties(Property); TreeNode.AOTcompile(); TreeNode.AOTsave(); } From: christian.myrvold christian.a.myrv...@gmail.com mailto:christian.a.myrvold%40gmail.com To: development-axapta@yahoogroups.com mailto:development-axapta%40yahoogroups.com Sent: Monday, February 2, 2009 6:45:33 PM Subject: [development-axapta] How to show field hidden by user in X++ Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris [Non-text portions of this message have been removed]
Re: [development-axapta] How to show field hidden by user in X++
For versions Dynamics AX 4.0 and Axapta 3.0 there is a configuration key under Administration keys that can disallow all user modifications to the UI. This is essentially #2 but impacts more than just hide/show. The user will not be able to re-arrange columns or move fields from one tab to another. This keeps the user interface experience the same for all users. If you want to disable user modifications, go to Administration Setup System Configuration. Open the Administation folder and uncheck the option labeled Advanced Form Customizations. This configuration key appears to have been removed in AX 2009, so I am not sure how you can do this same thing in the latest release. On Mon, Feb 2, 2009 at 6:15 AM, christian.myrvold christian.a.myrv...@gmail.com wrote: Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris
[development-axapta] How to show field hidden by user in X++
Hey everyone, I've searched both the group postings and google for this, and haven't found anything yet. I need to either: 1. Show a field in a form immediately after a user hides it (so it looks like the hide functionality doesn't work), or 2. Disable the hide functionality when a user right clicks on the field. I would say the the first is preferrable, if it's at all possible. Sincerely, Chris