Showing posts with label D365OPS. Show all posts
Showing posts with label D365OPS. Show all posts

Wednesday, November 23, 2022

D365 FO Finance and Operations : AOT Browser

 

 In Dynamics 365 Finance and Operations the AOT is not accessible from the user interface

It is only available in a development box using Visual Studio



In Dynamics AX 2012 and earlier it was possible for power users to be able to open and browse the contents of the AOT (Application Object Tree) from the UI. This functionality was removed in Dynamics 365 for Finance and Operations as all development is now done in Visual Studio. This means that in order to browse the contents of the AOT, one now needs access to a development environment with Visual Studio.

AOT Browser to save the day! With the AOT Browser it is now possible to browse the objects in the AOT from the D365FO web interface.  Arbela Technologies , who is one of the top Microsoft partners, has developed an enhancement that has basically replicated the old AOT user experience right in the Dynamics 365 Finance and Operations application. Arbela is giving this out for free on GitHub which is so awesome!

How To Get The AOT Browser

The AOT Browser is available for free on GitHub here.   Click on the “Releases” link.


After you have deployed the AOT Browser you will need to run the “Populate AOT objects” job. This job will populate the list of objects in the AOT. 

To check how to D365 F&O Install a deployable packagefrom command line / Apply the latest platform update to environments

It is recommended to run this as a recurring batch job because the initial run may take a few minutes and you will want to keep the AOT up to date for any modifications you make to Dynamics 365 Finance and Operations.

To do this Navigate to the AOT Browser workspace on the homepage.


From here click the “Populate AOT objects”.

Open Table Browser

1. Select the table or view you wish to browse the data for and select “Open table browser”



View Source Code

At the top of the AOT Browser form is a toggle button enabling the ability to view the source code. Enabling this button is only supported in environments that contain source code, such as Development or Demo OneBoxes.

Enabled

Disabled




View Extensions Inline

At the top of the AOT browser form is a toggle button to turn on or off the ability to view the extensions inline in the tree. The setting will be remembered in the user’s usage data once the form is closed.

When enabled, extensions will be shown in the tree where they belong. They are bolded and have the name of the extension they belong to in parenthesis after the name.

Viewing extensions as separate node

When the toggle is disabled, the extensions show up as a separate node at the bottom of the tree.














Search/Filter




Search by object name or label

Search both by the AOT node name





Search by the object label property





Filter by object type


 



Open from Form Personalization

1. Open the form in the web UI that you would like to browse



2. Right click on any element of the form and select form information



3. Click on the form name


4. At the bottom of the dialog click “Open in AOT browser”



5. The AOT browser will open for the form and select the control that was right-clicked in the calling form



Open from Data Entities Form

1. Navigate to System Administration > Workspaces > Data management





3. Select the entity you want to browse and click “Open in AOT browser” at the top



4. The AOT Browser will open and display the data entity




Ref1  arbelatech
Ref2 dynamics-tips.com




Sunday, November 20, 2022

D365 F&O Go to Main table EDT Relations / FormRef / JumpRef() method

 

 

There is 3 way to achieve GotoMaintable concept in D365

1.     EDT Relations

If you use an EDT in tables which have relation with some other table fileds, that time you can able to navigate the main table or main form.

For example, the CustAccount EDT

Expand the ‘Table Relations‘ node for EDT. The properties that the Table property is set to ‘CustTable‘.






2.     FormRef property in Table

FormRef Property:

Select the Table and go to properties and select the required form in the FormRef property.



3.     using JumpRef method

 

JumpRef method:

If you are not having that option, simply write a override the JumpRef method in a field of DataSource or in a Form Control. Here i show you a sample jumpRef method code:

 

In the name itself u can understand that “jumRef” means to “Jumping to the referenced table” of the particular id.

the below is code to jump to referenced purchase order when click purch id.

public void jumpRef()

{

PurchTable purch;

Args args;

MenuFunction menuFunction;

Common rec;

;

rec=PurchTable::find(this.valueStr());

args = new Args();

//args.lookupRecord (PurchTable::find(this.valueStr()));

args.record(rec);

args.caller(element);

// Create a new MenuFunction that launches the Reasons Menu Item

menuFunction = new MenuFunction(menuitemdisplaystr(PurchTable),MenuItemType::Display);

menuFunction.run(args);

}

 

Another Example Ref 

To see the overridden D365 JumpRef method, first search for SalesTable in the Application Explorer, in Visual Studio. Right click on the SalesTable form, and select ‘open designer‘.

