Wednesday 22 August 2018

How to hide a form control in AX 365


Hi,

Below is the code for hiding a form control in AX. In this example I'm hiding map button.


class LogisticsPostalAddressGrid_Eventhandler
{
    /// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(formStr(LogisticsPostalAddressGrid), formMethodStr(LogisticsPostalAddressGrid, init))]
    public static void LogisticsPostalAddressGrid_Post_init(XppPrePostArgs args)
    {
        FormRun             element       = Args.getThis(); //form element
        FormControl         myNewButton   = element.design(0).controlName("MapButton");

        myNewButton.visible(false);
    }

}

No comments:

Post a Comment

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...