Hi @NurNina ,
Firstly, based on the SortByColumns formula that you mentioned, I think there is something wrong with it. The syntax of SortByColumns function as below:
SortByColumns(Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )
Then the"crc82_ItemIDprodmaster" field is a LookUp type field, which is essentially a Record value. You could not specify complex type column as Sort columns within the SortByColumns function.
As an fixed solution, please consider modify your formula as below:
Sort(
SortByColumns(
Filter('Sales Oder Lines', 'Sales Id' = SalesOrderID),
"crc82_itemid", Ascending,
"crc82_inventoryuom", Ascending,
"crc82_salesprice", Ascending,
"crc82_salesqty", Ascending,
"crc82_discount", Ascending,
"crc82_lineamountnew", Ascending
),
ItemIDprodmaster.'Primary Name',
Ascending
)
Note: The 'Primary Name' represents the field in your CDS Entity which the crc82_ItemIDprodmaster" LookUp field references values from. Please replace it with actual field name from your referenced Entity.
Best regards,