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 482
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,528 Super User 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 3,904 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 4,815 Super User 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 482 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 4,815 Super User 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... 288,584 Super User 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?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans