Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
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,605 Super User 2024 Season 1 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 6,332 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,347 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,347 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... 291,280 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans