Forum Discussion

AshuJoe's avatar
AshuJoe
Ideator I
1 year ago

aras.uiShowItemInFrameEx();

Hello, 
Does anyone Know How to open an Item using aras.uiShowItemInFrameEx();
i tried the below way.

const item = aras.getItemById("part","85FA7D64281A404E8AF6596650F50994");
aras.uiShowItemInFrameEx(window,item,'view');

i want to replace the form of an itemtype on button click to the above part item when a button is clicked .

does anyone have any idea how to do this ?
thanks,




7 Replies

  • angela's avatar
    angela
    Catalyst II

    It´s in it´s name, you need a frame.

    Your code should work, but I don´t think "window" will.

    You can reuse existing elements (document.getElementBy..) in Innovator to append your custom content. Or: One classic approach is to use an empty html frame element inside a regular Form. 

    But I wonder if this is the best solution for your use case.

    Do you use the classification property in your ItemType? If not, this would be a much easier solution. Use two Forms for each classification. Button click then just changes the classification. 

  • Hello,

    There are a few different options here. I'd recommend first to consider using classification-based forms. This way you can get a proper form appearing using OOTB functionality when the user changes the classification of the ItemType.

    One other thing you could do is open the part form in a new tab with aras.uiShowItem. 

    If you need to completely replace the form, I've found that the following code works from an onClick event of a button at least in R33.

    [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3f9cbae6-2a8a-4d4f-a625-f151b016c8b5:type=javascript&text=const%20partNd%20%3D%20aras.getItemById%28%22Part%22%2C%20%220BB5120838414E36ABAA90DB866B293D%22%29%0D%0Aaras.uiShowItemInFrameEx%28window.frameElement%2C%20partNd%2C%20%27view%27%29%0D%0A%2F%2F%20window.frameElement%20is%20what%27s%20needed%20to%20replace%20the%20existing%20form%20from%20the%20context%20of%20the%20onClick%20event]

    Be aware that the form will be re-drawn to the original if you edit/refresh/etc.

    • jeff_stroh's avatar
      jeff_stroh
      Creator II

      Hey christopher_gillis , is there a way to make the item editable when using aras.uiShowItemInFrameEx?  We have a use case where we want to display an item's form and would have a button on the form to save/apply the edits.  As of now using the command we seem to just get a read-only version of the form.

      • angela's avatar
        angela
        Catalyst II

        I am interested in this question too!

        Maybe some idea for you to copy. Make your own buttons!

        I used aras.uiShowItemInFrameEx to get the target form and added a custom "Edit","Save","Abort" and "Refresh" button by myself: