Jump to content
Sign in to follow this  
jonasborg

Kick off PAM flow from button

Recommended Posts

I am looking to create an activity entry on a Request, with a custom type by clicking on a button. No attributes on the form should change, but a log entry should be written. This will result in a PAM flow execution as an action on true. Advice on this forum steered me away from embedding the function in the button.

What I did was copy the request_update_status.html, and called it with the button. However, none of the arguments come over (ref_num, type). How do I bring those arguments over in context of the ticket I am clicking the button on?

Finally, I wish for this form to autosave so it writes the activity without further intervention. I have tried to embed a pdm_submit function with a window.timeout of 500, but it still gives me a Page Load in Progress error.

Any guidance would be appreciated.

Here is how I am calling the custom htmpl form:

ImgBtnCreate("btncus", "Custom", "popup_window('','custom_activity.htmpl')", true, 0, "Select this button");

I also added some hidden inputs on detail_cr that relate to the values I want, but it doesn't give me any more data. webengine didn't understand when I tried to pass a 'INITFROM=custom' as defined as the form name starting the hidden inputs section.

Edited by jonasborg

Share this post


Link to post
Share on other sites

hi,

i suggest to do the next thing:

1. copy your detail_alg.htmpl as detail_alg_new.htmpl;

2. modify detail_alg_new with next code:

function saveOnLoad()
{
    function saveIfTrue()
    {
        if (currentAction==0)
            {
                clearInterval(myInterval);
                detailSave();
                // ahdframeset.opener.ahdframe.reload_me(); here was my function to update refresh parent (request) form
            }
    }
    if('$prop.form_name_3' == 'edit')
    {
        var myInterval = setInterval(saveIfTrue,100);
    }
}

Add function to onload:

(I also hidded body)

<body class="detailro" onload="loadActions();saveOnLoad();" onunload="unloadActions()" style="display:none">

blinking form is annoying, hope this helps (not tested):

window.resizeTo(16,16);

3. add button to request form:

    var aa_url = window.cfgCgi + "?SID=" + window.cfgSID + "+FID=" + window.fid_generator() + "+FACTORY=cr" + 
    "+PERSID=" + window.argPersistentID + "+OP=UPDATE+ACTIVITY_LOG_TYPE=####YOUR ACTIVITY###" + "+HTMPL=detail_alg_new.htmpl";
    <PDM_MACRO name=button Caption="Custom alg" Func="java script: popupActivityWithURL('\" + aa_url + \"','xfer')" hotkey_name="AA_URL[U]" ID=AA_URL>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...