Hello, I'm working on a customization where all attribute editing is done through custom forms. I managed to setup a basic implementation of a workflow that opens a ProWindow to collect and validate all the attributes of a newly created feature that works well, which I'll extend to work with editing attributes of existing features. Now I need to find the right way to prevent users to edit data on the standard controls (e.g. attribute table; attributes pane).
What I'd like to accomplish is to be sure that the only way users have to edit data is through the custom controls we provide. As for my understanding (I'm new to Pro SDK development), there are several ways to accomplish this; I've came across and thought about a few ideas on the subject, like:
I'm sure there are also other ways that I didn't think about. I mentioned the main pros and cons that came to my mind for each approach, but I'm aware they can be more. What I need to understand is which approach is the best choice, but so far I lack the experience to make an educated guess about it.
Is there any best practice around this subject that I can follow? If the approaches I mentioned are viable, which one of them is the most affordable, clean and correct? Is there any other way that I didn't think of?
Thanks in advance to anyone who will share their thought.
The supported options for enabling/disabling editing are listed here:
https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#enable-and-disable-editing
Thanks @CharlesMacleod, I'm aware about the topics on the ProConcept page, I wasn't really looking for the code to enable/disable editing per se, but more for some higher level thought or best practice in order to implement the scenario I described.
Currently I implemented a solution where I manage the editability of layers turning it on and off depending on my needs. Basicly the addin sets them off on start and they stay off all the time, I turn on editing on any individual layer whenever my workflow needs to edit them, then I switch them off again. So far it seems like a robust enough solution and fairly scalable, I guess I'll see in the future if that leads to some serious issue.
We are using Edit Events to listen for Create and Update row actions on layers. If some criteria is not set you cancel/abort the edit. You'll need to decide in your code which layers to register the events on, which was a change from ArcMap edit events.
We had several custom data entry forms in ArcMap as well, but we're moving away from them in Pro for out of the box editing. We'll see how it goes.