Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Validation based on legal entity

(0) ShareShare
ReportReport
Posted on by 18

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
    18 on at
    RE: Validation based on legal entity

    thanks Sergei

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,091 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
    18 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
    23,091 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
    18 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
    23,091 on at
    RE: Validation based on legal entity

    Hi @rp@n,

    Yes, it will work in this case.

  • Blue Wang Profile Picture
    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
    18 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
    23,091 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
    18 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,060 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,858 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans