Automatically Create Records in related Tables from Point Feature Class

10768
21
03-12-2015 11:34 AM
PaulMcBride
New Contributor III

Hello Everyone,

I have a point feature with a single field used as the the attribute key for relationship classes to other tables.  I am looking to automatically create a row into the related tables with the key field populated from the point creation.  Any ideas how to auto populate the tables with that key?

Below is a screenshot of the inside of database.

Thank you!

Paul McBride

0 Kudos
21 Replies
ThomasTri
New Contributor II

Seems like this is the classic example for creating a Relationship Class Extension. By developing ArcObjects code, and hooking into the relatedObjectCreated method, you should be able to add a record to the related table.

0 Kudos
PaulMcBride
New Contributor III

Thomas,

I have no experience with ArcObjects.  Is this something I could do farely easily or with guidance?

Thanks,

Paul

0 Kudos
ThomasTri
New Contributor II

I don't think the code would be all that difficult, but learning ArcObjects is not an afternoon project :-).

0 Kudos
PaulMcBride
New Contributor III

Okay sounds good.  I will look into that if i can't get my Python to work.

0 Kudos
JoshuaChisholm
Occasional Contributor III

Hello Paul,

I'm working on a python solution (I don't know ArcObjects either). Can you let me know the exact name of the key field for the complaint point file?

Thank you!

0 Kudos
PaulMcBride
New Contributor III

Hey Josh,

The name of the field is "ComplaintNo".

Thank you again!

0 Kudos
Allison_Hockey
New Contributor III

Hello Thomas, 

I am also trying to achieve this same workflow, some years later! Is there some literature or a webpage out there that describes how to accomplish this workflow?

0 Kudos
JoshuaChisholm
Occasional Contributor III

Hello Paul,

I have prepared a Python Add-In that should do what you need. I attached a .zip of it. Note that:

  • To install the Add-In, run "PythonAddIn.esriaddin"
  • You can see the raw code under the "Install" folder
  • If you make any changes, run the "makeaddin.py" and then re-install with "PythonAddIn.esriaddin"

If you haven't already, you can download the python add-in wizard here. You can use "addin_assistant.exe" to change the Add-In documentation.

Let me know if it works out for you!

Also, I ran into one limitation. If the user has an attribute table open (from one of the related tables), they will have to close and re-open the table to see the changes. More info here.

PaulMcBride
New Contributor III

Hey Josh,

I'm sorry but I do not see the attached ZIP.  Thank you again for your hard work!

0 Kudos
JoshuaChisholm
Occasional Contributor III

That's odd. It's working for me. Try this link.

0 Kudos