Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<html><head><title>PreSaveExample2</title><script type="text/javascript"> 
function fieldsOnPreSave(){
	return "TASKDUEDATE,TASKDT02,TASKTXT01,TASKTXT04,TASKDT01";
}
function onPreSave(DueDate, LastAssessmentDate, EndTime, StartTime, CompletedDatetime){ 
	if(DueDate > LastAssessmentDate) { 
		if(EndTime > LastAssessmentDate) { 
			if(CompletedDatetime > StartTime) { 
				return true; 
			}else{ 
				window.location = "melt://showAlert/Completed Date can not be earlier than Start Time";
				return false;
			} 
		}else{
			window.location = "melt://showAlert/End Time cannot be earlier than Assessment date";
			return false;
		} 
	}else{
		window.location = "melt://showAlert/Due Date cannot be before Assessment Date"; 
		return false;
	}
}
</script></head><body></Body></html> 

...

Code Block
{if( condition 1 )
	{if( condition 2 )
		{if( condition 3 )
			{return true;} else{ message 3; return false; }
		}else{ message 2; return false; }
	}else{ message 1; return false; }
} 

...