Skip to content

Commit baab559

Browse files
authored
Invalid Date Formula Ratio for Subscription Package Line prevented (#4171)
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> A check whether Billing Base Period have a valid ratio should happen during field validation and not in OnModify trigger for following tables: - table 8002 "Planned Subscription Line" - table 8068 "Sales Subscription Line" - table 8059 "Subscription Line" - table 8056 "Subscription Package Line" #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes #4166 Fixes [AB#597484](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/597484)
1 parent 9600f31 commit baab559

File tree

8 files changed

+150
-56
lines changed

8 files changed

+150
-56
lines changed

src/Apps/W1/Subscription Billing/App/Contract Renewal/Tables/PlannedSubscriptionLine.Table.al

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ table 8002 "Planned Subscription Line"
197197
if Format("Extension Term") = '' then
198198
TestField("Notice Period", "Extension Term");
199199
DateFormulaManagement.ErrorIfDateFormulaNegative("Extension Term");
200+
CheckRatioBetweenBillingBasePeriodAndRhythm();
200201
end;
201202
}
202203
field(23; "Billing Rhythm"; DateFormula)
@@ -206,6 +207,7 @@ table 8002 "Planned Subscription Line"
206207
begin
207208
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Rhythm", FieldCaption("Billing Rhythm"));
208209
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Rhythm");
210+
CheckRatioBetweenBillingBasePeriodAndRhythm();
209211
end;
210212
}
211213
field(24; "Cancellation Possible Until"; Date)
@@ -397,12 +399,6 @@ table 8002 "Planned Subscription Line"
397399
key(Contract; "Subscription Contract No.", "Subscription Contract Line No.") { }
398400
key(Quote; "Sales Quote No.", "Sales Quote Line No.") { }
399401
}
400-
trigger OnModify()
401-
begin
402-
xRec.Get(xRec."Entry No.");
403-
if ((xRec."Billing Base Period" <> Rec."Billing Base Period") or (xRec."Billing Rhythm" <> Rec."Billing Rhythm")) then
404-
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
405-
end;
406402

407403
local procedure CheckServiceDates()
408404
begin
@@ -437,6 +433,13 @@ table 8002 "Planned Subscription Line"
437433
Validate(Price, 0);
438434
end;
439435

436+
local procedure CheckRatioBetweenBillingBasePeriodAndRhythm()
437+
var
438+
begin
439+
if (Format("Billing Base Period") <> '') and (Format("Billing Rhythm") <> '') then
440+
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
441+
end;
442+
440443
var
441444
Currency: Record Currency;
442445
CurrExchRate: Record "Currency Exchange Rate";

src/Apps/W1/Subscription Billing/App/Sales Service Commitments/Tables/SalesSubscriptionLine.Table.al

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ table 8068 "Sales Subscription Line"
181181
trigger OnValidate()
182182
begin
183183
TestIfSalesOrderIsReleased();
184-
DateFormulaManagementGlobal.ErrorIfDateFormulaNegative("Initial Term");
184+
DateFormulaManagement.ErrorIfDateFormulaNegative("Initial Term");
185185
end;
186186
}
187187
field(24; "Notice Period"; DateFormula)
@@ -190,7 +190,7 @@ table 8068 "Sales Subscription Line"
190190
trigger OnValidate()
191191
begin
192192
TestIfSalesOrderIsReleased();
193-
DateFormulaManagementGlobal.ErrorIfDateFormulaNegative("Notice Period");
193+
DateFormulaManagement.ErrorIfDateFormulaNegative("Notice Period");
194194
end;
195195
}
196196
field(25; "Extension Term"; DateFormula)
@@ -201,7 +201,7 @@ table 8068 "Sales Subscription Line"
201201
TestIfSalesOrderIsReleased();
202202
if Format("Extension Term") = '' then
203203
TestField("Notice Period", "Extension Term");
204-
DateFormulaManagementGlobal.ErrorIfDateFormulaNegative("Extension Term");
204+
DateFormulaManagement.ErrorIfDateFormulaNegative("Extension Term");
205205
end;
206206
}
207207
field(26; "Billing Base Period"; DateFormula)
@@ -212,8 +212,9 @@ table 8068 "Sales Subscription Line"
212212
trigger OnValidate()
213213
begin
214214
TestIfSalesOrderIsReleased();
215-
DateFormulaManagementGlobal.ErrorIfDateFormulaEmpty("Billing Base Period", FieldCaption("Billing Base Period"));
216-
DateFormulaManagementGlobal.ErrorIfDateFormulaNegative("Billing Base Period");
215+
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Base Period", FieldCaption("Billing Base Period"));
216+
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Base Period");
217+
CheckRatioBetweenBillingBasePeriodAndRhythm();
217218
end;
218219
}
219220
field(27; "Billing Rhythm"; DateFormula)
@@ -224,8 +225,9 @@ table 8068 "Sales Subscription Line"
224225
trigger OnValidate()
225226
begin
226227
TestIfSalesOrderIsReleased();
227-
DateFormulaManagementGlobal.ErrorIfDateFormulaEmpty("Billing Rhythm", FieldCaption("Billing Rhythm"));
228-
DateFormulaManagementGlobal.ErrorIfDateFormulaNegative("Billing Rhythm");
228+
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Rhythm", FieldCaption("Billing Rhythm"));
229+
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Rhythm");
230+
CheckRatioBetweenBillingBasePeriodAndRhythm();
229231
end;
230232
}
231233
field(28; "Invoicing via"; Enum "Invoicing Via")
@@ -393,9 +395,6 @@ table 8068 "Sales Subscription Line"
393395
trigger OnModify()
394396
begin
395397
TestIfSalesOrderIsReleased();
396-
xRec.Get(xRec."Line No.");
397-
if ((xRec."Billing Base Period" <> Rec."Billing Base Period") or (xRec."Billing Rhythm" <> Rec."Billing Rhythm")) then
398-
DateFormulaManagementGlobal.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
399398
end;
400399

