Thursday 11 October 2012

pass parameter in axapta between a form


Step 1) Button Control Data Source Value

public void init()
{
    custTable _Custtable;
     ;
     super();
     if(element.args())
    {
         if(element.args().record() && element.args().record().tableID == tablenum( custtable))
         {
              _Custtable = element.args().record();
          }
     }
}

Step 2) overiding source form's button control clicked method

In Form1

void clicked()
{
  
    Args            args;
    Formview         Formview;
    ;

    args = new args();
    args.parm( "yourStringValue" );

    _args.name( formstr( FormB ) );
    Formview= classFactory.formviweClass( Args );
    Formview.init();
    Formview.run();
    Formview.wait();

    super();
}

In Form2

public void init()
{
    str             YourStringValueFromCaller;
    ;
    super();

    if( element.args() )
    {
        // get string parameter
        YourStringValueFromCaller = element.args().parm();

    }
}

Wednesday 10 October 2012

Report Deployment in Microsoft Dynamics Axapta 2012

Step by Step Report Deployment in Microsoft Dynamics Axapta 2012, it is Faster and Reliable

There are three way to deploy SSRS report
1.    Visual Studio
2.    Within AX workspace
3.    Report Shell


Below there are two reports for deploy shown in bold letter, you can right click and select Deploy Report in AOT, you can select two reports at a time and right click and select Deploy Element

you can select multiple report name, right click and select deploy


Info Log shows with statistic Success
You can see below deployment status for design name Success

 
To verify that Report is deployed or not so we go to DynamicsAX - Report Manager and refresh the page, you can see your Reports Name appeared here



Now let’s  do the same from Microsoft Visual Studio, here you can right click and see the option available like Build solution, Rebuild Solution, Deploy solution etc….
 



you can right click on report file and select deploy



Once you select deploy  you will get information in outpout window, below you can see 
Deployment status for design name : success





Now check the file which are available in Report manager, to cross verify you can delete the files from Report Manager and deploy once again so you can see the newly deployed file in report manager





How to deploy a report file thru Report Shell
Check step by step below images

Select Microsoft Dynamics AX 2012 management Shell from Windows Menu -Start - Administrator Tools

Make sure you are administrator or Right Click and select Run as Administrator

 
 you can find below screen shot which is pure command line based

Get - Command
Get - Command -Module Microsoft.Dyn*

Try

Get-AXReport     and          Publish-AXReport

Get-Help Get-AXReport

 


Get -AXReport - ReportName *
First time it may take a minute to show the output


If you wanted to see in grid view
$Reports Get-AXReport -ReportName *
$Reports : Out-GridView

You will get one window display as below

 
So now lets do publish report from command line
 
     Publish-AXReport -ReportName BIDemo*
 
It will display Deploying Reports and related artifacts
You can see DesignDeploymentSuccess : <Success>
 
 

 

 
Lets back to DynamicsAX - Report Manager, Refresh the page, you can see your reports deployed from command line


lets type command 

     Get -Command -Module Microsoft.Dyn*                 see above image Last Line

If you have problem with deploying

Type command line

     Test-AXReportServerConfiguration

See below image with result Testing the report server configurations completed, I would recommand to do it first



 


Thanks


Tuesday 9 October 2012

Reporting service error rsReportParameterValueNotSet

In Microsoft Dynamics Axapta if you get such error You must provide a parameter value


Solution

you can hunt for lookin your field in your current project for you are getting error

connect to analysis server and lookup your dimension, process the dimension

Select Update BI Data, ckick on update database


Under AOT go to the relavent table and browse

You can see query return with rows

Now go back to your project, open sql query and run the same , now you can find values

Save changes
Refresh role center

Problem is solved

Thanks

SQL list user name, database and permissionState

In Microsoft SQL Server How to list the User name and their role, Permission Type, Permission State

see all individual objects that each user has access to


SELECT 
    [UserName] = ulogin.[name],
    [UserType] = CASE princ.[type]
                    WHEN 'S' THEN 'SQL User'
                    WHEN 'U' THEN 'Windows User'
                    WHEN 'G' THEN 'Windows Group'
                 END, 
    [DatabaseUserName] = princ.[name],      
    [Role] = null,     
    [PermissionType] = perm.[permission_name],      
    [PermissionState] = perm.[state_desc],      
    [ObjectType] = CASE perm.[class]
                        WHEN 1 THEN obj.type_desc               
                        ELSE perm.[class_desc]                  
                   END,      
    [ObjectName] = CASE perm.[class]
                        WHEN 1 THEN OBJECT_NAME(perm.major_id)  
                        WHEN 3 THEN schem.[name]               
                        WHEN 4 THEN imp.[name]                   
                   END,
    [ColumnName] = col.[name]
