Sunday 24 July 2011

Getting the Port No Through Code in Axapta

Hi Friends

        Following code illustrates in getting the PortNo  in Axapta Through Code.Session Class can also be used to get the AOS Name and the Client System Name.

            
static void GetAOSPort(Args _args)
{  ;
   info(strfmt("Port number: %1",int2str(Session::getAOSPort())));
}


         
Regards
Santhosh Reddy
-It's kind of fun to do the impossible 

Converting Date Field to String in Axapta

Hi Friends,
 
  We Can Convert he Date Field to String using the Standard Function as follows

   str = Date2str(<DateValue> , 213 , 2, -1 , 2 , -1 , 2 , -1 , 2 ) ;

   Here -1 is for Colon , 2 is for No of digits used to indicate date. month , year and 213 is for MM:DD:YY Series.

Regards
Santhosh Reddy
-It's kind of fun to do the impossible 
























Sunday 17 July 2011

Restricting the Form to Open Directly

Hi

  Restricting the Form from Opening Directly is an Easy way and can be done by overriding the Inint method of form as follows:

                 Override Init method of form and write the following statement after Super()

                       if(! element.args().caller())
                          {
                                  throw error("Form can not be opened Directly");
                          }

By doing this we can restrict the Form Opening Directly

Regards
Santhosh Reddy
-It's kind of fun to do the impossible