Showing posts with label Country Region Code. Show all posts
Showing posts with label Country Region Code. Show all posts

Country region specific condition in AX 2012 / D365FO


Country region specific condition in AX 2012 / D365FO


There is two way to restrict your customization with the country region.


  1. Code Level Restriction 
  2. Elements Level Restriction

Code Level Restriction 

           Below is a code & Screenshot  sample to restrict


#ISOCountryRegionCodes

if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoPK]))
{


// TODO

}





Elements Level Restriction

       Below is the element property & Screenshot sample to restrict.

In this blog, we are using output menu items to implement country-specific restriction 

Select Menu Item properties and Enter Country Code in country region code Property.

Screenshot sample




Now Build Your D365 Model and verify... Your code will execute and the element will show only if your company address is set as PAKISTAN.

Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...