Running a Process Server after an add transaction

This script can be used to execute a transaction (AGS) call after a particular message.

function FORM_OnAfterTransaction(data) 
{ 
    // was transaction successful? 
    if (formState.agsError) 
    { 
        return; 
    } 
 
    const sMsg = lawForm.getMessage(); 
    if (sMsg === "Add Complete - Continue") 
    { 
        const s = portalWnd.AGSPath + "?_PDL=[your_apps_data_area]" + 
            "&_TKN=WFWK.1&_EVT=ADD&_RTN=DATA&_LFN=ALL&_TDS=IGNORE" + 
            "&FC=Add&SERVICE=ServiceName&WORK-TITLE=ServiceTitle" + 
            "&_DELIM=%09&_OUT=TEXT&_EOT=TRUE"; 
        portalWnd.httpRequest(s); 
    } 
}