SendIndentApproval Request.
rranjanerp
Member Posts: 70
Hello,
If any one can suggest me some code sample for adding function SendIndentApprovalRequest. in the same codeunit 439 . I needed approval mngmt for indent ,but code is not getting complied.
Thanks,
If any one can suggest me some code sample for adding function SendIndentApprovalRequest. in the same codeunit 439 . I needed approval mngmt for indent ,but code is not getting complied.
Thanks,
0
Comments
-
I am sorry , If I am directly asking for codeunit sample..
Plz suggest my main problem is how to use document type here , though i have not made any field in indent header with name document type ..i am using
varDocumentType::"None". how to correct this code..
// sendindentapprovalrequest//
TestSetup;
WITH IndentHeader DO BEGIN
IF Status <> Status::Open THEN
EXIT(FALSE);
IF NOT ApprovalSetup.GET THEN
ERROR(Text004);
IF NOT IndentLinesExist THEN
ERROR(Text015,'Indent',"No.");
TemplateRec.SETCURRENTKEY("Table ID","Document Type",Enabled);
TemplateRec.SETRANGE("Table ID",DATABASE::"Indent Header");
//Test := 'None';
//EVALUATE(TemplateRec."Document Type",Test);
TemplateRec.SETRANGE("Document Type",varDocumentType::None);
TemplateRec.SETRANGE(Enabled,TRUE);
IF TemplateRec.FIND('-') THEN BEGIN
REPEAT
IF TemplateRec."Limit Type" = TemplateRec."Limit Type"::"Credit Limits" THEN BEGIN
ERROR(STRSUBSTNO(Text025,FORMAT(TemplateRec."Limit Type"),FORMAT(varDocumentType::None),
"No."));
END ELSE BEGIN
IF NOT FindApproverIndent(IndentHeader,ApprovalSetup,TemplateRec) THEN
ERROR(Text010);
END;
UNTIL TemplateRec.NEXT = 0;
FinishApprovalEntryIndent(IndentHeader,ApprovalSetup,MessageType);
CASE MessageType OF
MessageType::AutomaticPrePayment:MESSAGE(Text128,varDocumentType::None,"No.");
MessageType::AutomaticRelease:MESSAGE(Text003,varDocumentType::None,"No.");
MessageType::RequiresApproval: MESSAGE(Text001,varDocumentType::None,"No.");
END;
END ELSE
ERROR(STRSUBSTNO(Text129,varDocumentType::None));
END;
//makeapproval entry //
//The function make approval entry is showing error of type conversion code :=Record
WITH ApprovalEntry DO BEGIN
SETRANGE("Table ID",TableID);
SETRANGE("Document Type",DocType);
SETRANGE("Document No.",DocNo);
IF FIND('+') THEN
NewSequenceNo := "Sequence No." + 1
ELSE
NewSequenceNo := 1;
"Table ID" := TableID;
"Document Type" := DocType;
"Document No." := DocNo;
"Salespers./Purch. Code" := SalespersonPurchaser;
"Sequence No." := NewSequenceNo;
"Approval Code" := ApprovalCode;
"Sender ID" := USERID;
Amount := ApprovalAmount;
"Amount (LCY)" := ApprovalAmountLCY;
"Currency Code" := CurrencyCode;
"Approver ID" := ApproverId;
IF ApproverId = USERID THEN
Status := Status::Approved
ELSE
Status := Status::Created;
"Date-Time Sent for Approval" := CREATEDATETIME(TODAY,TIME);
"Last Date-Time Modified" := CREATEDATETIME(TODAY,TIME);
"Last Modified By ID" := USERID;
"Due Date" := CALCDATE(ApprovalSetup."Due Date Formula",TODAY);
"Approval Type" := AppTemplate."Approval Type";
"Limit Type" := AppTemplate."Limit Type";
"Available Credit Limit (LCY)" := ExeedAmountLCY;
INSERT;
END;0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions