Friday 26 October 2012

Client Workspace in Microsoft Dynamics Axapta 2012

It is the standard rich client interface , used by end-user


List of Components in WorkSpace

    Navigation Pane
           Menu on left side of screen that shows all of the modules the current user has access to

    Content Pane
           It displays  
                          Role Center, 
                          List Pages and  
                           Area Pages

           Role centers display
                     Specific data
                     Reports
                     Alerts and 
                     Common tasks associated with users role in the organization

                     It display when end-user opens the application or goes to Home in Navigation pane

          List Pages Display
                    List of data
                    Optimized to view and search and 
                    Act on information

          Area Pages Display
                     All menu items relevant to module selected in Navigation pane
                     Grouped Logically, it is easy for end-users to find what they need





Saturday 13 October 2012

Visual Studio Project in Microsoft Dynamics Axapta 2012

Visual Studio Project used to interact with Microsoft Dynamics Axapta, Allow developer to create subset of elements

Three types of Visual Studio Project can be used to develop

1.   Report Modeling Projects

       It has own templates provided under the microsoft Dynamics Axapta template group

2.   Enterprise Portal Web Application Projects

       It has own templates provided under the microsoft Dynamics Axapta template group

3.   Managed Codce Projects
      Once this project is created in visual studio, Axapta elements from application explorer can be added to it by drag an element from application explorer in to project solution explorer

    node representing the element will be in the project, also referred to as proxies

Create Evenet handlers in Managed code
      1. Open  Visual Studio.
     2. Create Managed Code project.
     3. Rename class like MyPreEventHandler
     4. Save your project.
    5. Build class,then Build MyPreEventHandler.
    6. Right-click on project in Solution Explorer and select Add
       "Project Name" to AOT.

    7. If the Application Explorer is not visible, open the same.
    8. In the code editor, open the MyPreEventHandler class and place
        cursor somewhere inside the class.

    9. In the Application Explorer, locate SalesFormLetter class.
       Expand the same and locate the run method.

    10. Right-click the run method and select Add pre event handler.
    11. make sure that event handler method is created

Deploying Managed code
     1. Build the project.
     2. Right-click project and add the same to AOT.
     3. Set deployment properties for the project.
     4. Right-click project and deploy the project.

In procedure VB.net used instead of C#

Friday 12 October 2012

Locking in Axapta 2012

Multiple user is trying to access the database, same time users wnats to lock the same records at the same time

 
If first user lock the record another user wait until the record is realesed by first user
 
Incase of dead lock arrived, transaction must be aborted
 
when overlapping transactions editing the same data is small, optimistic locking increase concurrency and thus transaction throughput. Enable OCC for a table by setting the property OccEnabled to Yes
 
   Never implement dialog with the user inside a transaction.
 
  Try to lock central resources in the same order. This avoids the dead
  lock situation discussed previously. This serializes the process,
  which means that only one user can perform this at a time.
 
  Try to avoid locking central resources.

  Keep the transactions as short in time as possible. Do not
  compromise the integrity of the data.
 
 
Locking is held when it takes to finish the process
 
Process of locking
 
Process 1                          Process 2                      
Item C -                           Locked -
Item A -                           Locked -
Item B -                           Locked Item G - Locked
Item G - Waiting for lock from     Item A - Waiting for lock from
Process 2                          Process 1
 
 
    ttsbegin;
    while select inventTable
    {
        if
          (CustTable::find(branchTable.PrimaryBranchid).Blocked == CustBranchBlocked::All)
            {
                BranchTableUpdate = BranchTable::find(BranchTable.BranchId, true);
                BranchTableUpdate.PrimaryBranchId ="";
                BranchTableUpdate.update();
             }
     }
     ttscommit;
 * ------------------------------------------------------------------------------------------------------------*
    while select forupdate inventTable
                       exists join vendTable
    where vendTable.AccountNum == inventTable.PrimaryVendorId &&
                     vendTable.Blocked == CustVendorBlocked::All
 

Methods Used in Array in Axapta 2012

In microsoft Dynamics Axapta, use of Methods in Array

 
  • It hold value of any Single type, either it is objects or records 
  • such kind of objects can transferred to methods and functions

Methods

1.       exist(int)
          In arrya to check value is exist in desire positions
 
2.       lastIndex()
          To stores Maximum index value in array
 
3.       value(jnt_index, [anytype_value])
           It do gets or sets the value of the array member that is stored at the specific index

Check below details, it holds three differant query object.

Array array = new Array (Types::Class);

array.value(1, new Query());
array.value(2, new Query());
array.value(3, new Query()); 

 

Thursday 11 October 2012

Show User is already logged in in Axapta

If you would like to restrict single user name/Id to get multiple session in axapta, try below



select count(recid) from clientSession where clientSession.userId==curuserid() &&
                                                                         clientSession.status!=0                 &&
                                                                clientSession.sessionType==0;

    if(clientSession.recid>1)
    {
          for(myloop=1,myloop<=150,myloop++);
         {
            progress.incCount();
            progress.setCaption("Alert")
            progress.setText(strfmt("  '%1' is already logged-in",curuserid()));
            sleep(5);
         }
     infolog.shutDown(true);
    }

 

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