If caller is trying to create more than 1 records in same day then compiler stop creating new incident Record.
If we need to achieve this, we will write a business rule on incident table.
| Field Name | Name |
| Name | Restrict Caller |
| Table | Incident |
| When | Before |
| Insert | Yes |
if(current.caller_id)
{
var inc = new GlideRecord('incident');
inc.addQuery('caller_id',current.caller_id);
inc.addQuery('sys_created_on','>=',gs.beginningOfToday());
inc.addQuery('sys_created_on','<=',gs.endOfToday());
inc.query();
if(inc.next())
{
gs.addErrorMessage("The caller has already created new incident today");
current.setAbortAction(true);
}
}
Use the above code in advanced script area, then save the business rule and check the incident record creation with same caller names in two record creation. While creating second record creation compiler not to create record.
