Guest User

Untitled

a guest
May 26th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. {!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")}
  2. {!REQUIRESCRIPT("/soap/ajax/16.0/apex.js")}
  3.  
  4. var needs = "{!Entry__c.Needs__c}";
  5. var removal = "{!Entry__c.Removal__c})";
  6. var Id = "{!Entry__c.Id}";
  7. var callback = {
  8. onSuccess: function(decompileResult){
  9. window.location = '/{!Entry__c.WeekId__c}';
  10. },
  11. onFailure: function(decompileResult){
  12. alert('Delete Action Failed: ' + decompileResult);
  13. }
  14. };
  15. if(needs == 'No'||(needs == 'Yes' && removal !=')'))
  16. {
  17. //alert('Please Enter a Authoriser and Unavailability Notes');
  18. window.parent.location.replace('/apex/DiaryEntryEditPage?retURL='+diarId+'&Id='+diarId+'&r=r&needsReason=No');
  19. }
  20.  
  21. else{
  22.  
  23. //alert('Please Enter a Amendment Reason and Unavailability Notes');
  24.  
  25. window.parent.location.replace('/apex/DiaryEntryEditPage?retURL='+diarId+'&Id='+diarId+'&r=r&needsReason=Yes');
  26. }
  27.  
  28. if ("{!$Profile.Name}" === "System Administrator") {
  29. // Your code
  30. }
Add Comment
Please, Sign In to add comment