-
Notifications
You must be signed in to change notification settings - Fork 51
#125 Partner center #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
#125 Partner center #129
Changes from 4 commits
d7489cd
f8a4a7d
7c9367b
1b0a223
bec8ca4
317f761
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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; | ||
| ToolTip = 'Unique code to identify the Partner Center'; | ||
| ValidateTableRelation = true; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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."); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
|
||
| until D4PBCTenant.Next() = 0; | ||
| end; | ||
| } | ||
| } | ||
|
|
||
| keys | ||
|
|
@@ -154,6 +174,10 @@ table 62000 "D4P BC Customer" | |
| { | ||
| Clustered = true; | ||
| } | ||
| key(Key2; "Partner Center Code") | ||
| { | ||
| Clustered = false; | ||
| } | ||
| } | ||
|
|
||
| trigger OnInsert() | ||
|
|
||
| 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; | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| namespace D4P.CCMS.PartnerCenter; | ||
|
||
|
|
||
| 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) | ||
| { | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| 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) | ||
| { | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
| { | ||
|
|
@@ -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 | ||
|
|
@@ -102,6 +110,16 @@ table 62001 "D4P BC Tenant" | |
| } | ||
| } | ||
|
|
||
| trigger OnInsert() | ||
| var | ||
| D4PBCCustomer: Record "D4P BC Customer"; | ||
| begin | ||
| if "Customer No." <> '' then begin | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
There was a problem hiding this comment.
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