Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Verifying field against another field in another entity

Posted on by 790

Dear all

i do have a custom entity in which one of its field (normal field ,not Name or any primary field) needs to be verified against a value from another field on another entity.

something similar to the lookup field, but i need the lookup value is not the primary key of the other entity, it is just a normal field. how to do this?

thanks,

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Verifying field against another field in another entity

    Hi Ahmad ,

    You can do using  real time workflow if there is any relationship  between two entity. For example you have two entity called Category and SubCategory. Both entities having custom field called "categoryname" and "subcategroyname".Lets assume both entity have a relationship between category and subcategory 1: N , where in subcategory end you have a category lookup. Now you want to restrict create new subcategory with "subcategroyname" which matches with "categoryname ". For this scenario you can validate and show error message without any code , using OOB workflow.

    Here is the real time  workflow I have created on create and field change event of the subcategory entity.

    2019_2D00_01_2D00_22_5F00_12_2D00_24_2D00_29_5F00_Validate.png

    In the check condition I choose where subcategoryname equals under category lookup find the categoryname.

    2019_2D00_01_2D00_22_5F00_12_2D00_24_2D00_29_5F00_Condition.png

    Then I choose the field name categoryname as value 

    2019_2D00_01_2D00_22_5F00_12_2D00_24_2D00_29_5F00_selectcategorynaem.png

    Here is the result .

    2019_2D00_01_2D00_22_5F00_12_2D00_24_2D00_29_5F00_Validate.png

    Hope this helps.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Verifying field against another field in another entity

    Hi partner,

    As I known, we could customize the columns of look up view as we need, so that we could see all fields that we want in custom lookup view not just the Name filed.

    community111.png

    According to your question, I wonder if you mean you want to search in lookup view with other fields like Tel, address...?

    If so, we could open the entity's Quick find view and Add find columns.

    For example, I want to search main phone in account lookup filed, I should do the following steps.

    community109.png

    community110.png

    community111.png

    If that's not what you mean, please kindly share more information.

    Hope it helps.

    Best Regards

    Leo

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: Verifying field against another field in another entity

    Actually, let me put my question differently, HOW i can make a lookup view on a different field other than NAME field? is this possible?

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: Verifying field against another field in another entity

    please check the attached hand drawing to explain.

    i need to verify the field on leaving the field (after filling the text) or on save.

    IMG_5F00_20190121_5F00_142337.jpg

    thanks

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: Verifying field against another field in another entity

    Hi Goutam

    i need to the the validation on saving , better on leaving the textbox itself before even saving.

    is there anyway to do it without writting a plugin?

    thanks,

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Verifying field against another field in another entity

    Hi partner,

    Sorry for my carelessness.

    What are the two fields' types? Lookup, option set or others?

    Could you kindly share your complete requirement so that we could help you better?

    Best Regards

    Leo

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Verifying field against another field in another entity

    Hi Ahmad ,

    When you want to verify another entity fields is it onchange or onsave ?

    If its onchange then use CRMRestbuilder to retrieve the value based on selected field and set form notification in the UI.

    If you need to validate onsave you can write simple plugin to validate the field value.

  • Ahmad Saud Profile Picture
    Ahmad Saud 790 on at
    RE: Verifying field against another field in another entity

    thanks, but the field i need to check against is in another entity. please double check.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Verifying field against another field in another entity

    Hi partner,

    You could try Business Rule.

    Open the entity form editor and click "Business Rule".

    Create a new one.

    community108.png

    community108.png

    You could add conditions and actions with your needs like if xxxx then xxxx

    For example, if accountname="michale", then phonenumber="123456".

    Refer to the following link for more detail.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/create-business-rules-recommendations-apply-logic-form

    Hope it helps.

    Best Regards

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans