Select to view content in your preferred language

Subtype not updating after edit in Inspector

712
3
08-22-2018 11:01 AM
CharlieGorman
Emerging Contributor

Is there a bug in the Inspector class that stops a Subtype update on a new record?

I have a custom panel which uses an Inspector embedded control. The Inspector is set up as follows, with a clear and schema load, as this process if for creating a new record.

inspector.Clear();
inspector.LoadSchema(standaloneTable);

Upon modifying the Subtype of the record, adding some attribute values, and attempting to save the new record as follows:

EditOperation editOp = new EditOperation();

editOp.Name = "Road Name Create";
editOp.Create(inspector.MapMember, inspector);

I received an error back that the EditOperation failed due to failing on an Attribute Constraint for another Subtype. It seems after load the Inspector hangs on to the default Subtype, even if it is changed in the Inspector.

Disqualified Subtype Attribute Rule Message

The Inspector looks as follows when initially loaded using LoadSchema():

Default Schema Inspector

Then it is modified to change the Subtype, and add attributes:

Updated Subtype and Attributes

In the debugger, the Attribute for the Subtype shows the Subtype code for Available:

Debugger shows Subtype updated

And here is the Subtype definitions:

Subtype Definitions

0 Kudos
3 Replies
NarelleChedzey
Esri Contributor

Hi Charlie, 

Yes it looks like a bug.  I can duplicate your problem.  I also see the same incorrect behaviour with EditOperation.ChangeSubType.   We'll endeavour to get this fixed for the new release (Pro 2.3)

Thanks for pointing this out. 

Narelle 

0 Kudos
CharlieGorman
Emerging Contributor

Hi Narelle,

Thanks for the update!

-Charlie

0 Kudos
NarelleChedzey
Esri Contributor

To clarify.  This is a bug with changing the subtype when creating a record in standalone tables.  Changing the subtype when creating features works correctly. 

Narelle

0 Kudos