To better understand, let us start with an example. In D365, navigate to Accounts Receivable>Orders>All sales orders. Next, click on a sales ID to go into the sales order details form. Then, select or a create a sales line. Expand the Line details fast tab. Finally, click on Delivery tab. Locate the field ‘Shipping carrier’.



This form control has an overridden D365 jumpRef method. When this field is populated, the value is blue, and can be clicked on. Or, the user can right click on the field and select ‘View details’.



This takes the user to the Shipping carriers form.



Now that you have seen the functionality from the from end form, let us look at the code in Visual Studio.

Overriding The JumpRef Method

To see the overridden D365 JumpRef method, first search for SalesTable in the Application Explorer, in Visual Studio. Right click on the SalesTable form, and select ‘open designer‘.



Next, we need to locate the ‘Shipping carrier’ form control in the form. The easiest way to do this is right-click on the control’s label in the browser. A pop-up will show us the name of the control. In this example, we can see that it is named ‘TMSCarrierInfo_CarrierCode‘.



Now that we know the name of the control, go back to Visual Studio, and enter the control name into the top bar of the form designer. Then, push Enter. The system will change the Design window to only show the form control, and its parent nodes.

 


 

Now that we have located the control in the form, expand the control node, and Methods node. Notice, the D365 jumpRef method is shown.


This means that the jumpRef method has been overridden. When it is not shown, the functionality is still there. It just means that the method will work in its default way.

Next, double click on the jumpRef method node to open up this method in a code editor.

 


To continue with our example, right-click on the method that is called within the overridden jumpRef method. Then, select ‘Go to definition‘. This will take you to the code where this method is defined. Also notice, that the code ‘this.valueStr()’ takes the current value in this form control, and passes it to the calling method.


To explain, the code instantiates a class named ‘Args’. This is a generic class that will be used to pass a record to the calling form, so that the calling form can filter on it.

First, the code uses the passed in _carrierCode variable to find a record in the TMSCarrier table.

Secondly, the code calls the ‘record‘ and ‘lookupRecord‘ methods on the Args class, passing in the TMSCarrier table buffer variable. If the record passed in is the same table as the main data source on the calling form, then the system will automatically filter the data source to that record. Very cool!

Thirdly, the code instantiates the MenuFunction class, and passes in the name of the Menu Item to call. In this example, there exists a display menu item name TMSCarrier.

Finally, the code calls the ‘run’ method on the MenuFunction class, and passes the args variable as a parameter. This tells the system to run the form connected to that Menu Item. Again, by passing in the args variable with the ‘record’ set, the calling form will be filtered to that record, as long as the data source and the record use the same table.

 

 

Why Override The JumpRef?

Now, you may be asking yourself: Why override the D365 JumpRef method? Why not use table relations? A developer should be using table relations when possible. However, there are a few scenarios where this may not be possible or work the way the developer needs it to.

No Table Relation Setup

First, in the above example, there is no relation on the SalesTable table between it and the TMSCarrier table. And therefore, the default functionality would be to now allow the user to click ‘View details’ on this field. Sometimes, adding a table relation can cause problems. However, if the ‘view details’ functionality is still desired, a developer can override the jumpRef method to make this functionality work.

There Is No Related Form

Secondly, there are times when a table relation exists, but there is no related form. In this scenario, clicking ‘view details’ would not do anything. So the jumpRef needs to be disabled to make sure the system does not try to navigate to a form that does not exist.

 Ref 

Tuesday, November 15, 2022

Download attachment of record on focus of a field D365 FO

 Download the attachment of record on focus of a field D365 FO

class DapApplicantEventViewer

{    

[FormControlEventHandler(formControlStr(HRMApplication, AttachmentLink), FormControlEventType::GotFocus)]

    public static void AttachmentLink_OnGotFocus(FormControl sender, FormControlEventArgs e)

    {

        FormDataSource FormDatasource;

        DocuRef          docuRef;

        HRMApplication   hRMApplication;

       MenuFunction     menuFunction;

        HcmApplicant HcmApplicantLocal;

        Args             argsMenu= new Args();


        FormRun form = sender.formRun();


        FormDatasource  =       form.dataSource(formDataSourceStr(HRMApplication,HRMApplication)) as FormDataSource;


        hRMApplication                   = FormDatasource.cursor();

        select RecId,TableId from HcmApplicantLocal

            where HcmApplicantLocal.Recid == hRMApplication.Applicant;


        select docuref

                where docuref.RefRecId == HcmApplicantLocal.recid

            &&    docuref.RefTableId  == HcmApplicantLocal.Tableid;


        argsMenu.record(docuRef);

        argsMenu.parmEnumType(enumNum(DocuCode));

        argsMenu.parmEnum(DocuCode::Open);

        URL displayUrl = DocumentManagement::getAttachmentPublicUrl(docuref);

        //Info(strFmt("%1", displayUrl));

        menuFunction = new MenuFunction(menuItemActionStr(DocuActionOpen),MenuItemType::Action);

       menuFunction.run(argsMenu);  

    }

}

