Dear Gents;
I have crated a job that is displaying notifications for all the employees whose Passports are expiring in thee months.
Now i want to run this job incrementally so that by the end of each week HR Manager can see notification of passport expiry for each employee.
Can somebody help how can achieve this Here is my job code.
static void Job22(Args _args)
{
HcmPersonIdentificationNumber hcmpersonidentificationnumber;
HcmWorker hcmworker;
HcmIdentificationType hcmidentificationtype;
userinfo infoo;
userinfo userinfo;
DirPerson myDirParty;
EventInbox inbox;
while select * from hcmworker join hcmpersonidentificationnumber where
hcmpersonidentificationnumber.RecId == hcmworker.RecId
{
if((hcmpersonidentificationnumber.expirationdate-today())<90 && hcmpersonidentificationnumber.IdentificationType == any2int64(5637145327))
{
print hcmworker.personnelnumber," ",hcmpersonidentificationnumber.expirationdate ," ",
hcmidentificationtype.identificationtypeid," your passport is Expiring Soom";
inbox.initvalue();
inbox.showpopup = noyes::yes;
inbox.subject = strFmt("regarding passport expiration for %1",hcmworker.personnelnumber);
select Name,RecId from myDirParty where myDirParty.RecId == hcmworker.Person;
inbox.message = strFmt("Passport for %1 is going to expire in 90 days please do renew",myDirParty.Name);
inbox.alertedfor = strFmt("Passport Expiry Date is %1",hcmpersonidentificationnumber.expirationdate );
inbox.sendemail = true;
inbox.userid = userinfo.id;
inbox.typeid = classnum(eventtype);
inbox.companyid = curext();
inbox.inboxid = eventinbox::nexteventid();
inbox.insert();
}
}
}