- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 05:58 AM
Compare start and end date using BR, before inserting record
(function executeRule(current, previous /*null when async*/) {
//if(current.u_project_end_date != ''){
var start_date=current.u_project_start_date.getGlideObject().getNumericValue();
var end_date = current.u_project_end_date.getGlideObject().getNumericValue();
if(start_date > end_date)
{
gs.addInfoMessage("Start date cannot be greater than end date");
current.setAbortAction(true);
}
//}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 05:58 AM
Compare start and end date using BR, before inserting record
(function executeRule(current, previous /*null when async*/) {
//if(current.u_project_end_date != ''){
var start_date=current.u_project_start_date.getGlideObject().getNumericValue();
var end_date = current.u_project_end_date.getGlideObject().getNumericValue();
if(start_date > end_date)
{
gs.addInfoMessage("Start date cannot be greater than end date");
current.setAbortAction(true);
}
//}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 06:06 AM
Hi Ram,
Before business rule runs before record is inserted/updated in Database.
As Shashikant suggested Date validation rule before insertion. If this is done after insert it makes no sense as it would accept dates that actually it should now. So, Before is used in order to validate & then insert.
Refer link that gives detailed explanation for all Business Rule types.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
