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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal custom error me...
Power Pages
Answered

Portal custom error message with plugin not working

(0) ShareShare
ReportReport
Posted on by 48

Hello, I'm trying to prevent duplicates from being created by external users in the portal. The field in question is on the first step of an advanced/web form. When I enter a duplicate in the field and submit the form, it gives me the ugly technical error and not the plugin error.

 

The plugin works in the model driven app as expected. I had custom errors disabled at first, but turned them back on - either way I'm getting the standard error screen. I did add the site setting: Site/EnableCustomPluginError and set it to True since it was no there.  I also set this field to be an alternate key. I'm not a pro dev, so could it be that what I'm doing with the plugin doesn't matter because the error is related to the alternate key instead?

 

 

Categories:
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi, can you share a snapshot of your error page?

     

    Are you getting:

    OliverRodrigues_0-1627412905333.png

     

    or the generic red box with the error message, but still with the portal layout itself? 

     

    have you cleared the cache? 

  • JEM123 Profile Picture
    48 on at

    Well, I reworked the whole form to go down another route with JavaScript, but I'm still curious in case it comes back up. 

     

    If I turn custom errors off:

     Stack Trace:

    [ApplicationException: adx_webformsession.adx_currentwebformstep is null.]
     Adxstudio.Xrm.Web.UI.WebForms.CrmSessionHistoryProvider.GetSessionHistory(Entity webFormSession) in S:\Framework\Adxstudio.Xrm\Web\UI\WebForms\CrmSessionHistoryProvider.cs:440
     Adxstudio.Xrm.Web.UI.WebForms.CrmSessionHistoryProvider.GetSessionHistoryByContact(OrganizationServiceContext context, Guid webFormId, Guid contactId) in S:\Framework\Adxstudio.Xrm\Web\UI\WebForms\CrmSessionHistoryProvider.cs:192
     Adxstudio.Xrm.Web.UI.WebControls.WebForm.TryFindExistingRecordForCurrentPortalUser(OrganizationServiceContext context, Entity step, Entity& existingRecord) in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:2308
     Adxstudio.Xrm.Web.UI.WebControls.WebForm.TryGetPrimaryEntitySourceDefinition(OrganizationServiceContext context, Entity step, WebFormEntitySourceDefinition& definition, Entity& record) in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:1951
     Adxstudio.Xrm.Web.UI.WebControls.WebForm.CreateChildControls() in S:\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:823
     System.Web.UI.Control.EnsureChildControls() +107
     System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +47
     System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +330
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1688

    JEM123_1-1627493881352.png

     

    Custom errors on:

    JEM123_0-1627492960875.png
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi, I have the feeling the issue you are facing is not related to the alternate key / custom plugin for duplicated detection

     

    I believe you are getting an error because there is something misconfigured with your Web Form.. can you create a simple Entity Form just to test to check if the record gets created?

     

    Finally.. if that works fine.. can you share a few snapshots of the configuration of your Web Form + Web Form Steps?

  • Verified answer
    JEM123 Profile Picture
    48 on at

    I finally got back to this. I deleted the alternate key, then tried the form and the plugin worked this time. Gave me the error I was looking for and stopped the form from being submitted. This is the only change I made between the last time and now. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 18

#2
11manish Profile Picture

11manish 14 Super User 2026 Season 2

#3
SP2019admin Profile Picture

SP2019admin 4

Last 30 days Overall leaderboard