Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

How to override checkbox form control method on a extended form.

$
0
0

I have a requirement to ensure that only 1 item is select at any given point of time on the form. 

I was able to accomplish this in Ax2012 with the code shared at bottom, however not sure how to go about this in D365 FO as this is form conrtol is  on an extended form.

Any ideas.

  1.  Code in Ax2012 which helped in ensuring that only 1 item was checked at given point in time.
    1.	Create a tbale 
    2.	Create a form 
    3.	Write code on the form > grid > control ( check box ) > modify > define control as auto declaration yes 
         public boolean modified()
    •	{
    •	boolean ret;
    •	
    •	ret = super();
    •	
    •	if(Mytest.value() == NoYes::Yes)
    •	mytest.allowEdit(false);
    •	if(Mytest.value() == NoYes::No)
    •	
    •	mytest.allowEdit(true);
    •	
    •	return ret;
    •	}
    
    •	Create a button called reset > 
    •	Write on  buttons click 
    •	void clicked()
    •	{
    •	    super();
    •	    mytest.allowEdit(true);
    •	}
    

Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>