Skip to content

Commit acda905

Browse files
[Bug] [Subscription Billing]: Subscription lines cannot be open from sales line for27.x (#5386)
<!-- 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 --> #### 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 #5286 Fixes [AB#612606](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/612606)
1 parent dc1353f commit acda905

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ table 8068 "Sales Subscription Line"
8383
MinValue = 0;
8484
BlankZero = true;
8585
AutoFormatType = 1;
86-
AutoFormatExpression = GetCurrency();
86+
AutoFormatExpression = Rec."Currency Code";
8787

8888
trigger OnValidate()
8989
begin
@@ -111,7 +111,7 @@ table 8068 "Sales Subscription Line"
111111
Editable = false;
112112
BlankZero = true;
113113
AutoFormatType = 2;
114-
AutoFormatExpression = GetCurrency();
114+
AutoFormatExpression = Rec."Currency Code";
115115

116116
trigger OnValidate()
117117
var
@@ -144,7 +144,7 @@ table 8068 "Sales Subscription Line"
144144
MinValue = 0;
145145
BlankZero = true;
146146
AutoFormatType = 1;
147-
AutoFormatExpression = GetCurrency();
147+
AutoFormatExpression = Rec."Currency Code";
148148

149149
trigger OnValidate()
150150
begin
@@ -156,7 +156,7 @@ table 8068 "Sales Subscription Line"
156156
Caption = 'Amount';
157157
BlankZero = true;
158158
AutoFormatType = 1;
159-
AutoFormatExpression = GetCurrency();
159+
AutoFormatExpression = Rec."Currency Code";
160160

161161
trigger OnValidate()
162162
begin
@@ -319,7 +319,7 @@ table 8068 "Sales Subscription Line"
319319
Caption = 'Unit Cost';
320320
Editable = false;
321321
AutoFormatType = 2;
322-
AutoFormatExpression = GetCurrency();
322+
AutoFormatExpression = Rec."Currency Code";
323323
}
324324
field(101; "Unit Cost (LCY)"; Decimal)
325325
{
@@ -338,6 +338,13 @@ table 8068 "Sales Subscription Line"
338338
"Unit Cost" := "Unit Cost (LCY)";
339339
end;
340340
}
341+
field(102; "Currency Code"; Code[10])
342+
{
343+
Caption = 'Currency Code';
344+
Editable = false;
345+
FieldClass = FlowField;
346+
CalcFormula = lookup("Sales Header"."Currency Code" where("Document Type" = field("Document Type"), "No." = field("Document No.")));
347+
}
341348
field(8000; "Usage Based Billing"; Boolean)
342349
{
343350
Caption = 'Usage Based Billing';
@@ -815,14 +822,6 @@ table 8068 "Sales Subscription Line"
815822
GetSalesLine(Rec, SalesLine2);
816823
end;
817824

818-
local procedure GetCurrency(): Code[10]
819-
var
820-
SalesHeader: Record "Sales Header";
821-
begin
822-
GetSalesHeader(SalesHeader);
823-
exit(SalesHeader."Currency Code");
824-
end;
825-
826825
local procedure GetSalesLine(SalesSubscriptionLine: Record "Sales Subscription Line"; var SalesLine2: Record "Sales Line")
827826
begin
828827
if (SalesLine."Document Type" <> SalesSubscriptionLine."Document Type")

0 commit comments

Comments
 (0)