Skip to main content

Notifications

Announcements

No record found.

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 466
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;    }}
 
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,524 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
    3,252 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
    4,102 Moderator 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
    466 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
    4,102 Moderator 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
    283,860 Test role Public 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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

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

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans