Difference between revisions of "Pass Variables To Level 1"

From SmartWiki
Jump to: navigation, search
Line 16: Line 16:
 
     var oppID=document.getElementById('opportunitytypeid').value;
 
     var oppID=document.getElementById('opportunitytypeid').value;
 
     if(oppID=="0"){
 
     if(oppID=="0"){
           alert("Please select a template");return false;}
+
           alert("Please select a template");
 
+
  return false;}
 
       parent.location.href='/Apps/app_editopportunity.jsp?appid=@system.appID@&nextlevel=1&opportunityid=0&companyid=@companyid@&defaultownerid=@userid@&opportunitytypeid='+oppID;
 
       parent.location.href='/Apps/app_editopportunity.jsp?appid=@system.appID@&nextlevel=1&opportunityid=0&companyid=@companyid@&defaultownerid=@userid@&opportunitytypeid='+oppID;
 
   }
 
   }
 
   </script>
 
   </script>
 
   <input type=button class=Button onclick="createForm()" value="Create Form"/>
 
   <input type=button class=Button onclick="createForm()" value="Create Form"/>

Revision as of 14:18, 30 April 2013

You can pass different values to a new Level 1 record using parametes.

Parameter List

defaultownerid - Passes owner ID companyid - Passes Company ID opportunitytypeid - Passes Type ID

<select class="Large" name="opportunitytypeid" id="opportunitytypeid">

 <option value="0">--Select One--</option>
 <option value="11608">Beginning Years</option>
 <option value="11607">Healthy Active Children</option>
 <option value="11603">Diabetes</option>
 </select>
 <script>
 function createForm(){
    var oppID=document.getElementById('opportunitytypeid').value;
    if(oppID=="0"){
         alert("Please select a template");
 return false;}
     parent.location.href='/Apps/app_editopportunity.jsp?appid=@system.appID@&nextlevel=1&opportunityid=0&companyid=@companyid@&defaultownerid=@userid@&opportunitytypeid='+oppID;
 }
 </script>
 <input type=button class=Button onclick="createForm()" value="Create Form"/>