Showing posts with label Dynamics 365 Finance & Operation. Show all posts
Showing posts with label Dynamics 365 Finance & Operation. Show all posts

Monday, March 30, 2020

AX 2012 Roles Associated with current user Using X++

In this blog post we will will find the Security Role assigning to the particular user using X++ in AX 2012.

SecurityRole        role;
SecurityUserRole    userRole;
UserInfo            userinfo;

While select role
    exists join userRole
 where role.RecId == userRole.SecurityRole
  && userRole.User == curUserId()
    {
        info(role.Name );
       
    }


Wednesday, March 18, 2020

add address tab on custom form D365FO

In this post we see how to add address tab on custom form dynamics 365 finance and operation. The scenario was to add the tab on custom form same like as on customer or vendor form.

For this scenario we will look how to add the address tab.

Step 1: Create new table or add the DirPartyRecid on your table and make the relationship with DirPartyTable


















Step 2: Create new form or add MainTable and DirPartTable in form datasource




















Step 3: Set the properties on DirPartyTable datasource













Step 4: Add tab page on form and add form part control in it











Step 5: Set the properties on the form part control in the Menu Item Name set (LogisticsPostalAddressGridFormPart)



















Step 6: Add link and set the properties on it.







Step 7: See the results as shown below























Sunday, March 8, 2020

Filter LocationID lookup by name D365FO

We will see how to filter location id by name.
Add new string in table and set any name is my case name is (InventLocation) as shown in image below




Create a new relation with InventLocation Table and set the relation properties.
























Create a new form for lookup set the design pattern Lookup - Basic. In data source add the IventLocation table.
Add grid in the form and add fields.












Override the form run method and write the code in it













Now add the field in original form to show the lookup. Override Lookup and resolveAmbiguousReference method on string control (A_Student_InventLocation)










Now write the code in lookup and resolveAmbiguousReference  method

Lookup Method














resolveAmbiguousReference  Method









After this build and sync the project and you will get appropriate result as shown below.
















For more information please see the following link
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/contextual-data-entry-lookups

Tuesday, March 3, 2020

Filter lookup By Name D365 Finance and Operation

Today, we will see how to filter record based on the name or description. By default this functionality is not enable on lookup. 
See the image below that is my default lookup.














When we write in the box student id, it automatically filter the record that the default behavior of any lookup. See the below Image.













But when we search from Name It shows nothing
To search with name we will set the Cache Lookup property on the Header table .



















Now, we are able to filter the lookup by name.













For more information please see the following link.