401400
trigger OnDelete()
@@ -688,7 +687,6 @@ table 8068 "Sales Subscription Line"
688687
var
689688
SalesLineVAT: Record "Sales Line";
690689
ContractRenewalMgt: Codeunit "Sub. Contract Renewal Mgt.";
691-
DateFormulaManagement: Codeunit "Date Formula Management";
692690
IsHandled: Boolean;
693691
RhythmIdentifier: Code[20];
694692
ContractRenewalPriceCalculationRatio: Decimal;
@@ -842,6 +840,13 @@ table 8068 "Sales Subscription Line"
842840
SalesLine := NewSalesLine;
843841
end;
844842

843+
local procedure CheckRatioBetweenBillingBasePeriodAndRhythm()
844+
var
845+
begin
846+
if (Format("Billing Base Period") <> '') and (Format("Billing Rhythm") <> '') then
847+
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
848+
end;
849+
845850
[IntegrationEvent(false, false)]
846851
local procedure OnCalculateBaseTypeElseCaseOnCalculateCalculationBaseAmountCustomer(SalesSubscriptionLine: Record "Sales Subscription Line"; SalesLine: Record "Sales Line"; var CalculatedBaseAmount: Decimal; var IsHandled: Boolean)
847852
begin
@@ -876,7 +881,7 @@ table 8068 "Sales Subscription Line"
876881
Currency: Record Currency;
877882
CurrExchRate: Record "Currency Exchange Rate";
878883
SalesLine: Record "Sales Line";
879-
DateFormulaManagementGlobal: Codeunit "Date Formula Management";
884+
DateFormulaManagement: Codeunit "Date Formula Management";
880885
ServiceAmountIncreaseErr: Label '%1 cannot be greater than %2.', Comment = '%1 and %2 are numbers';
881886
ReleasedSalesOrderExistsErr: Label 'Subscription Lines cannot be edited on orders with status = Released.';
882887
CalculateBaseTypeOptionNotImplementedErr: Label 'Unknown option %1 for %2.\\ Object Name: %3, Procedure: %4', Comment = '%1=Format("Calculation Base Type"), %2 = Fieldcaption for "Calculation Base Type", %3 = Current object name, %4 = Current procedure name';

src/Apps/W1/Subscription Billing/App/Service Commitments/Tables/SubscriptionLine.Table.al

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ table 8059 "Subscription Line"
182182
begin
183183
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Base Period", FieldCaption("Billing Base Period"));
184184
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Base Period");
185+
CheckRatioBetweenBillingBasePeriodAndRhythm();
185186
end;
186187
}
187188
field(16; "Invoicing via"; Enum "Invoicing Via")
@@ -254,6 +255,7 @@ table 8059 "Subscription Line"
254255
begin
255256
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Rhythm", FieldCaption("Billing Rhythm"));
256257
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Rhythm");
258+
CheckRatioBetweenBillingBasePeriodAndRhythm();
257259
end;
258260
}
259261
field(24; "Cancellation Possible Until"; Date)
@@ -595,9 +597,6 @@ table 8059 "Subscription Line"
595597

