Select to view content in your preferred language

Create direct link to add related records in Field Maps

2958
10
Jump to solution
04-17-2024 07:23 AM
ajohnson_wsb
Occasional Contributor

I'm looking to simplify the way that users have to add related records in Field Maps. I know that on the parent asset, a user can click the related link at the bottom and then click Add, etc. but I am looking to give users a "button" or something so that they can directly open a new related record. The goal is to limit how many times users have to click through boxes when adding new related records

At the Dev Summit last month, Esri showed a way to do this with Arcade and HTML but the presentation missed pieces in the demo that showed all of the code in order to replicate. Recording of the presentation is below:

https://registration.esri.com/flow/esri/24epcdev/deveventportal/page/detailed-agenda/session/1699036...

If anyone has successfully done this please let me know. Thank you!

10 Replies
LeighStarr
Emerging Contributor

I am getting an error: "The specified foreign key field couldn't be found". 

I am a little confused... there isn't anything pointing to the child in the relationship.  Everything points to the parent, including the source URL.  I would have thought that the foreign key would point to the child, but the comments clearly state parent...

For the relate, both are branch versioned, with the Primary Key of the Parent feature class: 'GlobalID', and the Foreign key in related feature class: 'CAB_GUIID'

With the parent primary key as 'GlobalID' my entry into the expression builder is:

var featureID = Replace(Replace($feature.GlobalID, "{", ""), "}", "")  //GlobalID field of parent asset
var foreignKeyField = 'GlobalID';   //GlobalID field of parent asset
 
On a somewhat related note, if I have multiple relates, how would it know which one to add?
What am I missing here?
0 Kudos