Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How Hide FormControl U...
Finance forum
Suggested answer

How Hide FormControl Using x++

Posted on by 490
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
    Bharani Preetham Pe... 3,572 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
    Kushal Bundhun 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
    Waed Ayyad 5,451 Super User 2024 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
    Layan Jwei 7,071 Super User 2024 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
    Sachin Mittal 490 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
    Layan Jwei 7,071 Super User 2024 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
    André Arnaud de Cal... 290,524 Super User 2024 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans