Select to view content in your preferred language

Relationship classes in Map Service

2383
9
01-05-2022 12:31 PM
KellyKnapp35
Occasional Contributor

A year ago, I published a map with 6 layers related to a non-spatial table from ArcMap to a hosted server.  Data is in a SDE geodatabase with relationship classes. 

KellyKnapp35_3-1641412804139.png

A year later, I imported that map into ArcGIS Pro and made some updates.  I accidentally deleted a Relationship Class, so I had to recreate them all.  I published to our AGOL Feature/Map Services Server (not hosted).

Now when I query the map in my web app, the related layers are displayed in a different order that makes no sense for this data.  It looks like something happened to them when I published.

KellyKnapp35_4-1641412804140.png

I tried to delete the Relationship Classes, recreate them in the order I want and republish.  I still get the relationships in a random order.  I want them to be in sequential order by layer 0, 1, 2, 3, 4, 5...  I can't figure out why they would've changed from one publishing to the next.

Is this due to publishing one to a hosted server vs. AGOL server?  Is there a way to publish them in sequential order?  Or force the related layers to be displayed in a different order? 

Any suggestions would be appreciated! 

9 Replies
TanuHoque
Esri Regular Contributor

@KellyKnapp35 

- If you talking about the 'relationship IDs' (that is what we are seeing on the left side of '--' in your screenshots), then unfortunately we don't have any option at this point to support this. We do have plan to do that. Here is the bug id - ENH-000127465. Please contact Esri support and add your use case in that.

Just curious, are these new ids causing any problem while you are using your service in a webmap/app?

 

- But if you are talking about 'layer IDs' (that is showing up on the right side of '--' in your screenshots), you can fix them. Here is the doc that shows you how to.
https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/assign-layer-ids.htm#ESRI_SECTION1_11...

 

 

KellyKnapp35
Occasional Contributor

Thank you @TanuHoque  for your response!  Unfortunately, I was talking about the relationship IDs. 

Functionally there is no issue because I had to reconfigure my Query in my application to query the new Map Image.  

My issue is with the Query Results list under Feature Actions.  Now when “Show All Related Records” is selected, it is in this random order.  I would like it to match the layer order in the map (which is also sub grouped by geometry type).

Is there no work around? 

I tried: Delete all relationship classes, recreate them in the desired order, create new map, add layers and table and publish.  That did not work.

I may try deleting the related table.  Recreate it, relationships, new map, etc.. it might be the only way?  😞

 

DaveThompson101
Occasional Contributor

I think I'm having the same issue as @KellyKnapp35, if I'm understanding the issue correctly... 

Are we saying that the relationship IDs are randomly assigned?

For me, here is the issue I'm having...

  1. Publish service with relationships
  2. Build web map/app with smart editor widget
  3. Republish service (layers stayed in same order)
  4. Widget doesn't work...
    1. looking into the widget, I see that the relationship IDs the widget is expecting are different than in the service. 

Question - is it possible that when I republished the service the relationship IDs changed? And/Or - What determines the relationship ID?

 

Thank you!

KellyKnapp35
Occasional Contributor

@TanuHoque  One other related question.  Is there any way to rename the layers in the "Show All Related Records" drop down list? or show an Alias Name?   It appears whatever the layers are named when the Map Image is published is what is shown.

It would be nice to be able to edit the layers with a more descriptive name within the application.

KellyKnapp35_0-1641495639198.png

 

0 Kudos
LanceKirby2
Frequent Contributor

Having these same issues. Just wanted to add another comment to grow this thread. It would be nice if there was a solution.

MareikeKociok
Emerging Contributor

Hey all,

I am having the same Issue in an even more advanced way. The relationship Id's change in a non detectable pattern (so far) even so the service is not republished. Just out of no where and the attached workflow does not work anymore afterwards, because:

the query related records tool does seem to follow the old order of the relationship id's (1,2,3,4) even though the order changed to 1,2,4,3 in the layer. A restart on the service does help to restore the order of the relationship class id's. But since this behaviour occurs on an regular basis this is no long term solution.

I also would be interested to know the answer to the question @DavidThompson101 asked.

@TanuHoque: Any ideas?

MareikeKociok
Emerging Contributor

Additonally the mentioned Enhancement has the status Implemented: https://support.esri.com/en/bugs/nimbus/RU5ILTAwMDEyNzQ2NQ==#

But i could not find any information about how this is implemented.

0 Kudos
LanceKirby2
Frequent Contributor

If you upgrade Pro to 3.0 or greater you can specify the Id of each layer in a service before publishing. They then wouldn’t change any time you re publish.

 

I know that doesn’t resolve your issue since you mention you haven’t republished, but I think it’s the answer to the bug you referenced and the answer to the original thread.

0 Kudos
MareikeKociok
Emerging Contributor

Helle @LanceKirby2 ,

Thanks for your feedback. I tried it out and this actually does already work in ArcGIS Pro 2.9. Unfortunately, this id defines the table id, rather than the Relationship class Id.

MareikeKociok_0-1670848236150.png

In in my scenario the id of the relationship class (number on the left), does change and i would like to adjust the numbers. Anyone who knows how this can me made possible?

Thanks in advanced for your help.

0 Kudos