Difference between revisions of "Change owner script"

From SmartWiki
Jump to: navigation, search
Line 3: Line 3:
 
Use this browser script to force the owner to the person editing the level one as per the status.
 
Use this browser script to force the owner to the person editing the level one as per the status.
  
function changeOwner(){
+
  function changeOwner(){
 
+
  var frm=document.form1;
var frm=document.form1;
 
 
   if (frm.stageid.value=='1829')
 
   if (frm.stageid.value=='1829')
 
     {
 
     {
 
       frm.ownerid.value=@me.userid@;   
 
       frm.ownerid.value=@me.userid@;   
 
     }
 
     }
}
+
  }
changeOwner();
+
  changeOwner();
 
 
  
In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid=actual userid for the user.
+
In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid='actual userid' for the user.

Revision as of 10:54, 12 February 2008

Change Owner Browser Script

Use this browser script to force the owner to the person editing the level one as per the status.

 function changeOwner(){
 var frm=document.form1;
 if (frm.stageid.value=='1829')
   {
      frm.ownerid.value=@me.userid@;   
   }
 }
 changeOwner();

In this example the 'stageid' represents the status in this case its 'web' status. It will then change the ownerid to the current person editing it. The owner id can be hard coded to represent a constant contact by putting 'frm.ownerid.value=userid'. Where userid='actual userid' for the user.