Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions Apps/W1/APIV2/app/src/pages/APIV2ApprovalEntries.Page.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace System.Automation;

page 30094 "APIV2 - Approval Entries"
{
APIGroup = 'auditing';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are going to be a separate group, then they shouldn't be in APIV2 app. Instead they should get their own app.

APIPublisher = 'microsoft';
APIVersion = 'v2.0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

microsoft/auditing is a new API path, why v2.0?

  • Either no new path and part of standard APIs (not favorable)
  • Or new app (favorable)

EntityCaption = 'Approval Entry';
EntitySetCaption = 'Approval Entries';
EntityName = 'approvalEntry';
EntitySetName = 'approvalEntries';
Editable = false;
DeleteAllowed = false;
InsertAllowed = false;
ModifyAllowed = false;
DataAccessIntent = ReadOnly;
PageType = API;
SourceTable = "Approval Entry";
ODataKeyFields = SystemId;

layout
{
area(Content)
{
repeater(Control1)
{
field(id; Rec.SystemId)
{
Caption = 'Id';
}
field(entryNumber; Rec."Entry No.")
{
Caption = 'Entry No.';
}
field(tableId; Rec."Table ID")
{
Caption = 'Table ID';
}
field(documentType; Rec."Document Type")
{
Caption = 'Document Type';
}
field(documentNumber; Rec."Document No.")
{
Caption = 'Document No.';
}
field(sequenceNumber; Rec."Sequence No.")
{
Caption = 'Sequence No.';
}
field(senderId; Rec."Sender ID")
{
Caption = 'Sender Id';
}
field(senderName; Rec."Sender Full Name")
{
Caption = 'Sender Full Name';
}
field(approvalCode; Rec."Approval Code")
{
Caption = 'Approval Code';
}
field(salespersonPurchaserCode; Rec."Salespers./Purch. Code")
{
Caption = 'Salesperson/Purchaser Code';
}
field(salespersonPurchaserName; Rec."Salespers./Purch. Name")
{
Caption = 'Salesperson/Purchaser Name';
}
field(approverId; Rec."Approver ID")
{
Caption = 'Approver Id';
}
field(approverName; Rec."Approver Full Name")
{
Caption = 'Approver Full Name';
}
field(status; Rec.Status)
{
Caption = 'Status';
}
field(dateTimeSentForApproval; Rec."Date-Time Sent for Approval")
{
Caption = 'Date-Time Sent for Approval';
}
field(lastDateTimeModified; Rec."Last Date-Time Modified")
{
Caption = 'Last Date-Time Modified';
}
field(comment; Rec.Comment)
{
Caption = 'Comment';
}
field(dueDate; Rec."Due Date")
{
Caption = 'Due Date';
}
field(amount; Rec.Amount)
{
Caption = 'Amount';
}
field(amountLCY; Rec."Amount (LCY)")
{
Caption = 'Amount (LCY)';
}
field(currencyCode; Rec."Currency Code")
{
Caption = 'Currency Code';
}
field(approvalType; Rec."Approval Type")
{
Caption = 'Approval Type';
}
field(limitType; Rec."Limit Type")
{
Caption = 'Limit Type';
}
field(availableCreditLimitLCY; Rec."Available Credit Limit (LCY)")
{
Caption = 'Available Credit Limit (LCY)';
}
field(pendingApprovals; Rec."Pending Approvals")
{
Caption = 'Pending Approvals';
}
field(recordId; Rec."Record ID to Approve")
{
Caption = 'Record Id to Approve';
}
field(delegationDateFormula; Rec."Delegation Date Formula")
{
Caption = 'Delegation Date Formula';
}
field(numberOfApprovedRequests; Rec."Number of Approved Requests")
{
Caption = 'Number of Approved Requests';
}
field(numberOfRejectedRequests; Rec."Number of Rejected Requests")
{
Caption = 'Number of Rejected Requests';
}
field(relatedToChange; Rec."Related to Change")
{
Caption = 'Related to Change';
}
field(workflowStepInstanceId; Rec."Workflow Step Instance ID")
{
Caption = 'Workflow Step Instance Id';
}
}
}
}
}
108 changes: 108 additions & 0 deletions Apps/W1/APIV2/app/src/pages/APIV2ApprovalUserSetup.Page.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace System.Automation;
using System.Security.AccessControl;
using System.Security.User;

page 30095 "APIV2 - Approval User Setup"
{
APIGroup = 'auditing';
APIPublisher = 'microsoft';
APIVersion = 'v2.0';
EntityCaption = 'Approval User Setup';
EntitySetCaption = 'Approval User Setups';
EntityName = 'approvalUserSetup';
EntitySetName = 'approvalUserSetup';
Editable = false;
DeleteAllowed = false;
InsertAllowed = false;
ModifyAllowed = false;
DataAccessIntent = ReadOnly;
PageType = API;
SourceTable = "User Setup";
ODataKeyFields = SystemId;

layout
{
area(Content)
{
repeater(Control1)
{
field(id; Rec.SystemId)
{
Caption = 'Id';
}
field(userId; Rec."User ID")
{
Caption = 'User Id';
}
field(userFullName; UserFullName)
{
Caption = 'User Full Name';
}
field(salesPersonPurchaser; Rec."Salespers./Purch. Code")
{
Caption = 'Salespers./Purch. Code';
}
field(approverId; Rec."Approver ID")
{
Caption = 'Approver Id';
}
field(salesAmountApprovalLimit; Rec."Sales Amount Approval Limit")
{
Caption = 'Sales Amount Approval Limit';
}
field(unlimitedSalesApproval; Rec."Unlimited Sales Approval")
{
Caption = 'Unlimited Sales Approval';
}
field(purchaseAmountApprovalLimit; Rec."Purchase Amount Approval Limit")
{
Caption = 'Purchase Amount Approval Limit';
}
field(unlimitedPurchaseApproval; Rec."Unlimited Purchase Approval")
{
Caption = 'Unlimited Purchase Approval';
}
field(requestApprovalAmountLimit; Rec."Request Amount Approval Limit")
{
Caption = 'Request Amount Approval Limit';
}
field(unlimitedRequestApprovalAmount; Rec."Unlimited Request Approval")
{
Caption = 'Unlimited Request Approval';
}
field(substitute; Rec.Substitute)
{
Caption = 'Substitute';
}
field(email; Rec."E-Mail")
{
Caption = 'E-Mail';
}
field(phoneNumber; Rec."Phone No.")
{
Caption = 'Phone No.';
}
field(approvalAdmin; Rec."Approval Administrator")
{
Caption = 'Approval Administrator';
}
}
}
}

var
UserFullName: Text;

trigger OnAfterGetRecord()
var
User: Record User;
begin
User.SetRange("User Name", Rec."User ID");
if User.FindFirst() then
UserFullName := User."Full Name";
end;
}
Loading