Saturday, October 22, 2022

D365 find Invent On Hand Value with X++

 D365 How to find Invent On Hand Value with X++ ?


To show on hand through D365 you can use On-hand list form from Inventory management >> Inquiries and Reports >> On-hand list



You can use Filter for your Item , and show Dimensions for more details 


Here You can check available Physical inventory qty, Available physical qty, Physical reserved qty ,Available physical on exact dimensions qty and Ordered in total qty



To get On-hand for item please find below the X++ code 
you can change parameters based on your business need 




 InventOnhand _InventOnhand;
        InventDimParm _InventDimParm;
        InventDim _InventDim;
        ItemId  itemid = "1030249-0174";

        _InventDim = null;
        _InventDim.InventSiteId  = "Main";
        _InventDim.InventLocationId = "X1";
        _InventDim.wMSLocationId = "ONM-ABQ-01";

        _InventDimParm.initFromInventDim(_InventDim);
        _InventOnhand = InventOnhand::newParameters(itemid , _InventDim , _InventDimParm);
        Info(strFmt("%1 , %2 , %3 , %4 : %5 " , 
            itemid ,  _InventDim.InventSiteId ,  _InventDim.InventLocationId , _InventDim.wMSLocationId
            , _InventOnhand.availPhysical()));



please find below the calculation for  _InventOnhand.availPhysical() 






































Sunday, August 28, 2022

How to get calling menu name in extensions Dynamics 365 for finance and operations

 Today is small tip, Many times, we have to took decision based on the name of menu  on which form is called. By getting menu name we can use same form for different purposes.  We can write logic based on current form called from which menu item.

Following is the code snippet helps you to achieve this.

[FormEventHandler(formStr(LogisticsContactInfoGrid), FormEventType::Initialized)]
    public static void LogisticsContactInfoGrid_OnInitialized(xFormRun sender, FormEventArgs e)
    {
        FormRun formRun = sender;
        
        if (formRun.args().menuItemName() == "CustomerLogisticsContactInfoGrid")
        {
            FormDataSource      LogisticsElectronicAddress_ds =formRun.dataSource("LogisticsElectronicAddress");
            LogisticsElectronicAddress_ds.InsertIfEmpty(true);
            LogisticsElectronicAddress_ds.object(fieldNum(LogisticsElectronicAddress, Locator)).mandatory(true);
        }
}
Ref

Tuesday, July 5, 2022

D365 How to configure 10.0.24 VM - Error Admin Provisioning Tool Error: The value’s length for key ‘password’ exceeds it’s limit of ‘128’

 

Admin Provisioning Tool Error: The value’s length for key ‘password’ exceeds it’s limit of ‘128’



Most of the time, I usually run Dynamics 365 Finance and Operations vm on my personal Laptop for R&D purposes.

But after downloading latest 10.0.24 vm from LCS. I am unable to run , admin User Provisioning tool. I got following error.

The value’s length for key ‘password’ exceeds it’s limit of ‘128’.

Later on LinkedIn Microsoft Employee Volker Deuss shared a link which helps me resolve this issue. Here are my notes.

Now Microsoft requires you to create one web application register in Azure portal.

And before your provide your user as provision as admin, you have to perform one more step.

Generate Self-Signed Certificates and here we use this application id. It configure some certificates.

And interestingly your own azure portal without tenant is not work. You have to create web application. in your tenant azure subscription. It will not work like my personal email. even I purchase azure subscription on my personal Id xxxxx@live.com    And web application register there is not work.

So here are some steps to create register application in following steps.

open your azure subscription. and type in search box on top register app

Click on new registration.

Enter the name

Enter local Dynamics url. We used this link inside the Vm.

Also select web in first drop down. Here we need to create a web

Enter name and in

add one more redirect.

Click on Redirect URIs and add one more.

Save it a

Now copy the application id created and go to Dynamics vm

and now go to Dynamics VM. and right click on Generate Self Signed Certificates.

Next step Press N. and let it process , it will restart the services, Batch job. When this job is completed. You can register same domain id as admin Provision

And my id is become successful admin

And successful, run Ax 10.0.24 on my local laptop.



Reference