596598
trigger OnModify()
597599
begin
598-
xRec.Get(xRec."Entry No.");
599-
if ((xRec."Billing Base Period" <> Rec."Billing Base Period") or (xRec."Billing Rhythm" <> Rec."Billing Rhythm")) then
600-
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
601600
DisplayErrorIfContractLinesExist(ClosedContractLineExistErr, true);
602601
SetUpdateRequiredOnBillingLines();
603602
UpdateCustomerContractLineServiceCommitmentDescription();
@@ -1925,6 +1924,13 @@ table 8059 "Subscription Line"
19251924
end;
19261925
end;
19271926

1927+
local procedure CheckRatioBetweenBillingBasePeriodAndRhythm()
1928+
var
1929+
begin
1930+
if (Format("Billing Base Period") <> '') and (Format("Billing Rhythm") <> '') then
1931+
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
1932+
end;
1933+
19281934
[IntegrationEvent(false, false)]
19291935
local procedure OnAfterUpdateNextBillingDate(var SubscriptionLine: Record "Subscription Line"; LastBillingToDate: Date)
19301936
begin

src/Apps/W1/Subscription Billing/App/Service Commitments/Tables/SubscriptionPackageLine.Table.al

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ table 8056 "Subscription Package Line"
108108
trigger OnValidate()
109109
begin
110110
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Base Period");
111+
CheckRatioBetweenBillingBasePeriodAndRhythm();
111112
end;
112113
}
113114
field(11; "Billing Rhythm"; DateFormula)
@@ -117,6 +118,7 @@ table 8056 "Subscription Package Line"
117118
begin
118119
DateFormulaManagement.ErrorIfDateFormulaEmpty("Billing Rhythm", FieldCaption("Billing Rhythm"));
119120
DateFormulaManagement.ErrorIfDateFormulaNegative("Billing Rhythm");
121+
CheckRatioBetweenBillingBasePeriodAndRhythm();
120122
end;
121123
}
122124
field(12; "Sub. Line Start Formula"; DateFormula)
@@ -221,12 +223,6 @@ table 8056 "Subscription Package Line"
221223
Clustered = true;
222224
}
223225
}
224-
trigger OnModify()
225-
begin
226-
xRec.Get(xRec."Subscription Package Code", xRec."Line No.");
227-
if ((xRec."Billing Base Period" <> Rec."Billing Base Period") or (xRec."Billing Rhythm" <> Rec."Billing Rhythm")) then
228-
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
229-
end;
230226

231227
var
232228
DateFormulaManagement: Codeunit "Date Formula Management";
@@ -303,4 +299,11 @@ table 8056 "Subscription Package Line"
303299
begin
304300
exit(Rec.Partner = Rec.Partner::Vendor);
305301
end;
302+
303+
local procedure CheckRatioBetweenBillingBasePeriodAndRhythm()
304+
var
305+
begin
306+
if (Format("Billing Base Period") <> '') and (Format("Billing Rhythm") <> '') then
307+
DateFormulaManagement.CheckIntegerRatioForDateFormulas("Billing Base Period", FieldCaption("Billing Base Period"), "Billing Rhythm", FieldCaption("Billing Rhythm"));
308+
end;
306309
}

src/Apps/W1/Subscription Billing/Test/Base/ContractTestLibrary.Codeunit.al

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,6 @@ codeunit 139685 "Contract Test Library"
11451145
Clear(ServiceCommitment."Billing Base Period");
11461146
Clear(ServiceCommitment."Billing Rhythm");
11471147
Evaluate(ServiceCommitment."Billing Base Period", BillingBasePeriodText);
1148-
ServiceCommitment.Validate("Billing Base Period");
11491148
Evaluate(ServiceCommitment."Billing Rhythm", BillingRhythmText);
11501149
ServiceCommitment.Validate("Billing Rhythm");
11511150
end;

