How to disable a form control in AX 365

// <summary>
/// Created by Rahul - 08/15/2017 for disabling LogisticsPostalAddress_Street control
/// </summary>
class LogisticsPostalAddress_EventHandler
{
    /// <summary>
    /// We are disabling LogisticsPostalAddress_Street control here
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(formStr(LogisticsPostalAddress), formMethodStr(LogisticsPostalAddress, updateControls))]
    public static void LogisticsPostalAddress_Post_updateControls(XppPrePostArgs args)
    {
        FormRun sender = Args.getThis();
        sender.control(sender.controlId(formControlStr(LogisticsPostalAddress, LogisticsPostalAddress_Street ))).allowEdit (false);
    }

}

Comments

  1. Thanks Rahul for the post. Can you help on how to control any button on the same form. (Ex: Map button)

    ReplyDelete
    Replies
    1. Please look into the below post.
      http://rahulmsdax.blogspot.com/2018/08/how-to-hide-form-control-in-ax-365.html

      Delete

Post a Comment

Popular posts from this blog

Filter Records on Item Lookup Through X++ - Ax 2012

How to Install Management Reporter in Ax 2012 R3

Settle Vendor Invoice/Payment through X++ code - AX 2012