• Christina Garcia
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I created a visual force page to render when a field has hit 100% or more. I'm not getting any errors, below is the code I'm using. Is there an easier way to do this? I want it to render every time a user is clicking on these Accounts. 

<apex:page StandardController="Account"> <script> window.document.onload = new function(e)
{ if({!Account.Utilization__c != null && Account.Utilization__c > 1})

{ alert("This account is over 100 percent"); } }

</script> </apex:page>


Thanks so much!
I have a custom buttom, that is called "Create Sales Order". I want it to update to Processing unless one of the below else if statements is valid. The issue is, my error message displays but then still changes the Stage to Processing. Can you help me understand what I'm missing to prevent this from happening? 

Thanks!


{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")} 

try { 
var url = parent.location.href; 
var updateRecords = []; 
var update_Opportunity = new sforce.SObject("Opportunity"); 
update_Opportunity.Id ="{!Opportunity.Id}"; 
update_Opportunity.StageName = "Processing"; 
updateRecords.push(update_Opportunity); 

result = sforce.connection.update(updateRecords); 

if ("{!Opportunity.Sales_Order__c}" == true) { 

alert("Your request to create an ERP sales order has already been submitted."); 



else if ( !result[0].getBoolean("success") ) { 

var errors = result[0].errors; 
var errorMessages = errors.message; 
alert( errorMessages ); // display all validation errors 


else if ("{!Opportunity.Account_Order_Ready__c}" == false) { 

alert("The related account is not order ready. Your sales order request will not be processed."); 


else if ("{!Opportunity.StageName}" == 'Approved Prebook') { 

alert("This opportunity must be approved by your inside rep to proceed"); 



else { 
alert("Your request has been submitted") 

parent.location.href = url; 

} catch (e) { 
alert 
}
I am looking for a reliable address verification practice. Currently we are running into issues with our current app exchange product not validating when there is a "New" Lead being created. We are needing this for international and domestic. Any suggestions would be appreciated!

 
I have a custom buttom, that is called "Create Sales Order". I want it to update to Processing unless one of the below else if statements is valid. The issue is, my error message displays but then still changes the Stage to Processing. Can you help me understand what I'm missing to prevent this from happening? 

Thanks!


{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")} 

try { 
var url = parent.location.href; 
var updateRecords = []; 
var update_Opportunity = new sforce.SObject("Opportunity"); 
update_Opportunity.Id ="{!Opportunity.Id}"; 
update_Opportunity.StageName = "Processing"; 
updateRecords.push(update_Opportunity); 

result = sforce.connection.update(updateRecords); 

if ("{!Opportunity.Sales_Order__c}" == true) { 

alert("Your request to create an ERP sales order has already been submitted."); 



else if ( !result[0].getBoolean("success") ) { 

var errors = result[0].errors; 
var errorMessages = errors.message; 
alert( errorMessages ); // display all validation errors 


else if ("{!Opportunity.Account_Order_Ready__c}" == false) { 

alert("The related account is not order ready. Your sales order request will not be processed."); 


else if ("{!Opportunity.StageName}" == 'Approved Prebook') { 

alert("This opportunity must be approved by your inside rep to proceed"); 



else { 
alert("Your request has been submitted") 

parent.location.href = url; 

} catch (e) { 
alert 
}