Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Validation based on legal entity

Posted on by 5,885

Hi all,

  • Can you please let me know how to put validation with legal entity? I tried with select statement with company info table.
  • Some fields need to hide and unhide based on legal entity.
  • Please let me know the best approach 
  • @rp@n Profile Picture
    @rp@n 5,885 on at
    RE: Validation based on legal entity

    thanks Sergei

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: Validation based on legal entity

    Hi @rp@n,

    The parameter approach will work in all cases.

    isLegalEntityInCountryRegion approach will not work if you have several legal entities for the same country, but you want to enable a feature only for one of these legal entities.

  • @rp@n Profile Picture
    @rp@n 5,885 on at
    RE: Validation based on legal entity

    thanks Sergei,

    finally one thing , as you said the below code is suitable for my scenario

    //Form init method

    #ISOCountryRegionCodes

    field.visible(!SysCountryRegionCode::isLegalEntityInCountryRegion([#isoJP]));

    kindly let me know in which scenario the above code or parameter form concept as dicussed will not work ?

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: Validation based on legal entity

    Hi @rp@n,

    Yes, it's a more flexible approach comparing to hardcoded country-region. In case if you want to activate these fields for Japan in the future you just go to parameter form and activate it (no further development).

  • @rp@n Profile Picture
    @rp@n 5,885 on at
    RE: Validation based on legal entity

    thanks sergei,

    i also like you suggestion, to add some parameters in Parameter form. So, based on the check yes or no we can put validation based on legal entity.

    can i do that also?

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: Validation based on legal entity

    Hi @rp@n,

    Yes, it will work in this case.

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: Validation based on legal entity

    Hi @rp@n,

    Ok , I see. Then I agree with Sergei.

    You can refer this:

    daxmusings.codecrib.com/.../creating-country-specific-features-in.html

  • @rp@n Profile Picture
    @rp@n 5,885 on at
    RE: Validation based on legal entity

    ok, thanks

    one more thing, kindly clarify me on this

    see i have 4 legal entities

    legal entity 1 country US

    legal entity 2 country China

    legal entity 3 country Germany

    legal entity 4 country Japan

    shall i use the above code for my requirements ?

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,083 on at
    RE: Validation based on legal entity

    Hi @rp@n,

    If it's related to country-specific functionality (Japan), I suggest to use SysCountryRegionCode::isLegalEntityInCountryRegion

    //Form init method
    
    #ISOCountryRegionCodes
    
    field.visible(!SysCountryRegionCode::isLegalEntityInCountryRegion([#isoJP]));

  • @rp@n Profile Picture
    @rp@n 5,885 on at
    RE: Validation based on legal entity

    hi Blue and Sergei,

    basically my requirement is like for example --

    module - Product information management

    form - Released products

    Note - Customer don't wants some customized fields in the form Released product.,those customized fields are used in other legal entities as well.

    like for other module also like AR,AP, Inventory etc...

    So, i wants to hide those ( customized fields) from particular form based on legal entity.

    for Japan legal entity - wants to hide those customized fields

    for other legal entities -  visible as it is.

    i hope it's clear now.

    kindly let me know the best approach please

    please give me more shed on this.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans