Relationship Classes and GlobalIDs

2022
2
10-14-2011 03:56 AM
MikeSweetman
New Contributor II
I have a model, and am supplied with data for that model. The model contains relationship classes based on numeric ID and FK_ID fields.
I have a requirement to convert all the primary key ID fields to GLOBALID fields.
I initially misunderstood the requirement and created fields called GLOBALID and FK_ID_GLOBALID that were GUIDs, as this was all I saw in the drop down on ArcCatalog. I had something that was great, but it required the application developed on top of this data to get and set the GLOBALID field when a new row was added. What was actually wanted was the GLOBALID fields to get their own GUID value automatically.
With GLOBALIDs the generation of the fields value is performed automatically.
Now, my problem.
From what I've read I need to use AddGlobalIDs_management to create and set the GLOBALID field/values. I then believed I needed to create my FK_ID_GLOBALID foreign key fields as GUIDs, and with some coding rework the data so the FK_ID_GLOBALID value was using the correct GLOBALID value.
When I then tried to create a relationship class between two feature classes I received the error

    arcpy.CreateRelationshipClass_management(
                                             sdeFilePath + "PARENT",
                                             sdeFilePath + "CHILD",                  
                                             sdeFilePath + "DATASET_A\PARENT_TO_CHILD",
                                             "SIMPLE",
                                             "PARENT_TO_CHILD",
                                             "CHILD_TO_PARENT",
                                             "NONE",
                                             "ONE_TO_ONE", 
                                             "NONE",
                                             "GLOBALID", 
                                             "PARENT_ID_GLOBALID" )

Error Info:
<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of GLOBALID.
Failed to execute (CreateRelationshipClass).


GP ERRORS:
Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of GLOBALID.
Failed to execute (CreateRelationshipClass).


##End##

This worked fine when all fields were GUIDs.

This would have me believe that I need to create the foreign key fields as GLOBALIDs too, but the AddGlobalIDs_management routine only creates a GLOBALID field, and would not create fields with names I want, for use in a relationship class.

Where have I gone wrong ?

Thanks
0 Kudos
2 Replies
FredericWalter
New Contributor III
I've got the same problem and ... it's a bug: http://support.esri.com/en/bugs/nimbus/role/beta10_1/TklNMDcyMDAy.

Not fixed for nearly 2 years ...
0 Kudos
FredericWalter
New Contributor III
Finally, the only workaround i found is to write a geoprocessing tool using C# and call it from python. If someone is interested, i can post the Visual Studio project.
0 Kudos