CA Service Management

Expand all | Collapse all

¿Refresh ticket window after change fields from action macro?

  • 1.  ¿Refresh ticket window after change fields from action macro?

    Posted 06-05-2018 01:35 PM

    Hi,
    First of all I wanna say thank you to all the community members. Your help is really appreciated.
    Here is our problem. We have done a lot of customizations to CA SDM v17 forms because of the client's requirements. One of these customizations is to change the change order status after some workflows tasks are completed or finished.
    We have developed an action macro that do this. When we finish the wf task, the action macro is fired and changes the ticket status. The problem is that, when we close the wf task window, the ticket window only refreshes the wf task list, not the entire ticket window.

     

    Here is the process:
    -We click on the present wf task. The task window opens.
    -We fill the fields, change the status to completed and press Save button.
    -If everything is ok, a message appears saying that the wf task has been saved correctly and updated.
    -The action macro is fired and changes the ticket status.
    -We close the wf task window.
    -After the wf task is closed, the ticket window is refreshed but only the wf task list.
    -If we look to the status field, we see the previous status, not the new one.
    -If we refresh the window (mouse right click - Update), then appears the new status.

    I have been looking for and I found the refreshForm() function, that refreshes the window. The problem is that I do not know where to call it.

     

    Has anybody had a problem like this? And the most important, how did you solve it?

     

    Thanks in advance. As I said earlier, your help is really appreciated.



  • 2.  Re: ¿Refresh ticket window after change fields from action macro?

    Broadcom Employee
    Posted 06-05-2018 05:24 PM

    Hi Soporte,

     

    Perhaps the answer posted below also applies here?

     

    Create Reload Button 

     

    Thanks,

    Scott



  • 3.  Re: ¿Refresh ticket window after change fields from action macro?

    Posted 06-06-2018 02:14 AM

    Hi,

     

    here is a way used to reload parent window in 12.x not sure it will work in 14.x/17.x: Automatically close window after click save button 

     

    Regards,

    Timur



  • 4.  Re: ¿Refresh ticket window after change fields from action macro?

    Posted 06-06-2018 04:01 AM

    Hi guys, thank you for your replies.
    I found a piece of code in the @cdtj response ("Automatically close window after click save button"). I think it is what I'm looking for. The code is the next one:

    <body ......... onunload="zRefreshParent();">

    function zRefreshParent() {
    parent.opener.location.reload();
    }

    I put this code in "detail_wf.htmpl" form. The problem is that the line "parent.opener.location.reload();" only "refreshes" the wf task list in the ticket window, not the entire ticket window.

    Would be possible to refresh the entire ticket window?

    Greetings ;)



  • 5.  Re: ¿Refresh ticket window after change fields from action macro?

    Posted 06-06-2018 04:40 AM

    This happens because window which presented as opener is a list form. Examine SDM frame structure is a good point to start from. Main form is ahdframeset which inlcudes:

    • header (gobtn, welcome banner)
    • ahdframe - main frame which contain all details
      • main form
      • notebook tabs that presented as iframes
    • footer
    • hidden frames which used to async load data (might me replaced with ajax query in 17.x, not sure about them)

     

    complete path from workflow popup window looks like: ahdframe (workflow data) -> ahdframeset (parent window for workflow data) -> opener (place which populated popup) -> ahdframeset (child iframe should know about parent window) -> ahdframe (request detail page).

     

    you can use F12 (console) to debug your model, try to call this one from workflow page:

    ahdframe.parent.opener.ahdframeset.ahdframe.location.reload();

     

    but, this is just workaround and i think there should be native way to refresh parent page.



  • 6.  Re: ¿Refresh ticket window after change fields from action macro?

    Posted 06-06-2018 09:48 AM

    Hi @cdtj,
    It works...but only the first time!!! I will explain:
    -I open the wf task, modify some fields and press the save button. The workflow task is updated and the ticket window is refreshed. AWESOME! That's what I'm looking for. :)
    -However, If I edit the workflow task again (it is still opened), change some fields and press the save button, the wf task is updated but the ticket window not.

    I suppose that this happens because the first time the ticket window is refreshed, after the refresh is finished, the reference to the window ticket is lost or something like that.

    If I close the wf task form between updates, It works. I wanna mean:
    -Open the wf task, edit and save. The ticket window refreshes.
    -Close the wf task form.
    -Open again the same wf task, edit and save. The ticket window refreshes.

    So I tried to use the Auto close code that you suggested in the topic "Automatically close window after click save button". The idea is to close de wf task form after the save button has been pressed and the ticket window has been refreshed.

    The problem is that the Auto close code seems to be incompatible with the refresh code. It works if I remove the "refresh code" from de wf task form.

    Is there any way to close the wf task form apart from this? Any ideas?

    Thanks in advance!!!