• Esteban Rocha
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Manager


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Got this script to create a Parent Case when a user clicks on the button. 
The code is fine however what I'm missing here is from the case child record I would like to update the field Parent Case with the Case that it was created from the button.

{!REQUIRESCRIPT('/soap/ajax/41.0/connection.js')} 


var PC= new sforce.SObject('Case'); 

PC.OwnerId = '{!Case.OwnerId }'; 
PC.Status = '{!Case.Status }'; 
PC.Origin= '{!Case.Origin }'; 
PC.Origin_Brand__c= '{!Case.Origin_Brand__c }'; 
PC.Subject= '{!Case.Subject }'; 
PC.Description = '{!JSENCODE( Case.Description )}'; 
PC.Priority= '{!Case.Priority }';
 

result = sforce.connection.create([PC]); 

if(result[0].success == 'true'){ 
alert('The Parent Case was created'); 

Thanks!
Battle Station Trailhead -Step 4:Ad business logic
"Step Not yet complete... here's what's wrong: 
The validation rule does not appear to have the correct error formula. Make sure Exhaust Port Inspectors have > 150% utilization' 
Note: you may run into errors if you've skipped previous steps"