I have the custom function below called “Billing_Email_List” that read a SQL table and gets a list of email addresses of people who will be notified in a Catch script when there are errors.
$Job_Name = ‘Billing’;
$Billing_Email_Error_List = sql(‘xxxxxx’, ‘select DI_Error_List from DI_Email_Lists where DI_Job_Name = {$Job_Name}’);
return $Billing_Email_Error_List;
The Catch script below works perfect in my job … with a global variable defined called “$Billing_Error_Email_List”.
Billing_Email_List($Billing_Error_Email_List);
smtp_to($Billing_Error_Email_List, ‘**** Error ****’, ‘Log:’ , 0, 20);
Now let’s say I like to use this same Catch script in 50 other jobs and my question is … it will work if I define the global variable in each of the 50 jobs but can I somehow define that in the custom function one time and just have the code in the Catch script to handle all of it in each job?
My thinking is that if something would change like for example, the length of the global variable, then I would only have to change it in one place only in the custom function instead of all the global variable definitions in all 50+ jobs …
tvanbreukelen (BOB member since 2008-10-16)