Link in children's Item Type view to the parent's Item Type view

Hello everyone,

Try explain, my scenario:

I have the Item Types related:

1° Item type Authorization.
2° Item type AuthorizationTittle.
3° Item type AuthorizationTittleRelation (only to related).

I need add a link or buton in AuthorizationTittle with a phisical link/url to open a view of your Authorization Parent.

Thanks.

Parents Reply Children
  • Ok I slowly understand your problem. In this case you cannot use onBeforeAdd/Update.

    You need either a ItemType Client Event or a RelationshipType event. I am not sure right now cause I never had tested it by myself.

    I would start with an onInsertRow event in RelationshipType:

    Get the parent id with something like this: parent.thisItem.getID();

    Then add the id automatically to the related item (check out Method 'Increment Sequence Number'). Approach with ItemType Event would be some kind of similar. 

  • Hello, angela,

    Firstly thanks for the tips.

    I got a solution, I'll try to explain it to you.

    • 1° In the AuthorizationTittleRelation(relation item), I added the JS in the event OnInsertRow and this JS recover the parent.thisItem.getID() and set a document.cookie "currentAuthorizationJSON".
    • 2° In the AuthorizationTittle more specific in the form, I add the JS in the event OnFormPopulated that do this below.
      FYI: The z_authorization(Item is your type) is my field in the AuthorizationTittle the related with Authorization.

    if (document.thisItem.getProperty("z_authorization") === undefined ||
    document.thisItem.getProperty("z_authorization") === null ||
    document.thisItem.getProperty("z_authorization").trim() === '') {

    var currentAuthorizationObj = JSON.parse(getCookie('currentAuthorizationJSON'));

    document.thisItem.setProperty("z_authorization", currentAuthorizationObj.id);
    }

    • 3° And to have the link to Authorization in the AuthorizationTittle's form I added in the form the field of the Item Type(z_authorization) with Disabled checked.


    Thanks.