Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Console and Workspace sync issue

anuradhav-k
Tera Contributor

In servicenow we have a custom application called Onsite in that i have a table called PP[Prevention Plan] and when try to renew the PP record by renew button in console the old PP gets inactive and open a new record automatically but in workspace its not the same. When I click on renew button the old gets inactive stays the new records will not open. I need to go back and refresh the page then I have to open a new created records. Please give me solution to sync the console and workspace.

-----------------------------------------

In UI action script we are using :- 

 

function onClickClientside() {
    //Call the UI Action and skip the 'onclick' function
    gsftSubmit(null, g_form.getFormElement(), 'renew_pp');
}

//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
    serverSide();

function serverSide() {
    var ppUtils = new PreventionPlanHelper();
    var returnOfRenewal = ppUtils.renewPP(current);
    action.setRedirectURL("/x_aif_onsite_airb_prevention_plan.do?sys_id=" + returnOfRenewal.newPP);
    gs.addInfoMessage(returnOfRenewal.message);
}
------------------------------------------------------- 
And Workspace Client Script:-
 
function onClick(g_form) {
    //Call the UI Action and skip the 'onclick' function
    g_form.submit("renew_pp");
}
----------------------------------------
The same script is working for console & workspace both, but the issue in workspace is that it will deactivate  the existing PP and stay on the deactivated PP. To get the new PP I need to go back and refresh and open the record. But in console it works fine

 

5 REPLIES 5

anuradhav-k
Tera Contributor

Hello Pavan,

 

As of now the url which I can see has 2 tables, one is Contractual Frame and the Prevention plan table is extending from contractual frame[URL :: https://airbusoperationsdev.service-now.com/x/aif/onsite-wks/record/x_aif_onsite_airb_contractual_fr...

 

Now what you have suggested in step 2 I am a bit confused as in what url I should add in - 

 

 // Workspace navigation — opens the new PP record
            var url = '/now/workspace/agent/record/' + tableName + '/' + newSysId;
            window.location.assign(url);

 

could you please help me with this.

 

Thanks and Regards,

Anuradha.