Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
24 changes: 24 additions & 0 deletions CCMS/src/Customer/D4PBCCustomer.table.al
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace D4P.CCMS.Customer;
using D4P.CCMS.Environment;
using D4P.CCMS.Setup;
using D4P.CCMS.Tenant;
using D4P.CCMS.PartnerCenter;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.NoSeries;
using System.EMail;
Expand Down Expand Up @@ -146,6 +147,25 @@ table 62000 "D4P BC Customer"
FieldClass = FlowField;
ToolTip = 'Number of active sandbox environments for this customer';
}
field(24; "Partner Center Code"; Code[20])
{
Caption = 'Partner Center';
TableRelation = "D4P BC Partner Center".Code;
Copy link
Contributor

Choose a reason for hiding this comment

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

.Code is not needed if is primary key

ToolTip = 'Unique code to identify the Partner Center';
ValidateTableRelation = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Default value - I would skip for clean code.


trigger OnValidate()
var
D4PBCTenant: Record "D4P BC Tenant";
begin
D4PBCTenant.SetRange("Customer No.", "No.");
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to add confirm before - since if customer is moved to specific Partner Center it does not mean that existing Tenants are moved right away.

Copy link
Author

Choose a reason for hiding this comment

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

Why would you change Partner Center if the tenant is not moved, this is to locate where to find the customer connection, but I do see it as a failure check to make sure you don't move by a mistake :)

if D4PBCTenant.FindSet() then
repeat
D4PBCTenant.Validate("Partner Center Code", "Partner Center Code");
D4PBCTenant.Modify();
Copy link
Contributor

Choose a reason for hiding this comment

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

add (true)

until D4PBCTenant.Next() = 0;
end;
}
}

keys
Expand All @@ -154,6 +174,10 @@ table 62000 "D4P BC Customer"
{
Clustered = true;
}
key(Key2; "Partner Center Code")
{
Clustered = false;
}
}

