Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

Backdate validation for user control in EP axapta

$
0
0
If you are seeking code for Backdate validation for user control in Enterprise portal page for  axapta then below code can help you.

Its tricky to find code on EP so its helpful for you.

 string cDate1 = DateTime.Now.ToString("dd/MM/yyyy");
 int flag = 0;
 Proxy.Info objinfolog = new Proxy.Info(this.AxSession.AxaptaAdapter);
 DateTime x;
 DateTime a;
Int32 r1;
Date1 = txtDate1.Text;

Ir = dsTestNewForm.GetDataSourceView("TestNewForm").DataSetView.GetCurrent().GetRecord();
       
        if (txtDate1.Text != "" && Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM")
        {
             x = DateTime.Parse(cDate1, new CultureInfo("en-CA"));
             a = DateTime.Parse(Date1, new CultureInfo("en-CA"));
             r1 = DateTime.Compare(a, x);

            if (Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM" && r1 < 0 && Date1 != "")
            {
                objinfolog.add(Proxy.Exception.Warning, "Back Date not allowed!!");
                flag = flag + 1;
            }
        }


Viewing all articles
Browse latest Browse all 64797

Trending Articles



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