Announcements
Hi all,
I have a requirement in which there are two Case forms Case1 and Case2 and there are 2 contacts and these belongs to 2 different companies. I have to display Case1 form whenever contact1 is logged in into the customer portal and similarly for Case2.
I have created 2 separate web pages and assign these 2 Case forms to it. Also Created 2 Web roles wb1 and wb2 and assign it to both the contacts.I have also created 2 Web access roles and assign it to the both web pages.There is a button which creates Case record. Now, the question arises how can we integrate these 2 web pages with this button.
I need help to display web pages based on logged in contact user.
Hi Anant,
You will have to use liquid code or JavaScript to achieve this by editing the web page templates or placing the JavaScript on the webpage that is used to expose the Case create entity form.
You can use the user object to validate the current logged in user webrole
Example : {% if user.roles contains 'wb1'%}
Best Regards,
Harish M
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums
Hi,
I have created a web template and written down following script to be used on web page.
<!DOCTYPE html>
<html>
<body onload="myFunction()">
<script>
function myFunction() {
var role = "{{user.role}}";
if(role.includes("wb1"))
$('#case1').show();
else
$('#case2').show();
}
</script>
<div id="case1" style="margin-top:10px;width:100%; display:none">
{% entityform name: 'Customer Service - Create Case' %}
</div>
<div id="case2" style="margin-top:10px;width:100%;display:none">
{% entityform name: 'Customer Service - Create Case1' %}
</body>
</html>
But, showing following error on portal:
Test B (Text Field): An entry with the same key already exists.
I would recommend you to open a ticket with Microsoft Support for this. As this needs to be investigated.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Muhammad Shahzad Sh... 54 Most Valuable Professional
11manish 21
AT-28040446-0 13