trigger OnInsert()
Expand Down
3 changes: 3 additions & 0 deletions CCMS/src/Customer/D4PBCCustomerCard.page.al
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ page 62001 "D4P BC Customer Card"
{
Importance = Promoted;
}
field("Partner Center Code"; Rec."Partner Center Code")
{
}
}
group("Address & Contact")
{
Expand Down
3 changes: 3 additions & 0 deletions CCMS/src/Customer/D4PBCCustomersList.page.al
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ page 62000 "D4P BC Customers List"
field(Name; Rec.Name)
{
}
field("Partner Center Code"; Rec."Partner Center Code")
{
}
field(City; Rec.City)
{
}
Expand Down
31 changes: 31 additions & 0 deletions CCMS/src/PartnerCenter/D4PBCPartnerCenter.Table.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace D4P.CCMS.PartnerCenter;

table 62006 "D4P BC Partner Center"
{
Caption = 'Partner Center';
DataClassification = CustomerContent;
DrillDownPageId = "D4P BC Partner Center List";
LookupPageId = "D4P BC Partner Center List";

fields
{
field(1; "Code"; Code[20])
{
Caption = 'Code';
NotBlank = true;
ToolTip = 'Unique code to identify the Partner Center';
}
field(2; Description; Text[100])
{
Caption = 'Description';
ToolTip = 'Partner Center description';
}
}
keys
{
key(PK; "Code")
{
Clustered = true;
}
}
}
27 changes: 27 additions & 0 deletions CCMS/src/PartnerCenter/D4PBCPartnerCenterCard.Page.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace D4P.CCMS.PartnerCenter;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a card for the Partner Centers? I think it is just a simple dictionary but might be wrong.


page 62033 "D4P BC Partner Center Card"
{
ApplicationArea = All;
Caption = 'Partner Center Card';
PageType = Card;
SourceTable = "D4P BC Partner Center";

layout
{
area(Content)
{
group(General)
{
Caption = 'General';

field("Code"; Rec."Code")
{
}
field(Description; Rec.Description)
{
}
}
}
}
}
28 changes: 28 additions & 0 deletions CCMS/src/PartnerCenter/D4PBCPartnerCenterList.Page.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace D4P.CCMS.PartnerCenter;

page 62032 "D4P BC Partner Center List"
{
ApplicationArea = All;
Caption = 'Partner Center List';
CardPageId = "D4P BC Partner Center Card";
Editable = false;
PageType = List;
SourceTable = "D4P BC Partner Center";
UsageCategory = Lists;

layout
{
area(Content)
{
repeater(General)
{
field("Code"; Rec."Code")
{
}
field(Description; Rec.Description)
{
}
}
}
}
}
5 changes: 5 additions & 0 deletions CCMS/src/Permissions/D4PBCAdmin.permissionset.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using D4P.CCMS.Customer;
using D4P.CCMS.Environment;
using D4P.CCMS.Extension;
using D4P.CCMS.Features;
using D4P.CCMS.PartnerCenter;
using D4P.CCMS.General;
using D4P.CCMS.Operations;
using D4P.CCMS.Session;
Expand Down Expand Up @@ -40,6 +41,7 @@ permissionset 62000 "D4P BC ADMIN"
tabledata "D4P BC Admin Center Cue" = RIMD,
tabledata "D4P PTE Object Range" = RIMD,
tabledata "D4P BC Environment Operation" = RIMD,
tabledata "D4P BC Partner Center" = RIMD,

// Table Objects
table "D4P BC Customer" = X,
Expand All @@ -62,6 +64,7 @@ permissionset 62000 "D4P BC ADMIN"
table "D4P BC Admin Center Cue" = X,
table "D4P PTE Object Range" = X,
table "D4P BC Environment Operation" = X,
table "D4P BC Partner Center" = X,

// Pages
page "D4P BC Customers List" = X,
Expand Down Expand Up @@ -98,6 +101,8 @@ permissionset 62000 "D4P BC ADMIN"
page "D4P BC Customer FactBox" = X,
page "D4P BC Admin Headline" = X,
page "D4P BC Capacity List" = X,
page "D4P BC Partner Center Card" = X,
page "D4P BC Partner Center List" = X,

// Codeunits
codeunit "D4P BC Environment Mgt" = X,
Expand Down
5 changes: 5 additions & 0 deletions CCMS/src/Permissions/D4PBCAdminRead.permissionset.al
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using D4P.CCMS.Customer;
using D4P.CCMS.Environment;
using D4P.CCMS.Extension;
using D4P.CCMS.Features;
using D4P.CCMS.PartnerCenter;
using D4P.CCMS.Operations;
using D4P.CCMS.General;
using D4P.CCMS.Session;
Expand Down Expand Up @@ -37,6 +38,7 @@ permissionset 62001 "D4P BC ADMIN READ"
tabledata "D4P AppInsights Connection" = R,
tabledata "D4P PTE Object Range" = R,
tabledata "D4P BC Environment Operation" = R,
tabledata "D4P BC Partner Center" = R,

// Table Objects
table "D4P BC Customer" = X,
Expand All @@ -57,6 +59,7 @@ permissionset 62001 "D4P BC ADMIN READ"
table "D4P AppInsights Connection" = X,
table "D4P PTE Object Range" = X,
table "D4P BC Environment Operation" = X,
table "D4P BC Partner Center" = X,

// Pages - List and Card pages for viewing
page "D4P BC Customers List" = X,
Expand Down Expand Up @@ -85,6 +88,8 @@ permissionset 62001 "D4P BC ADMIN READ"
page "D4P BC Customer FactBox" = X,
page "D4P BC Admin Headline" = X,
page "D4P BC Capacity List" = X,
page "D4P BC Partner Center Card" = X,
page "D4P BC Partner Center List" = X,

// Codeunit for reading data
codeunit "D4P BC Environment Mgt" = X,
Expand Down
18 changes: 18 additions & 0 deletions CCMS/src/Tenant/D4PBCTenant.table.al
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace D4P.CCMS.Tenant;

using D4P.CCMS.Auth;
using D4P.CCMS.Customer;
using D4P.CCMS.PartnerCenter;

table 62001 "D4P BC Tenant"
{
Expand Down Expand Up @@ -92,6 +93,13 @@ table 62001 "D4P BC Tenant"
FieldClass = FlowField;
ToolTip = 'Specifies the name of the customer associated with this tenant.';
}
field(12; "Partner Center Code"; Code[20])
{
Caption = 'Partner Center';
ToolTip = 'Unique code to identify the Partner Center';
TableRelation = "D4P BC Partner Center".Code;
ValidateTableRelation = true;
}
}

keys
Expand All @@ -102,6 +110,16 @@ table 62001 "D4P BC Tenant"
}
}

trigger OnInsert()
var
D4PBCCustomer: Record "D4P BC Customer";
begin
if "Customer No." <> '' then begin
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add it on validate of Customer but maybe there are places that customer is not validated when created then make sense to have it here.

Copy link
Author

Choose a reason for hiding this comment

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

Customers are made before the tenants are imported, so if the Partner Center is added when the customer is created, the partner center isn't added on creation and should a customer get a second tenant, it can be added and the partner center will follow.

D4PBCCustomer.Get("Customer No.");
"Partner Center Code" := D4PBCCustomer."Partner Center Code";
end;

end;
/// <summary>
/// Gets the client secret from isolated storage for this tenant's configured Client ID.
/// If the Client ID is a null GUID, or a secret has not been set for this Client ID then an empty SecretText will be returned.
Expand Down
3 changes: 3 additions & 0 deletions CCMS/src/Tenant/D4PBCTenantCard.page.al
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ page 62011 "D4P BC Tenant Card"
field("Tenant Name"; Rec."Tenant Name")
{
}
field("Partner Center Code"; Rec."Partner Center Code")
{
}
}
group(Authentication)
{
Expand Down
3 changes: 3 additions & 0 deletions CCMS/src/Tenant/D4PBCTenantList.page.al
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ page 62002 "D4P BC Tenant List"
field("Tenant Name"; Rec."Tenant Name")
{
}
field("Partner Center Code"; Rec."Partner Center Code")
{
}
}
}
area(FactBoxes)
Expand Down
Loading