web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How Hide FormControl Using x++

(1) ShareShare
ReportReport
Posted on by 2
On Production Order > Picking List > lines > Batch form I want to hide available physical and available ordered control from grid, written this code but not working , please help
 
/// <summary>/// InventBatchIdlookup_OAE1_Extension/// </summary>[ExtensionOf(formStr(InventBatchIdlookup))]final class InventBatchIdlookup_Extension{    /// <summary>    /// setShowAvail    /// </summary>    void setShowAvail()    {        next setShowAvail();        ctrlInventSum_AvailOrdered.visible(false);        ctrlInventSum_AvailPhysical.visible(false);        ctrlphysicalInvent.visible(false);    }    /// <summary>    /// initParmDefault    /// </summary>    void initParmDefault()    {        next initParmDefault();        showAvail = false;    }}
 
I have the same question (0)
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Moderator on at
    How Hide FormControl Using x++
    Write this code in init() method or active() method of this form or you can simply create an extension and make the visible property to no.
  • Suggested answer
    Kushal Bundhun Profile Picture
    4 on at
    How Hide FormControl Using x++
     
    Apart from the answer provided by @Waed Ayyad , I suggest putting your code directly in the init() method.
     
    However, if you wish to hide these controls at all times, I suggest changing the "visible" property of these controls from the form extension to false
     
    Thanks
    Kushal Bundhun
  • Suggested answer
    Waed Ayyad Profile Picture
    8,751 Super User 2025 Season 2 on at
    How Hide FormControl Using x++
     
     
    Try to debug your code in order to know the cause of the issue, also I suggest calling setShowAvail() in the init method, maybe there is a case  setShowAvail isn't hit.
     
     
     
    Thanks
    Waed Ayyad
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
      
  • Layan Jwei Profile Picture
    Super User 2025 Season 2 on at
    How Hide FormControl Using x++
    Hi Sachin,

    Did you check what Andre mentioned, which is to put break points and see if your code is actually called.
    Can you please share with me where this production order is in the UI? (maybe a screenshot) so that I can help you further

    Thanks,
    Layan Jweihan
  • Sachin Mittal Profile Picture
    2 on at
    How Hide FormControl Using x++
    /// <summary>
    /// InventBatchIdlookup_OAE1_Extension
    /// </summary>
    [ExtensionOf(formStr(InventBatchIdlookup))]
    final class InventBatchIdlookup_OAE1_Extension
    {
        /// <summary>
        /// setShowAvail
        /// </summary>
        void setShowAvail()
        {
            next setShowAvail();
            ctrlInventSum_AvailOrdered.visible(false);
            ctrlInventSum_AvailPhysical.visible(false);
            ctrlphysicalInvent.visible(false);
        }
        /// <summary>
        /// initParmDefault
        /// </summary>
        void initParmDefault()
        {
            next initParmDefault();
            showAvail = false;
        }
    }
     
    this code is not hiding those controls , they are still visible
  • Layan Jwei Profile Picture
    Super User 2025 Season 2 on at
    How Hide FormControl Using x++
    Hi Sachin,
     
    Can you please repost your code in the comments section?

    Thanks,
    Layan Jweihan
  • André Arnaud de Calavon Profile Picture
    296,568 Super User 2025 Season 2 on at
    How Hide FormControl Using x++
    Hi Sachin,
     
    Can you please tell us what you mean with "but not working"? Do you get errors? If not, did you use the debugger to find out if your coding is actually being executed?

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans