I am working on Leave application for HR, I created a page called Leave application (Status::Open) which contains page actions: Send approval request which i added the code below:
Global Variable:
EmployeeLeave Record Employee Leave Application
EmployeeLeave.RESET;
EmployeeLeave.SETRANGE("Application No","Application No");
IF EmployeeLeave.FIND('-') THEN BEGIN
EmployeeLeave.Status := EmployeeLeave.Status::"Pending Approval";
EmployeeLeave."Approval Date" := TODAY;
EmployeeLeave."Approved Start Date" := TODAY;
EmployeeLeave.MODIFY;
MESSAGE(Text001,"Application No");
END;
I also have another page called Leave application - Pending (Status::Pending Approval) which contains page actions: Approve and Reject. They also have there varies code and link to another pages.
I have setup the followings:
1.) SMTP Mail Setup,
2.) Approval User Setup (Approval User Setup Testing, Notification Setup).
The code above is working fine but it’s not send to the email of the employee in charge.
My question is that I want the approval request to be send to the emails of my employees.
In approval user setup, I have the User ID, Approval ID and E mail.
No, I think there should be a way of solving it through this method. If not you can guide me with the standard approval workflow. But the leave application (Status: Open) and Leave application - Pending (Status: Pending Approval) are in different Role Center
IF user id <> ‘’ THEN BEGIN
IF UserSetup.GET(user id) THEN BEGIN
SubjectText := ‘Your notification subject’
BodyText := ‘your body text’;
Mail.CreateMessage(‘EMPLOYEE’,‘From Email’,usersetup.email,
SubjectText,BodyText,TRUE);
Mail.AppendBody(’
I did as you said, when i click the send request approval buttom. I received error message: The email address “From Email” is not valid but the email address is valid.
This is exactly why i said that before anyone simply request some lines of code - one simply has to try to find out how it works first - and then find the code that exists in the system.
the ‘FROM EMAIL’ is not a valid email-address - You have to read and understand the code above - its not valid code - but an example
Oh Boy… I just gave you a example, you have to substitute appropriate values into these fields. I don’t know what is your field name and table structure.