How do I populate a form that is assigned to a relationship tab via the the configuration of the Relationshiptype [Relationship View] tab

My current project has a requirement that a I have a tab, for "Finished Goods", that translates the a "Product Model Code" as a Product Nomenclature.

This "Product Model Code" contains details that will be used to validate the components of the BOM.

I have created a configured Form that will be used, as on a no related Relationship, for all "Finished Goods". It is to contain the derived "Product Nomenclature" properties.

The Relationship TAB "Product Nomenclature" will be visible only for "Finished Goods".

How do I populate the configured Form presented on the Relationship tab with the instance data on the relationship itemtype. I have tried top.aras.uiShowItem but that creates a tab on the main form and not in the relationship frame.

Thanks for the help in Advance.

Scott

Sorry for the low contrast snips. Thanks to the Windows 11 snipping tool.

 

  • That´s something very very custom you use here and I haven´t fully understand your use case yet. But I will give it a try, but I right now have more questions than answers.

    What I have understand is, that you want to use a custom Relationship View based on a Form.

    1. Does your Relationship Form View appear at all? It seems so.

    2. Does it appear, but the Form shows no data? Then you probably don´t have a context item, which you could sideload with an onLoad Method. One option would be to have a get query that gets something you can use as new document.thisItem. 

    3. Another variant: Does the new Relationship view replace existing standard relationship grid data? So do you want to render relationship data in another way?

    BTW: Never use top.aras.uiShowItem but aras.uiShowItem. Aras spent a lot of effort to remove "top" from the code, you shall not bring it back :).

  • Hello Angelalp,

    Thanks for responding>

    Here is the use model of the form.

    The form will have key purposes:

    1) Give the user a derived translation of the clients Product Number (Model Number) to create a [Product Nomenclature].

         a) The user can validate, by clicking on the TAB, that the design metrics (xClass Properties, Finished Good Properties) aligns with the metrics specified by the Product Number

         b) The Product Number presentation a codified representation of (Trade Brand, Product Category, Seer, Capacity, Voltage, Region, etc.

    2) The  Product Number metrics will be combined with the xClass and Finished Metrics to be used to validate the components (parts) in the eBOM.

    Key Characteristics:

    1) The [Product Nomenclature] values will be persisted on a Relationship.

    2) There is only 1 relationship per Finished Good.

    3) The Grid is not rendered.

    4) Only Finished Goods will have access to the [Product Nomenclature]

    5) The Derivation of the [Product Nomenclature] values will be based of the use of a mask or Template based on Trade Brand, Product Category, Product Number string length (and potentially others).

    6) An Update of the [Product Nomenclature] will be prompted by the system if the Product Number changes or its change is detected.

    7) The [Product Nomenclature] form is assigned as a View form the relationship Itemtype

    8) The Form is rendered via the Relationship Type --> Relationship View --> Forms configuration

    9) Currently all form updates are managed by javascript.

    10) Any persistence is accomplished via javascript

    11) Initial Form loading is done via a Form Events 'Onload' and 'OnFormPopulated' Where "this" is of type 'Window' so full form management methods.

    12) The complication is [Update Data] button where "this' is of type 'Input' and form management methods are not available

    13) Properties set are set on the item which is the Parent item and not the Relationship Item.

    14) I tried aras.uiShowItem and it only renders the form in the main Iframe and not the relationship Iframe.

    15) The data is being persisted so that it does not have to be derived every time its used.

    16) This will also be tied to Compliance and Variant management in the future.

    Good Questions.

    Thanks for taking the time.

    Scott

  • Right now I just took a short glimpse at your new post. It seems to be a cool use case, I will try to understand it later :)

    But this sentence caught my eye:

    "I tried aras.uiShowItem and it only renders the form in the main Iframe and not the relationship Iframe."

    Do you know about  uiShowItemEx ?? The Ex versions of these functions normally includes relationships!

  • Angela,

    No I did not. I will give it a try this morning.

    Thanks for the info.

    Scott

  • Angela,

    I found your post form 6 years ago and followed the guidance from Chris.

    How to open a Item in a new Window instead from a Form

    aras.uiShowItemEx(prodNomenItm.node,"tab view", false, false);

    I got the exact same result as aras.uiShowItem().

    It created a tab on the main IFrame and not on the Relationship IFrame.

    The question I would have is, how does aras.uiShowItemEx know which IFrame to load the form into?

    Is there some setting that would direct it?

    I have looked for a method under the item and inn but I don't see anything:

    Thoughts?

    Scott

  • aras.uiShowItemEx is mainly used to open full items in tabs or windows. What you want sounds more like a task for  aras.uiShowItemInFrameEx. And yes: There are many further uiShowDoSomething functions.Grin

    This one requires a placeholder iframe html element in your Form. So you basically use a fake form that than loads the real form. This approach also requires that you have a get query to get the item it shall display.

    const frame = document.getElementById("myframeid");
    const formNd = aras.getFormForDisplay("formidgoeshere","id").node; 
    aras.uiShowItemInFrameEx(frame, myitem.node , "default", 0, formNd ); 

    Please note that there are many ways to address a scenario like yours. This is just one variant out of far too many.