Tuesday, 9 June 2020


How to change color for all AX form in AX 2012


Class -> SysSetupFormRun - > run

Code :

public void run()
{
    super();
    
this.design().colorScheme(FormColorScheme::RGB);
this.design().backgroundColor(WinAPI::RGB2int(255, 108, 97));
  
}

output:


you can make combination of colors from w3schools website





Thank you.

Thursday, 31 October 2019

How to create new entity in D365.


How to create new entity in D365.

Although this is very easy.
List to do:
1.       New table.
2.       Make entity to this new table.
3.       Make new form with simple list pattern.
4.       Make new display menu and provide the link in front end
5.       Refresh the entity so that your new entity will show.
6.       Make excel with data which you want to import in new table, entity.
7.       Make connection with source to target.
After that you will be able to see your excel data into table and form.

Step1.


Step2. Add new item in project select data entity control. Select primary table


Step3.  Create form and give database name, as we do and create form.


Step4. Create display menu and provide you form in object. And give menu name in label.



Step5. Go to workshop -> select data management ->there is framework parameter -> select entity refresh -> (it will take some min time).

Then Go to workshop -> select data management ->data entity -> there you can find your entity.
Step 6.


Click on import option as given in above image.
There you will find : need to fill entity name;
Source format : excel (in my case).
And path of source file (excel file).
Step7. make mapping with excel column to entity column.

Finally you can see you data in you form.
Output:






Thanks
Akshay





Tuesday, 4 September 2018



Enable/Disable Button in listpage in D365



here i have added 4 button in salesQuotationlistpage.
now i need to enable/disable button according status. so i have Extensionof  of class
SalesQuotationListPageInteraction and modify setButtonEnabled mathod by Chain of Command







//list page button enable and diable in listpage interation class
[ExtensionOf(classStr(SalesQuotationListPageInteraction))]
final class SQTableinimathod_Extension
{
    protected void setButtonEnabled()
    {
      
        SalesQuotationTable SalesQuotationTable;
        CustQuotationJour   CustQuotationJour;
        CustQuotationConfirmJour  CustQuotationConfirmJour;
     


        next setButtonEnabled();
        SalesQuotationTable SalesQuotationTable1 = this.listPage().activeRecord(queryDataSourceStr(SalesQuotationListPage, SalesQuotationTable));
        select CustQuotationJour
            where CustQuotationJour.QuotationId == SalesQuotationTable1.QuotationId;
        if(CustQuotationJour)
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SalesQuotationListPage, Aks_QuotationJournals), true);
        }
        else
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SalesQuotationListPage, Aks_QuotationJournals), false);
        }

        if(SalesQuotationTable1.QuotationStatus == SalesQuotationStatus::Confirmed)
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SalesQuotationListPage, Aks_ConfirmationJournal), true);
        
           
        }
        else
        {
            this.listPage().actionPaneControlEnabled(formControlStr(SalesQuotationListPage, Aks_ConfirmationJournal), false);
          
        }
     

        
    }





Thanks
Akshay



    


Button Enable/Disable in D365



            There are 4 button added in sales table form
This will enable / disable according status.
Solution : sales table form-> event-> initialized (post event)->copy event handler
Create class


class Aks_ManuItemHide
{
   

  

   

  // button enable and disable in sales table form
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    [FormEventHandler(formStr(SalesTable), FormEventType::Initialized)]
    public static void SalesTable_OnInitialized(xFormRun sender, FormEventArgs e)
    {
        Common common1 = sender.args().record();
        SalesTable SalesTable;
        CustConfirmJour   CustConfirmJour;
        WMSPickingRoute    WMSPickingRoute;
        CustPackingSlipJour  CustPackingSlipJour;
        CustInvoiceJour     CustInvoiceJour;
           
        SalesTable = common1;
     
        FormControl    God_buttonJournalConfirmation           = sender.design(0).controlName("God_buttonJournalConfirmation");
        FormControl    God_buttonJournalPickingList            = sender.design(0).controlName("God_buttonJournalPickingList");
        FormControl    God_buttonJournalPackingSlip            = sender.design(0).controlName("God_buttonJournalPackingSlip");
        FormControl    God_buttonJournalInvoice                = sender.design(0).controlName("God_buttonJournalInvoice");
        select CustConfirmJour
            where CustConfirmJour.SalesId == SalesTable.SalesId;
        if(CustConfirmJour)
        {
            God_buttonJournalConfirmation.enabled(true);
        }
        else
        {
            God_buttonJournalConfirmation.enabled(false);
        }

        select WMSPickingRoute
            where WMSPickingRoute.transRefId == SalesTable.SalesId;
        if(WMSPickingRoute)
        {
            God_buttonJournalPickingList.enabled(true);
        }
        else
        {
            God_buttonJournalPickingList.enabled(false);
        }
        select CustPackingSlipJour
           where  CustPackingSlipJour.SalesId == SalesTable.SalesId;
        if(CustPackingSlipJour)
        {
            God_buttonJournalPackingSlip.enabled(true);
        }
        else
        {
            God_buttonJournalPackingSlip.enabled(false);
        }
        select CustInvoiceJour
            where CustInvoiceJour.SalesId == SalesTable.SalesId;
        if(CustInvoiceJour)
        {
            God_buttonJournalInvoice.enabled(true);
        }
        else
        {
            God_buttonJournalInvoice.enabled(false);
        }


    }

}





Thanks
Akshay