hi, we have the same problem as discussed in Sorting binded documents but in current Version 2025.06-ext4:
As we already clarified in the related topic, Sorting of “Selected Itemes Overview” in a composed FormModel is only possible in Frontend client. This is documented here: GetA12
I’ve copied that code and here is the complete source:
import { call, SagaGenerator } from 'typed-redux-saga';
import { DataOperation, maybeAsyncFnWrapper, OverviewEngineDataLoader } from '@com.mgmtp.a12.overviewengine/overviewengine-core';
import { Query } from '@com.mgmtp.a12.dataservices/dataservices-access';
import { OverviewEngineFactories } from '@com.mgmtp.a12.overviewengine/overviewengine-core/lib/main/client-extensions';
export const CustomOvDataLoader: OverviewEngineDataLoader = {
*provideData(params): SagaGenerator<DataOperation.ResultSet> {
const { queries, documentModel } = params;
const [query, ...otherQueries] = queries;
let updatedQuery = query;
if (DataOperation.ListDocuments.Query.isAssignableFrom(query) && documentModel.header.id === "Beleg_DM") {
updatedQuery = {
...query,
sort: [
{
field: "/Beleg/LaufendeNummer",
direction: Query.Direction.ASC,
ignoreCase: false,
nullHandling: Query.NullHandling.NULLS_LAST
}
]
};
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return yield* call(maybeAsyncFnWrapper(OverviewEngineFactories.dataLoader.provideData), {
...params,
queries: [updatedQuery, ...otherQueries]
});
}
};
but now we’re struggling on integration in appsetup.ts. Tried it like this GetA12 and as follows, but we are not able to integrate that DataLoader for OverviewEngine:
export function setup(): {
config: ApplicationSetup;
initialStoreActions(): Promise<void>;
} {
const dataHandlers: DataHandler[] = [
createCddDataProvider(),
createEmptyDocumentDataProvider(),
RelationshipFactories.createRelationshipDataProvider(),
...OverviewEngineFactories.createDataProviders({ dataLoader: CustomOvDataLoader }),
platformSingleDocumentDataProvider
];
What would be the right way? Could You please provide a working code snippet?
I’ve read about sample code for 2024.06 but unable to find it.
Best Regards, Gunther