Tuesday, 19 January 2016

Add Sales Category/Procurement Category field on customized form in AX 2012

Hi guys,

After very long time today i'm writing a new post [AX 2012] 

I had a requirement to customized Sales Category/Procurement category on a new form it is not direct field to add on form. It was little bit tricky. 

I am showing the steps to do this.

Steps 1.
You need to add a int64 field on table and use edt as "SalesCategory".



Now go to the Properties of the SalesCategory field and set edt as salesCatefory. 



Step 2. Go to the form refresh and restore it to reflect the newly created field then expand datasource  and  go to the salesCategory field and add bellow highlighted methods in the snaps.




Paste these methods  into the datasource > field > method.

resolveRefrence

public Common resolveReference(FormReferenceControl _formReferenceControl)
{
    return EcoResCategory::resolveCategoryHierarchyRole(
        _formReferenceControl,
        EcoResCategoryNamedHierarchyRole::Sales);
}

lookupReference method 

public Common lookupReference(FormReferenceControl _formReferenceControl)
{
    return EcoResCategory::lookupCategoryHierarchyRole(
        _formReferenceControl,
        EcoResCategoryNamedHierarchyRole::Sales);
}


Steps 3. Add RefrenceGroup field into the Grid as bellow shown in the snaps. 



Step 4.
Reference field properties set dataSource and Reference field as "salescategory". 
Save  and compile objects.




Step 5. Now you are able to see the sales Category filed on Customized form.



Hope it will help.

Happy DAXing :-)













Sunday, 6 December 2015

Uninstall a model through Windows PowerShell

Hi guys,

A little demonstration on how to Uninstall Model in AX 2012

Steps -

1. Go to the  Start menu > All programs >  Administrative Tolls
2. At windows Powershell command prompt  > PS C:\>
3. Type the follwing command and press enter.

          Uninstall-AXModel -Model <ModelName>

This above command will uninstall specified Model and Confirmation request/Message will will be displayed on the screen.


For Information - click here


Happy DAXing :-)

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 :-)

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...