Issue on Send approval Request ?

manikandan
Member Posts: 160
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
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
0
Comments
-
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.
Chn0 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions