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 / Error / bug affecting ...
Power Pages
Suggested Answer

Error / bug affecting Multistep forms in Power Pages

(1) ShareShare
ReportReport
Posted on by 4
Hi,

My team is working on a power pages site, containing a fairly long multistep form, saving data into Dynamics 365 custom tables.

As we have been working and editing different steps and conrresponding forms in D365, something has affected the Power Pages site global settings, as ALL multistep forms return 500 errors.

We have tested by editing steps, settings, creating new MS forms, with and without authentication / permissions, updating data in other tables in Dynamics. All forms return an error on moving from Step 1 to step 2 or submitting step 1 for single-step forms. The errors we can see are essentially similar to:

Object reference not set to an instance of an object.
System.NullReferenceException
   at Adxstudio.Xrm.Web.UI.WebControls.WebForm.<>c__DisplayClass211_0.<SetAttributeValuesOnSave>b__0(Entity en) in C:\__w\1\s\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:line 5514
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source) ...


occasionally we have seen this error in diagnostic logs too - for one-step multi-step forms:

Unable to cast object of type 'System.String' to type 'Microsoft.Xrm.Sdk.EntityReference'.
System.InvalidCastException
   at Microsoft.Xrm.Sdk.Entity.GetAttributeValue[T](String attributeLogicalName)
   at Adxstudio.Xrm.Web.UI.WebControls.WebForm.<>c__DisplayClass142_0.<CreateChildControls>b__2(Entity e) in C:\__w\1\s\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:line 791
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Adxstudio.Xrm.Web.UI.WebControls.WebForm.CreateChildControls() in C:\__w\1\s\Framework\Adxstudio.Xrm\Web\UI\WebControls\WebForm.cs:line 790
The only solution we could find to this was to create a new Power Pages site, copy settings, etc, and start from scratch with the forms.

Does anyone has experience this type of errors or point us to any online resource? Any suggestions would be greatly appreciated! Thank you!
Categories:
I have the same question (0)
  • Suggested answer
    sannavajjala87 Profile Picture
    728 Super User 2026 Season 1 on at
    Hi,
     
    Based on the stack traces, this doesn't look like a permissions issue or a problem with the multistep form framework itself. The two exceptions point more toward a schema or metadata mismatch between the Power Pages form configuration and the underlying Dataverse tables.
    The System.NullReferenceException in SetAttributeValuesOnSave often occurs when a form step references a field, relationship, metadata record, or configuration that no longer exists or has become invalid. The Unable to cast object of type 'System.String' to type 'Microsoft.Xrm.Sdk.EntityReference' error is particularly interesting because it suggests that Power Pages expects a lookup (EntityReference) but is receiving text data instead. This can happen if a column type was changed, a lookup field was replaced, metadata was modified, or a form step is mapped to the wrong field.
    Since all multistep forms started failing at roughly the same time, I'd focus on recent changes to:
    • Table relationships and lookup columns
    • Metadata records associated with Basic Forms/Multistep Forms
    • Form metadata that sets default values or updates related records
    • Web Form Steps and their source Model-Driven forms
    • Any custom business logic (plugins, workflows, JavaScript) that runs during create/update operations
    A good troubleshooting approach is to compare the failing site with the newly created site that works. Pay particular attention to Web Form Metadata records, Entity Form metadata, and any lookup fields used between Step 1 and Step 2. Also check whether any lookup columns were recently converted to text fields or vice versa.
    The fact that recreating the site resolved the issue suggests there may be a corrupted metadata record, site setting, or form configuration rather than a problem with the Dataverse data itself. I'd start by reviewing recent solution deployments and schema changes, as those are frequently the root cause of these specific casting and null-reference errors.

    Thanks,
    Manoj Annavajjala

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 38 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 37

#3
11manish Profile Picture

11manish 22

Last 30 days Overall leaderboard