Issue on Send approval Request ?

manikandanmanikandan Member Posts: 160
edited 2012-07-04 in NAV Three Tier
Scenario:
The Marketing person will raise a approval request via NAV to the management. Once he click the “Send Approval Request” the authority person will receive the mail. The person will login to NAV and approve the Order.
The issue is once the person approve Via NAV the marketing person is not receiving mail stating that the Order has been approved.
Kindly guide for the above issue. ](*,)

Thanks
Muthusubramanian.M

Comments

  • ChinmoyChinmoy Member Posts: 359
    Hi,

    I found a very odd code in the ApproveApprovalRequest function in Approvals Management code unit. It looks like that, if after approving the current record, if the next record is in the Open status the system exits, only if it is not in Open status the system is sending out Approval Emails. I am not sure what is the reason for this. The code looks like:

    ApprovalEntry.Status := ApprovalEntry.Status::Approved;
    ApprovalEntry."Last Date-Time Modified" := CREATEDATETIME(TODAY,TIME);
    ApprovalEntry."Last Modified By ID" := USERID;
    ApprovalEntry.MODIFY;
    // Approval done for the current record

    // The system is looking for more records
    NextApprovalEntry.SETCURRENTKEY("Table ID","Document Type","Document No.");
    NextApprovalEntry.SETRANGE("Table ID",ApprovalEntry."Table ID");
    NextApprovalEntry.SETRANGE("Document Type",ApprovalEntry."Document Type");
    NextApprovalEntry.SETRANGE("Document No.",ApprovalEntry."Document No.");
    NextApprovalEntry.SETFILTER(Status,'%1|%2',NextApprovalEntry.Status::Created,NextApprovalEntry.Status::Open);
    IF NextApprovalEntry.FIND('-') THEN BEGIN
    IF NextApprovalEntry.Status = NextApprovalEntry.Status::Open THEN
    //IF the next record found is in the open status, it exits from here and does not send the email. This is something which I could not understand.
    EXIT(FALSE)
    ELSE BEGIN
    NextApprovalEntry.Status := NextApprovalEntry.Status::Open;
    NextApprovalEntry."Date-Time Sent for Approval" := CREATEDATETIME(TODAY,TIME);
    NextApprovalEntry."Last Date-Time Modified" := CREATEDATETIME(TODAY,TIME);
    NextApprovalEntry."Last Modified By ID" := USERID;
    NextApprovalEntry.MODIFY;
    IF ApprovalSetup.GET THEN
    IF ApprovalSetup.Approvals THEN BEGIN
    IF ApprovalEntry."Table ID" = DATABASE::"Sales Header" THEN BEGIN
    IF SalesHeader.GET(NextApprovalEntry."Document Type",NextApprovalEntry."Document No.") THEN
    ApprovalMgtNotification.SendSalesApprovalsMail(SalesHeader,NextApprovalEntry);
    END ELSE
    IF PurchaseHeader.GET(NextApprovalEntry."Document Type",NextApprovalEntry."Document No.") THEN
    ApprovalMgtNotification.SendPurchaseApprovalsMail(PurchaseHeader,NextApprovalEntry);
    END;

    I think you need to change something in the above code.

    Chn
  • vijay_gvijay_g Member Posts: 884
    You need to check how's the mail system working while rejecting the same doucment. Approval sender is getting rejection mail if the doucment has been rejected.
Sign In or Register to comment.