Islocal ? 0:1 is not taken

Hello,
i am trying to validate the msgprint in item.py using a method from js… i need the msgprint only on after saving the item record…so i have tried frm.doc.__islocal condition before callback method…if i give (frm.doc.__islocal == 1) msgprint is not shown but i couldnot save the new creation of item record. any idea?
Thanks In Advance

__islocal flag is 1 when the document has been newly created. It is not 1 after getting saved.

SO try the condition like this

after_save: function(frm){
    if(!cur_frm.doc.__islocal){ 
        //do something
    }
}

Use it in an appropriate event like after_save not on refresh otherwise it could give rise to bizarre behavior.

i tried this method i didn’t get the msgprint… but my record is not saved…and no err shown in console. wt can i do further…