Monday 8 October 2012

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




 

Arrays in Microsoft Dynamics Axapta 2012

Array is a list of items with the same datatype and the same name, Only the index differs


Arrays can be declared by brackets [ ]

real      MyArray[];                    //unlimited index value
real      MyArray1[15];              //maximum 10 index value

myarray[1] = 1.1;
myarray[2]= 1.2;

etc...

for [i =1; i <= 15; i++)
   {
      print MyArray1[i];
   }

A container variable can contain different types and value of simle and extended data types, including arrays

container  xyz;

int             a,b;
xyz = [15, 30, "SempleText"];
print compeek(xyz,3);

 

Characteristics of X++ in Axapta 2012


Reliable
     X++ provides extensive compile-time checking,
     Memory management model is simple,
     Object create by New operator,
     Automatic garbage collection
     Eliminates entire classes of programming errors

Interpreted and dynamic
     Benefit from faster developement cycle prototyping,
     Rapid developement and experimentation

Interoperable
     components in AX are seamlessly available to any application supporting .Net,
     conversely x++ is able to consume external managed code and COM objects.


 

Change the font style based on parameter in SSRS

How to change font style in SSRS 2008, SSRS 2012


               Like

               "Bold", "Normal", "Thin", ExtraLight", "Light", "Medium",
               "SemiBold", "Bold", "ExtraBold", "Heavy"



If your Parameter ShowSummary  = True than  change the Font Style to  "Normal" otherwise "Bold"

Step 1)

Create Parameter ShowSummary
Data type : Boolean
Default Values, Click Add and type True (Defining default Value = True)


Create New Parameter as ShowSummary, data type Boolean


Set default value as False so by default summary value will be False


Right click on your textbox, Select Textbox Properties, Select Font, Click on the Fx button besides Bold


as per the parameter value, show font type

Now run the reports, you can see that when you select show summary = true your text box font type appears "Normal" or it will show in "Bold "

Thanks




Sunday 7 October 2012

SSRS 2012 Report Parameter and multiple filter code


//Define Parameters as below

   MbooleamParaMtr             as Boolean
   MMultipleSelectionParam as Multiple secection Txt Parameter

// your selection criteria as below

  select field1, field2
  from
           Table1
where
           @MbooleamParaMtr = 1                       or
            field1 In (MMultipleSelectionParam)

Saturday 6 October 2012

Index was outside the bounds of the array

you may face this issue when axapta 2012 excel import of data


solution

check mandatory fields should be present in entity you are trying to import
 

Friday 21 September 2012

Axapta 2012 Developer point of view

View
  • Use tables and views to model data in perspectives
  • Modeling data using views and tables makes it easier to customize cubes.
Analysis Services Project wizards
  • Deploy default cubes.
    • Use the Analysis Services project wizard to deploy an existing Analysis Services project. Choose the default cubes from the AOT.
    • It is easier to deploy the default cubes.
Configure an Analysis Services project
  • Use the Analysis Services project wizard to remove measures, dimensions, and KPIs that you do not have access to according to the license and configuration keys in Microsoft Dynamics AX.

Analysis Services project.
  • It is easier to update an existing Analysis Services project.
ValidTimeStateFieldType
  • select statement , validTimeState keyword to filter rows by date or date range, like ValidTimeStateFieldType property
Application programmers no longer have to track every detail of foreign key relationships when they perform a set of data modification calls. The UnitOfWork class helps enforce transaction integrity.