Prompt to stop someone forgetting to save

I have a customer that is on v7.0 and ideally I'd like to get them onto v7.2. Does anyone know if v7.2 has the anyway of doing the following?


In a communication screen, I'd like to have the ability to prevent the user from navigating away from the page without saving. In principle this is quite simple as a page script but I was wondering if 7.2 has any new functions to effect this sort of behaviour?

Thanks.

  • 0

    Hi,

    Please refer the below given script code for your reference.



    //' Restrict Communication Screen while navigating to other context

    function fnCommOnBeforeUnloadSaveWarning()
    {
    if(typeof(document.EntryForm)=="object")
    {
    if(typeof(document.EntryForm.comm_action)=="object")
    {
    shref= new String(document.activeElement.href);
    act=shref;
    if( shref.indexOf('&Act=')>0)
    {
    act=getAct()
    }
    sDel=false;

    if(shref.indexOf('cnfrmdlt')>0) {sDel=true;}
    else if(shref.indexOf('javascript:document.EntryForm.submit();')>0) {sDel=true;}

    if(act=="javascript:fn_OnClickSaveComm();" || act.search("Delete")>0)
    {}
    else
    {
    event.returnValue = "Warning:\nYou must Save your changes manually.\nIf you have NOT saved any changes to this screen\nYou will lose them.";
    }
    }
    }
    }

    In above mentioned script you have to implement your script logic as per the requirement.

    Hope this helps!

    Regards,

    Dinesh