Getting error in sorting
i have extended the table "Payment Registration Buffer" table no : 981 i added two new filed which are flow fields and calculated from "sales invoice header"

now, when i open the "register customer payment" and then try to sorting [asc or desc ] with that field

then i am getting following error

guys, do you have any idea about this?
Sorting on a flow field is not possible, if you want to sort on it, it must be a normal field. This applies regardless of the field being defined in a table or an extension to a table.
@RobynGee but I used flow fileds in other tables too and it doesn't give any error see bellow




and even i tried the same fields on another page and its working fine means i am able to do sorting on those fields
Hi! In the last months, we've been working hard on adding new features that increase your productivity and on improving the quality of the tools. Unfortunately, this meant that we were not able to follow up on as many GitHub issues as we have liked. Is this issue still a problem for you? Can you provide a sample project to reproduce the issue? Does it reproduce on the Wave 2 2019 release?
This issue has been closed because it needs more information and has not had recent activity. Please open a new issue if you believe this has not been resolved and reference the current issue.
Hi! In the last months, we've been working hard on adding new features that increase your productivity and on improving the quality of the tools. Unfortunately, this meant that we were not able to follow up on as many GitHub issues as we have liked. Is this issue still a problem for you? Can you provide a sample project to reproduce the issue? Does it reproduce on the Wave 2 2019 release?
Hi @atoader, I work with the original contributor and we are again facing this issue in one of our AppSource extension.
To summarize: when a FlowField is calculated and then used for sorting, there is no issue, so long as the table is NOT declared as temporary.
But when we try the same code with the table declared temporary, we get the following error instead:

This runtime error does not seem like an intention error to me, as it is not very descriptive, nor does it occur during compiling (where it could easily be determined to be in error).
Here is a simple code example that demonstrates this issue:
pageextension 50100 CustomerListExt extends "Customer List"
{
actions
{
addlast("&Customer")
{
action(TestFlowFieldSorting)
{
ApplicationArea = All;
Caption = 'Test Sort on Temp Record FlowField';
trigger OnAction()
var
// When the 'temporary' declaration is removed, there are no errors
tempCustomer: Record Customer temporary;
begin
tempCustomer.CalcFields(TestComment);
tempCustomer.SetCurrentKey(TestComment, "No.");
tempCustomer.SetFilter(TestComment, '<>%1', '');
if tempCustomer.FindSet() then
repeat
Message('In ascending order, first comments are: "%1"', tempCustomer.TestComment);
until tempCustomer.Next() = 0;
end;
}
}
}
}
tableextension 50100 CustomerExt extends "Customer"
{
fields
{
field(5800; TestComment; Text[80])
{
// A simple TEXT based flowfield
// gets the first comment associated with each customer
CalcFormula = LOOKUP("Comment Line".Comment WHERE(
"Table Name" = CONST(Customer),
"No." = FIELD("No."))
);
Caption = 'First Comment';
Editable = false;
FieldClass = FlowField;
}
}
}
Let me know if I am missing a simple property / declaration that would make the above code work. (The temporary table declartion, the SetCurrentKey, and the FieldClass = FlowField are hard to change in our solution)
Does Microsoft plan to support sorting on a Temporary table's FlowFields in the future?
If not, is there documentation that outlines this limitation? In my research so far, I've only ever seen speculation by NAV users / developers that this is a limitation, and nothing from an official source. It would also be nice if this limitation was added to the AL compiler diagnostic messages.