Adoxio / xRM-Portals-Community-Edition

The definitive edition of Microsoft Open Source Portals, supported by the experts in portals.
MIT License
107 stars 60 forks source link

Entity forms will not be editable for records without a StatusCode of 0 #117

Open BobHarper1 opened 5 years ago

BobHarper1 commented 5 years ago

When an entityform is rended it checks if the statecode is 0. If it is not it assumes (possibly wrongly) that the record should be inactive and sets the form to read-only, no matter the settings on the EntityForm configuration.

Relevant lines: https://github.com/Adoxio/xRM-Portals-Community-Edition/blob/master/Framework/Adxstudio.Xrm/Web/UI/WebControls/EntityForm.cs#L581-L589

But as described in this Dynamics Community Forum post there is at least one entity that has more than the 0 or 1 (active, inactive) status, such as a ServiceAppointment which has four states - for example '3' means scheduled and you would assume that could be made editable.

This may be hard to get around however, for example, the SalesOrder state code also has a '3' for a fulfilled invoice.

amervitz commented 5 years ago

Hi @BobHarper1, please check what the behavior is in online portals. We will need to defer to its behavior to decide whether this is by design or if any changes are appropriate.

BobHarper1 commented 5 years ago

I believe it is as I've described - any entity with a state code other than 0 will be read-only. This appears to be by design - going by the code comments anything that StateCode != 0 is presumed to be inactive.

This can have an undesired effect on some Dynamics OOB entity types that makes use of Portal difficult, in some specific cases.

amervitz commented 5 years ago

I think the best avenue for moving such a change forward would be to reach out to Microsoft and see whether they will treat it as a bug or a feature enhancement in the online portals first. Online support requests would be sent via the PowerApps Platform admin center at https://admin.powerplatform.microsoft.com/support, and feature enhancements submitted as ideas on the PowerApps Ideas site at https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas/label-name/portals.