SHARE
TWEET

Untitled

a guest Jul 19th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. saveCase : function(component, event, helper){
  2.  
  3.     helper.validate1(component);
  4.     helper.validate2(component);
  5.  
  6.     var isValidDate = helper.validateExtDate(component);
  7.     //Other custom logic
  8.     helper.createCase(compoent); //Saves case
  9. }
  10.      
  11. validateExtDate:function(component)
  12. {
  13.     var caseRec = component.get("v.case");
  14.     var action = component.get("c.getResponseDeadlineOnEdit");
  15.     action.setParams({
  16.                       "cs":caseRec
  17.  
  18.     });
  19.     action.setCallback(this,function(response){
  20.              this.processresults(response, component);
  21.     });
  22.     $A.enqueueAction(action);
  23. },
  24.  
  25. processresults : function(response,component) {
  26.     var extnsDate = component.find("respExtdate");
  27.     var extnsDateVal = extnsDate.get("v.value");
  28.     var extDate = new Date(extnsDateVal);
  29.     var state = response.getState();
  30.     if(state === "SUCCESS") {
  31.          var deadlinedate= response.getReturnValue();
  32.          if(extDate <=  deadlineDate) {
  33.                     extnsDate.set("v.errors", [{message: "Please select a different date” }]);
  34.         }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top