Tuesday 22 November 2011

Using graphics in forms and legacy reports

Override Standard Query in Report Fetch Method

Hi
  They are some simple steps which can be followed while overriding Fetch Method to get values from standard Query of a Report as follows:

       queryRun = new QueryRun(this);    queryRun.query().dataSourceTable(tablenum(tablename)).addRange(fieldnum(tablename,Fieldname)).value(queryvalue(dialogbox fieldvalue));
////
We can Use SysQuery Class Range method as follows
 SysQuery::Range(<value range>) 
we can also use queryRange (date1 , date2) instead of queryvalue()




Regards
Reddy

Tuesday 2 August 2011

Restoring Data Base and Application From One Domain to Another Domain

Hi
      For Restoring the Application and DB they are few simple Steps which can be followed as follows

Step1:Restore the Data Base which we need to attach to the Application
Step2:Install the Standard Application Excluding Data Base and Attach the Data Base which was Restored .
Step3:Replace the Application Files of Standard with the Required Application Files.
Step4:Compile the Application and Synchronize the Data Base

    When we Open the Application  it may Prompt that You are Not Recognized User of Microsoft Dynamics AX.Contact Your System Administrator.
Step5:To Solve this Issue u Need to Authenticate the Currently Logged in User in the UserInfo Table.Here we need to Provide The Network Alias as the User Name ,Domain and SID(Security Identification)
     To Know the SID Go> Run >Regedit>Computer>HKEY_CURRENT_USER\Software\Microsoft\Protection Storage Security Provider\XXXXXXXXXXXXXXXXXX
    
          Copy the SID From here and Paste in SID Field of Userinfo Table

By this we can Restore the Application and DB From one  Domain to Another Domain Successfully.


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

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 
                   

Sunday 26 June 2011

Getting Go to Main Table Form as it is existing in Standard Axapta

Hi ,

  If we want to get go to main Table .we need to  follow simple steps as follows:

Create a Menu Item  for the form and Attach Particular MenuItem as FormRef Property of Particular Table.

Eg:
Suppose if i want to display  FormA(Using TableA) as Go to Main Table in any other Form then i ll Create a Menu Item for FormA and i wll Attach this MenuItem as FormRef in TableA Property.

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

Wednesday 15 June 2011

Getting the Name of logged In User Name and his Email

Hi All
      We can  get the Logged In User in Axapta Using the Function curUserId().Information which is relevant to the Particular User will be stored in SysUserInfo and  UserInfo Table.Now we can get the Email Id and Full Name of the Current Logged in User by doing as Follows:

  select Email from SysUserInfo where SysUserInfo.Id == curUserId();  //For getting Email Id

  select Name from UserInfo where UserInfo.id == curUserId(); //For getting Name
 
Then, we can print out his details Using
               
  Info(“Email: “ + SysUserInfo.Email); Info(“Name: “ + UserInfo.Name); 

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