Wednesday, 18 November 2015

Change background color in Microsoft Dynamics AX

Hi guys,


Today I am discussing about very interesting/colourful topic. Generally we face the requirement to change the backgroud color of AX forms. Hence, user can differentiate between companies.
This is very simple you have to overwrite Run method into the "SysSetupFormRun" class and bellow code for changing background AX

Class - "SysSetupFormRun"
> Over
public void run()
{
;
super();
switch(curext)
{
case "AYN":
        this.design().colorScheme(FormColorScheme::RGB);
        this.design().backgroundColor(WinAPI::RGB2int( 204,255,0));
        break;
case "CAT":
        this.design().colorScheme(FormColorScheme::RGB);
        this.design().backgroundColor(WinAPI::RGB2int (155,255,0));
        break;
}
}

You can provide your color: in RGB format :-)


Happy DAXing :-)




Count Row in SSRS report AX [2012]

Hi guys,

Count rows for SSRS report, this is very general requirement for report. 
Use bellow syntax, With this syntax you can find total number of Row in your SSRS report. 

 = RowNumber(scope) 

Note- The value of scope cannot be an expression and must refer to the current scope or a containing scope.

Or  You can use simple syntax bellow

 = RowNumber(nothing) 


Hope it will help....


Happy DAXing :-)

More Info click here 

How to Export/Import Label files in AX [2012]

Hi guys,

Today in this session I am going to explain how to Import/Export labels in AX 2012.
Labels are pretty good to specify the user interface text for report and form. 
You can create Label from Label editor.
Open AOT  >  Tools > Label > Label editor
You view Label log from > AOT > Tools > Label > Label editor

Export label file-
Exporting Label file is very easy - Open AOT  > Label files  > Expand Label > select individual language.
Click on the "Export to the Label file" and provide the  path, Label file will export with the extension ".ald"





  

Import Label File -
Now we have to import Labels Open AOT > select Label File Node > Right click and click on "Create from Label" then browse earlier exported Label file with extension ".ald" and then click OK to Import Label file.






Note- If you want to update Label file follow same steps. 
but it will ask for Do you want to overwrite?
Hit enter.




It will update existing label file. 
And I hope it will helpful for you.......

More Info click here
Happy DAXing :-)

Monday, 9 November 2015

Send Workflow Notification / Popup / Alert using X++ [AX 2012]

Hi guys,

Recently I was a requirement to create customized Sales Order Discount Approval workflow. There is  a lot of scenario to mapping  the process.
In this session I am describing  how to send notification or alert to respective User Group / Users as bellow job 

// Send notification or Alert
static void SendAlert_Notication(Args _args)
{
    Dialog          dialog;
    DialogGroup     dialogGroup;
    DialogField     dialogfield;
    DialogBox       dialogBox;    
    
    EventInbox      EventInbox;
    UserGroupList   userGroupList;
    SalesLine       updateSalesLine;
    UserGroupId     groupId;     
    SalesLine       salesLine;
    ;    
    //Dialog call
    dialog= new dialog("Sales Price Discount Approval");
    dialogGroup= dialog.addGroup("Comment");
    dialogfield= dialog.addField(extendedTypeStr(Ale_Comment));
    if (dialog.run())
    dialogfield.value();
    

    while select userId from userGroupList
    where userGroupList.groupId == "Admin"
    {
        while select SysUserInfo order by SysUserInfo.Id where SysUserInfo.Id  == userGroupList.userId 
        {
            EventInbox.InboxId                      =   EventInbox::nextEventId();
            EventInbox.CompanyId                    =   SalesLine.dataAreaId;
            EventInbox.AlertTableId                 =   359;
            EventInbox.AlertCreatedDateTime         =   DateTimeUtil::utcNow();
            EventInbox.ParentTableId                =   359;
            EventInbox.IsRead                       =   NOYES::No;
            EventInbox.Subject                      =   "SalesOrder Discount Approval";
            EventInbox.AlertedFor                   =   dialogfield.value();
            EventInbox.UserId                       =   SysUserInfo.Id;
            EventInbox.ShowPopup                    =   NOYES::Yes;
            EventInbox.Visible                      =   NOYES::Yes;
            EventInbox.Message                      =   dialogfield.value();
        }
    }
    
}    

Hope it will help...


Happy DAXing :-)


Friday, 6 November 2015

Microsoft Dynamics AX 7 Development with Visual Studio

Hi guys,

Greetings!
Learn and explore AX 7 through this video....
I saw this video on you tube and thought to share with you. This video demonstrates how to use Visual Studio to create a Dynamics AX 7 Project and Add an EDT in AX without MorphX as we all know by now MorphX is taken out in AX 7.
Good video and thanks for sharing
https://www.youtube.com/watch?v=05KsvTcmySs&list=PLIh45kooHi8fcPZIAF8zosVaOGg0ll-D9&index=4

Happy DAXing :-)

Monday, 2 November 2015

Fetch Product Attribute value in [AX 2012]

Fetching Product Attribute value in Ax 2102 is little bit tricky.................
Recently I was a requirement in SSRS report to fetch Product Attribute value. Job seems very easy but after lot of trouble shooting, I explored that there is three major tables as bellow mentioned tables and job...

EcoResProductAttributeValue 
EcoResAttribute              
EcoResValue                   


static void ProductAttributevalue(Args _args)
{
EcoResProductAttributeValue ecoResProductAttributeValue;
AttributeValueText          attributeValueText;
InventTable                 inventTable;  
EcoResAttribute             ecoResAttribute;
EcoResValue                 ecoResValue;


while select crosscompany  InventTable where InventTable.itemid ==  'Item001'
{
    while select crosscompany Product,Attribute,Value from ecoResProductAttributeValue
        where ecoResProductAttributeValue.Product == InventTable.Product
    {
        select crosscompany RecId from ecoResAttribute
             where ecoResProductAttributeValue.Attribute == ecoResAttribute.RecId;

        select crosscompany ecoResValue
             where ecoResValue.RecId == ecoResProductAttributeValue.Value;
        info(strFmt("%1",ecoResValue.value()));
    }
}
}

hope it will help.........

Happy DAXing :-)

Sunday, 1 November 2015

Use of Crosscompany to get Data from other companies using X++ [AX 2012]

Hi,

Use of Crosscompany to get Data from other companies.
Today I am explaining how to use Crosscompany in your code.....

Example 1.
static void CrossCompany_example(Args _args)
{
InventTable inventTable;

While select crosscompany * from inventTable

{

info( inventTable.ItemId + " : " + inventTable.NameAlias + " : " + InventTable.dataAreaId);

}

}


Example 2.
static void CrossCompany_example(Args _args)
{
InventTable     inventTable;
container conCompanies = [ 'USRT', 'USSI' ]; // you can assign selected companies
str comp;
;

while select crossCompany : conCompanies * from inventTable
{
info( inventTable.ItemId + " : " + inventTable.NameAlias + " : " + InventTable.dataAreaId);
}

}

For more click  here

Happy DAXing :-)

Import General journal from excel in D365 F&O

 Hi Guys, Import General journal from excel in D365 F&O Code:  using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; u...