Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- saveCase : function(component, event, helper){
- helper.validate1(component);
- helper.validate2(component);
- var isValidDate = helper.validateExtDate(component);
- //Other custom logic
- helper.createCase(compoent); //Saves case
- }
- validateExtDate:function(component)
- {
- var caseRec = component.get("v.case");
- var action = component.get("c.getResponseDeadlineOnEdit");
- action.setParams({
- "cs":caseRec
- });
- action.setCallback(this,function(response){
- this.processresults(response, component);
- });
- $A.enqueueAction(action);
- },
- processresults : function(response,component) {
- var extnsDate = component.find("respExtdate");
- var extnsDateVal = extnsDate.get("v.value");
- var extDate = new Date(extnsDateVal);
- var state = response.getState();
- if(state === "SUCCESS") {
- var deadlinedate= response.getReturnValue();
- if(extDate <= deadlineDate) {
- extnsDate.set("v.errors", [{message: "Please select a different date” }]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement