No record found within criteria
hello,
I'm looking up records in a form. Is there an expected response from the system if there are no record found?
Here's my code:
// Check to see if there are any batteries that need to be replaced.
Battery = System_Batterys [ID = TempAssignedSites]; (TempAssignedSites is the record ID to look for)
if (Battery.Battery_Replacement_Date <= zoho.currentdate.addDay(120))
{
// If the batterys meet the criteria tell the user to replace the batterys.
BatteryReplace = "Replace Batterys";
}
else if
(Battery.Battery_Replacement_Date > zoho.currentdate.addDay(120))
{
// If the battery date is beyond the criteria, tell the user the batterys are OK.
BatteryReplace = "Batterys OK";
}
>>QUESTION<<
>> else if there is no record found
>> {
>> BatteryReplace = "No Battery Data";
>> }
The above code works well... but what if there is no record in [System_Batterys] for the search ID?
On the condition "No record" I'd like to tell the user --> "No Battery Data Found".