FROM   
        sys.database_principals princ 
LEFT JOIN
       sys.server_principals ulogin on princ.[sid] = ulogin.[sid]
LEFT JOIN       
       sys.database_permissions perm ON perm.[grantee_principal_id] = princ.[principal_id]
LEFT JOIN
      sys.columns col ON col.[object_id] = perm.major_id
                    AND col.[column_id] = perm.[minor_id]
LEFT JOIN
    sys.objects obj ON perm.[major_id] = obj.[object_id]
LEFT JOIN
    sys.schemas schem ON schem.[schema_id] = perm.[major_id]
LEFT JOIN
    sys.database_principals imp ON imp.[principal_id] = perm.[major_id]
WHERE
    princ.[type] IN ('S','U','G') AND
    princ.[name] NOT IN ('sys', 'INFORMATION_SCHEMA')





or      try below query


select  
  princ.name,       
  princ.type_desc,       
  perm.permission_name,       
  perm.state_desc,       
  perm.class_desc,       
  object_name (perm.major_id)
from    sys.database_principals princ
 left join
        sys.database_permissions perm
on      perm.grantee_principal_id = princ.principal_id

Monday 8 October 2012

Error while AOS start in Axapta 2012

If you get error while starting AOS in Microsoft Dynamics Axapta 2012

Object Server 01:  The directory "C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\bin" does not exist or access to it has been denied by the operating system.

solution

Create following directories

C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\bin
C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\share\config
C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\appl\Standard
C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\appl\Standard\db
C:\Program Files\Microsoft Dynamics AX\60\Server\ax6conBG\bin\Application\appl\Standard\tmp

Start AOS and check it works fine.

Thanks

What is an X++ tools in Microsoft Dynamics Axapta 2012


X++ tools

X++ is Object oriented programming language

It used MorphX Development Environment

It has Similar Syntax like C#

It incorporates SQL data manipulation statements

Tools
                           To launch Workspace - Ctrl + Shift + W

                X++ code editor,               accessible from Developement Workspace

 

                X++ compiler,                    accessible from Developement Workspace


                X++ Debugger,                  accessible from Developement Workspace


                Visual Studio,           
                Visual Studio Debugger   accessible from Developement Workspace

                Debugger

               
          

Variables and Data Types in Microsoft Dynamics Axapta 2012

Variable is holding data when a block of code executes


Scope

Global to a class (in the class declaration of a class)
Local to a method (Variable define in a method of a class)
Local to an embedded function ( variable defined in a function embedded in a method of a class)

Declaration
Rules
  •           Declare variable before anything else in the code
  •           use a semicolon after each declaration
assign value 20 to xyz
                     int xyz = 20;

                     you can also create Extended datatype on the basis of primitive datatypes



Overview of  Data type


String
             Hold characters - maximum 999 character it can hold
             str     xyz = "testing";

Integer
            Hold natural figure - number without decimal point
             int     xyz  = 9;

Real
            Numbers with decimal point
             real     xyz = 9.19;

Date
            date type contains day, month and year
            date    xyz = 02/18/2012;

UTC dateTime
           Hold year, month, day, hour, minute and secons
           utcDateTime   xyz =  02/18/2012 10:10:02 am;

Enum
           It represented internally as integer, first literal has the number 0, the next number 1 and so on,
           use as expressions

           enum xyz = NoYes::Yes;

Boolean
            it contain value True and False only
            boolean   xyz ;

Time
            Contains hours, minutes and seconds
            timeOfDay  xyz;

Guide
           Means Global Unique Identifer(GUID) it is uniue i nany context

           GUID XYZ ; //{3f2504E0-4F89-11D3-9AA0-5030E82C1033}.

Int64
           hold large integer, 64bit
           Int64 xyz;


Variable with extended datatype

custAccount         _CustAccount;
amountMST         amountDb, amountCr;



Composite data types

Array
          It is a List of Ites with the same data types and the same name, Only Index Differs

Container
          It is a Dynamic list of items that can contain primitive data types and
          some composite data types

Classes
          A class is a type defination that describes both variables and methods for
          instances (method) of the class

Tables
          It is defined in the database, can handle class definations