web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

(0) ShareShare
ReportReport
Posted on by 903

Hello,

Recently, I have installed the "Customer Self Service Portal".

I have added in the "Case" entity a Country field (Option Set) which contains a list of countries, and I have created another Country field (Option set) in the "Account entity".
CaseCountry.PNGAccountCountry.PNG

What I want to achieve is the following:

When I open a new case with a current user, the customer and contact field by default are auto-populated for this user.
0451.Demo.gif

Therefore,I want to implement the same process to auto-populate the country value from the "Account" entity for this current signed-in user and make this field as "Read-only or (disabled)".

As a result, when I click on "Open a new case" the country field will be filled for the users so they don't have to choose the country from the drop-down.

Can someone please explain in detail and provide an example to achieve the following scenario?

Any help would be greatly appreciated.
Thank you!

I have the same question (0)
  • Suggested answer
    Charles Abi Khirs Profile Picture
    3,569 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hello,

    If you want to autopopulate fields in Portal and to be reflected in the CRM, you can use the EntityForm metadata.

    For more details about the entityform metadata, you can check the below links:

    nishantrana.me/.../

    www.linkedin.com/.../entity-forms-form-metadata-dynamics-portal-jatin-nagpal

  • EBMRay Profile Picture
    903 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal
    Hello Paul Owen,

    No, it's not a global option set.
    I've thought about the mapping between the fields but doesn't work with my requirements.

    Because before creating a case and on-page form load, I want to display for the "Contact" person his related country value that is assigned on the "Contact" entity. So not after they submit the case.
    According to my last post, I have achieved this for the account entity. I am still looking to achieve the same process for the contact entity by getting the contactid assigned when the form is loaded to populate its related country value.

    Any suggestions?

    Looking forward to your response.
    Thanks
  • Suggested answer
    Paul_Owen Profile Picture
    2,027 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Is it a global optionset? If so you can just map the field from the account on create of case.

    Regards

    Paul

  • EBMRay Profile Picture
    903 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hello Marco.P,

    I apologize for the late response!
    I want to admit that I did not create a workflow.

    I have found another workaround using Liquid expressions inside the form to get the "Country" value of the current "Account". I am still stuck to implement the same process using the liquid expressions for the current "Contact".

    Regarding the "Account" have a look below how I have achieved.

    {% assign account = entities.account[{{user.parentcustomerid.id}}] %}

    window.onload = function(){ document.getElementById("new_country").value = document.getElementById("optionSetValues").innerHTML; document.getElementById("optionSetValues").style.display = "none"; }


    I want to implement the same for the contact. Do you have any idea how to achieve it?

    Looking forward to your response.
    Thank you.
  • Marco.P Profile Picture
    2,405 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hi EBMRay,

    any news? Did you resolve your issue?

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hi @EBMRay,

    you can't find Customer (Account) from the dropdown list of your calculated field because of its relationship with case entity (parental).

    To close the deal quickly you can:

    • swap the accounts field in form

    OR

    •  create a business rule or a workflow that checks if  Customer (Account) contains data and then filled in Partner(account) with the value in  Customer (Account). 

    Now the choice it's up to you and your business requirment (:

    Keep me posted!

    Marco

  • EBMRay Profile Picture
    903 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hello Marco.P,

    Thanks for your reply.

    I didn't create a referential relationship between case and account entity, because by default there is N:1 Relation between Case and accounts.

    N-To-1.PNG

    Should I create a 1:N relationship between account and case? If yes, in the blog you share it they mention that "Calculated fields can only use N:1 lookup fields. We cannot use N: N or 1:N relationship for Calculated fields."

    Besides, I have figured out that I am using the wrong field which is Partner (Account) since it should be Customer (Account) because it's based on this field.

    CapturePartner.PNG

    Unfortunately, I couldn't find the Customer (Account) in the If condition inside the entity drop down. Knowing that this relationship already exists between Account (Customer) and Case entity.

    Please have a look at the screenshot below:

    7024.CountryOfAccountCase.PNG

    We are very close to a happy ending but now the issue is that I cannot find the Customer (Account) entity from the dropdown.

    Looking forward to your response.

    Best regards,
    EBMRay

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hi EBMRay,

    i did the same thing you posted in my environment, and guess what? It all works, so i can only guess what's wrong on your side.

    I think you created a new referencial 1-M relationship between case and account entity, so now you have two lookup fields pointed to account Entity and you are populating with data the wrong field.

    On case's form editor, look for the Partner field and place it in the form. Then try to populate that field with Julien Anid and let me know if it works!

    pastedimage1584047992030v1.png

    Keep me posted!

    Marco

  • EBMRay Profile Picture
    903 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hello Marco.P,

    Thanks for the steps you mentioned.
    I have only 3 countries.

    This is the calculated field details screenshot:
    CountryOfAccountCase.PNG
    This is the country field details screenshot from Option Sets:

    CaptureAccountCount.PNG

    I have followed what you mentioned step by step, and I have implemented the same for other countries.
    Please have a look at screenshots below: (Partner) means Account entity in Cases

    CalculatedCountryImplementatin.PNG

    While creating the Case from the portal and after I have submitted the case and I get back to Cases entity to check if the Calculated Country contains a value, unfortunately, the calculated country field not filled with the country value that this account has.

    Knowing that this account already has a country value:
    762013.Capture.PNG14748.Capture2.PNG

    What I am doing wrong?

    Looking forward to your response.
    Thank you.

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at
    RE: Auto-Populate a field between Accounts and Case entities in Customer Self Service Portal

    Hi EBMRay,

    good to hear from you!

    Since you already created a calculated fields, forget about the workflow!

    You can achieve your goal just by making some change to your formula:

    STEPS:

    •  create a calculated field on case entity ( you've  already done that!)
    • check in the condition the of account's Country field:

      Example -  if  Entity:Account(account) field: country value equals: Lebanon

    •  Action: set value

    Example - Field: Country   Value : Lebanon

    • Do this for every country optionset values you have ( I hope they're not so many!)

    For the next time if you want to use a workflow:

    •  Go to process and choose new blank workflow process
    • set the work flow real time
    • make it trigger on "Update of a field" and choose the field (in this scenario you would've choose case's Customer.
    • set condition and action with same logic we use for the calculeted field

    I don't have currently with me my laptop, otherwise i would have post some screenshots, i hope this will be enough for you:)

    Let me know if you need anything else, and please don't forget to mark as verified the answers useful for you!

    Marco 

                     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 147

#2
DAnny3211 Profile Picture

DAnny3211 134

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans