Forum Discussion

FernandoCG's avatar
FernandoCG
Ideator I
3 years ago
Solved

Refresh a form.

Hello, I just joined a company and they use ARAS. I'm learning everything about the program as I go along.

I have a problem, I have looked in the forum, but no option solves the problem.

I have a form in which I update a field through an action, but I can't get it to refresh the screen and update the changed value. I've tried refreshing and blocking the item by hand, but nothing, no way.

I try with:

parent.onRefresh();

And with:

this.lockItem();
this.unlockItem();

But nothing. Any ideas?

Thank you very much.

  • Welcome do the happy world of PLM! :)

    There are a lot of refresh variants. Each situation works different.

    - Do you want to refresh Form or Grid?
    - Do you use a C# Action or JS Action? For C# return your item. For JS parent.onRefresh() works in many scenarios. But for Actions you maybe can use aras.uiReShowItem(itemId, itemId); 

4 Replies

  • Welcome do the happy world of PLM! :)

    There are a lot of refresh variants. Each situation works different.

    - Do you want to refresh Form or Grid?
    - Do you use a C# Action or JS Action? For C# return your item. For JS parent.onRefresh() works in many scenarios. But for Actions you maybe can use aras.uiReShowItem(itemId, itemId); 

    • FernandoCG's avatar
      FernandoCG
      Ideator I

      Hello Angela, thanks for the welcome, :). And thanks for the help!!!.

      its for a Form, in JS Action.

      yes!!!, with this now works fine: aras.uiReShowItem(itemId, itemId); 

      I put in my code: aras.uiReShowItem(parent.thisItem.getID(), parent.thisItem.getID()); 

      To get the itemId i use parent.thisItem.getID(), its correct? or is there another better way?

      Too many thanks for the help!! And don't worry, I have many questions to ask, :). tomorrow I will do some more, today I leave work.

      Thanks!!!

      • AngelaIp's avatar
        AngelaIp
        Ideator I

        parent.thisItem.getID() is correct. I personally would use a variable for it when this value is needed multiple times inside a Method -> const itemId = parent.thisItem.getID()
        Even small things have influence to performance and each nanosecond counts [emoticon:c4563cd7d5574777a71c318021cbbcc8]

        You of course are welcomed to help me with my dozens of open issues in this forum as well [emoticon:bfea11b94cc048458ee2c01f963db38d].