Hello All
I have created a new table that holds [no.] from table resource and two fields that are Technical and Commercial approver codes that links in with Salesperson/Purchaser table.
When pressing a command button I need to refer to a new function within OnPush and then use this to send an automatic email to all relevant email address for the Technical approver.
The new table that holds the approvers looks like:
Resource No. Tech App Comm App
RES0000028 DW TL
RES0000028 TL GB
RES0000028 DW GB
Therefore, within the function, I want to ensure that I check through the table for RES0000028 for example and send an email to DW and TL once each i.e. Not two emails to DW.
The code I have generated is as follows, but its not working......
Is there a glaring mistake or I have I approached this the wrong way?
LResourceSalesperson is the new table.
LSalespersonEmail is the Salesperson/Purchaser table.
LResourceSalesperson.SETRANGE("No._FK", ResourceType);
LResourceSalesperson.FIND('-');
REPEAT
IF TechApproverCode <> LResourceSalesperson.TechApprover THEN
TechApproverCode := LResourceSalesperson.TechApprover;
LSalespersonEmail.SETRANGE(Code, TechApproverCode);
LSalespersonEmail.FIND('-');
TechApproverEmail := LSalespersonEmail."E-Mail";
LcduMail.NewMessage('TechApproverEmail','','Quote raised - Waiting for Technical Approval',"No.",'',FALSE);
UNTIL LResourceSalesperson.NEXT = 0;
Any advice would be most appreciated. Thanks.
0
Comments
what kind of problem are you having ??
HTH
RIS Plus, LLC