src/Apps/W1/Subscription Billing/Test/Service Commitments/SalesServiceCommitmentTest.Codeunit.al

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ codeunit 139915 "Sales Service Commitment Test"
6464
NoOfServiceObjects: Integer;
6565
NotCreatedProperlyErr: Label 'Subscription Lines are not created properly.';
6666
SalesServiceCommitmentCannotBeDeletedErr: Label 'The Sales Subscription Line cannot be deleted, because it is the last line with Process Contract Renewal. Please delete the Sales line in order to delete the Sales Subscription Line.', Locked = true;
67+
NaturalNumberRatioErr: Label 'The ratio of ''%1'' and ''%2'' or vice versa must give a natural number.', Comment = '%1=Field Caption, %2=Field Caption';
6768

6869
#region Tests
6970

@@ -1267,6 +1268,38 @@ codeunit 139915 "Sales Service Commitment Test"
12671268
LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, Item."No.", LibraryRandom.RandIntInRange(1, 100));
12681269
end;
12691270

1271+
[Test]
1272+
procedure PreventInvalidDateFormulaRatioForSalesSubscriptionLine()
1273+
var
1274+
TwelveMonthsDateFormula: DateFormula;
1275+
FifteenMonthsDateFormula: DateFormula;
1276+
begin
1277+
// [SCENARIO] When a Sales Subscription Line has been created with a Billing Base Period and a Billing Rhythm that do not have a valid ratio, the error is thrown as soon as an invalid date formula is entered
1278+
1279+
// [GIVEN] When a Sales Subscription Line with Billing Base Period and Billing Rhythm equal to 12M has been created
1280+
Initialize();
1281+
Evaluate(TwelveMonthsDateFormula, '<12M>');
1282+
ServiceCommPackageLine.Validate("Billing Base Period", TwelveMonthsDateFormula);
1283+
ServiceCommPackageLine.Validate("Billing Rhythm", TwelveMonthsDateFormula);
1284+
ServiceCommPackageLine.Modify(false);
1285+
ContractTestLibrary.SetupSalesServiceCommitmentItemAndAssignToServiceCommitmentPackage(Item, Enum::"Item Service Commitment Type"::"Service Commitment Item", ServiceCommitmentPackage.Code);
1286+
LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Quote, '');
1287+
LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, Item."No.", LibraryRandom.RandIntInRange(1, 100));
1288+
1289+
Commit(); // retain data after asserterror
1290+
1291+
// [WHEN] An invalid date formula is created for the purpose of validating Billing Base Period and Billing Rhythm
1292+
Evaluate(FifteenMonthsDateFormula, '<15M>');
1293+
1294+
// [THEN] Error expected when invalid date formula is entered for Billing Base Period or Billing Rhythm
1295+
SalesServiceCommitment.FilterOnSalesLine(SalesLine);
1296+
SalesServiceCommitment.FindFirst();
1297+
asserterror SalesServiceCommitment.Validate("Billing Base Period", FifteenMonthsDateFormula);
1298+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, SalesServiceCommitment.FieldCaption("Billing Base Period"), SalesServiceCommitment.FieldCaption("Billing Rhythm")));
1299+
asserterror SalesServiceCommitment.Validate("Billing Rhythm", FifteenMonthsDateFormula);
1300+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, SalesServiceCommitment.FieldCaption("Billing Base Period"), SalesServiceCommitment.FieldCaption("Billing Rhythm")));
1301+
end;
1302+
12701303
[Test]
12711304
procedure RunNormalSalesServiceCommitmentDeletion()
12721305
begin

src/Apps/W1/Subscription Billing/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ codeunit 148156 "Service Commitment Test"
2525
LibrarySales: Codeunit "Library - Sales";
2626
LibraryTestInitialize: Codeunit "Library - Test Initialize";
2727
PackageLineMissingInvoicingItemNoErr: Label 'The %1 %2 can not be used with Item %3, because at least one of the Service Commitment Package lines is missing an %4.', Locked = true;
28+
NaturalNumberRatioErr: Label 'The ratio of ''%1'' and ''%2'' or vice versa must give a natural number.', Comment = '%1=Field Caption, %2=Field Caption';
2829

2930
#region Tests
3031

@@ -308,6 +309,54 @@ codeunit 148156 "Service Commitment Test"
308309
asserterror ServiceCommitment.Modify(true);
309310
end;
310311

