Get Related Item from a Form.

Hi Can somebody please help me understand how to get a Relationship Item  from a  Form Method. I have tried getReleated Item but it doesnt seem to work for me. 

I want to run a method on Click.So when a User clicks that button it should open up another form and from there it should  allow them to add information on to a related Item. Can somebody please advise me on this. Any help will be great. 

Thank you in advance. 

  • Hi User123,

    Could you explain in a little more detail how the items are related? A relationship implies a 1 to many setup, which I think would cause issues for your use case. The method you're looking at "getRelatedItem" can be used on relationship items only, since relationship items have a source id and related id. If you're trying to get a related item from a non-relationship item, you'd have to specify which of the related item's you want.

    If there will only ever be one related item, consider using an item property to create this link. This will allow you to link 1 item of the desired type to the current item, and will even allow you to navigate directly to that item from your item form.