312+
[Test]
313+
procedure PreventInvalidDateFormulaRatioForSubscriptionLine()
314+
var
315+
FifteenMonthsDateFormula: DateFormula;
316+
begin
317+
// [SCENARIO] When a Subscription Line has been created with a Billing Base Period and a Billing Rhythm that do not have a valid ratio, the error is thrown as soon as an invalid date formula is entered
318+
319+
// [GIVEN] A single Subscription Line with Billing Base Period and Billing Rhythm equal to 12M has been created
320+
Initialize();
321+
ContractTestLibrary.CreateServiceObjectForItemWithServiceCommitments(ServiceObject, Enum::"Invoicing Via"::Contract, false, Item, 1, 0, '<12M>', '<12M>');
322+
323+
Commit(); // retain data after asserterror
324+
325+
// [WHEN] An invalid date formula is created for the purpose of validating Billing Base Period and Billing Rhythm
326+
Evaluate(FifteenMonthsDateFormula, '<15M>');
327+
328+
// [THEN] Error expected when invalid date formula is entered for Billing Base Period or Billing Rhythm
329+
ServiceCommitment.SetRange("Subscription Header No.", ServiceObject."No.");
330+
ServiceCommitment.FindFirst();
331+
asserterror ServiceCommitment.Validate("Billing Base Period", FifteenMonthsDateFormula);
332+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, ServiceCommitment.FieldCaption("Billing Base Period"), ServiceCommitment.FieldCaption("Billing Rhythm")));
333+
asserterror ServiceCommitment.Validate("Billing Rhythm", FifteenMonthsDateFormula);
334+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, ServiceCommitment.FieldCaption("Billing Base Period"), ServiceCommitment.FieldCaption("Billing Rhythm")));
335+
end;
336+
337+
[Test]
338+
procedure PreventInvalidDateFormulaRatioForSubscriptionPackageLine()
339+
var
340+
FifteenMonthsDateFormula: DateFormula;
341+
begin
342+
// [SCENARIO] When a Subscription Package Line has been created with a Billing Base Period and a Billing Rhythm that do not have a valid ratio, the error is thrown as soon as an invalid date formula is entered
343+
344+
// [GIVEN] A single Subscription Package Line with Billing Base Period and Billing Rhythm equal to 12M has been created
345+
Initialize();
346+
ContractTestLibrary.CreateServiceCommitmentPackageWithLine('', ServiceCommitmentPackage, ServiceCommPackageLine);
347+
Commit(); // retain data after asserterror
348+
349+
// [WHEN] An invalid date formula is created for the purpose of validating Billing Base Period and Billing Rhythm
350+
Evaluate(FifteenMonthsDateFormula, '<15M>');
351+
352+
// [THEN] Error expected when invalid date formula is entered for Billing Base Period or Billing Rhythm
353+
asserterror ServiceCommPackageLine.Validate("Billing Base Period", FifteenMonthsDateFormula);
354+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, ServiceCommPackageLine.FieldCaption("Billing Base Period"), ServiceCommPackageLine.FieldCaption("Billing Rhythm")));
355+
asserterror ServiceCommPackageLine.Validate("Billing Rhythm", FifteenMonthsDateFormula);
356+
Assert.ExpectedError(StrSubstNo(NaturalNumberRatioErr, ServiceCommPackageLine.FieldCaption("Billing Base Period"), ServiceCommPackageLine.FieldCaption("Billing Rhythm")));
357+
end;
358+
359+
311360
[Test]
312361
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
313362
procedure TestOverdueServiceCommitments()
@@ -463,14 +512,14 @@ codeunit 148156 "Service Commitment Test"
463512

464513
local procedure ValidateDateFormulaCombinations(DateFormulaText1: Text; DateFormulaText2: Text)
465514
var
466-
DateFormula1: DateFormula;
515+
EvaluatedDateFormula: DateFormula;
467516
begin
468517
ServiceCommPackageLine.Get(ServiceCommPackageLine."Subscription Package Code", ServiceCommPackageLine."Line No.");
469-
Evaluate(DateFormula1, DateFormulaText1);
470-
ServiceCommPackageLine."Billing Base Period" := DateFormula1;
471-
Evaluate(DateFormula1, DateFormulaText2);
472-
ServiceCommPackageLine."Billing Rhythm" := DateFormula1;
473-
ServiceCommPackageLine.Modify(true);
518+
Evaluate(EvaluatedDateFormula, DateFormulaText1);
519+
ServiceCommPackageLine."Billing Base Period" := EvaluatedDateFormula;
520+
Evaluate(EvaluatedDateFormula, DateFormulaText2);
521+
ServiceCommPackageLine.Validate("Billing Rhythm", EvaluatedDateFormula);
522+
ServiceCommPackageLine.Modify(false);
474523
end;
475524

476525
#endregion Procedures

0 commit comments

Comments
 (0)