Skip to content

Change History section doesn't appear after passage to CDS 9 #220

@dimdusart

Description

@dimdusart

Hello,

We have updated our cap app to CDS 9 with also the latest version of this plugin for a production app we have.

Based on my db/schema.cds :

entity PurchaseOrders : cuid, managed {
    orderNumber          : String   @assert.unique  @mandatory;
    ...
    status               : Association to Status default '1';
    items                : Composition of many PurchaseOrderItems
                               on items.order = $self;
    comments             : Association to many PurchaseOrderComments
                               on comments.order = $self;
    quanTagStatus        : String;
    quanTagText          : String;
}

@Capabilities.DeleteRestrictions: {Deletable: false}
@Capabilities.InsertRestrictions: {Insertable: false}
entity PurchaseOrderItems : cuid, managed {
    order                    : Association to PurchaseOrders;
    itemNumber               : String not null                                                                                    @readonly  @assert.unique;
    originalReadyDate        : Date                                                                                               @readonly;
    confirmedReadyDate       : Date                                                                                               @readonly;

    @Measures.Unit       : 'PC'
    quantityInCases          : Decimal                                                                                            @readonly;

    @Measures.Unit       : 'PC'
    confirmedQuantityInCases : Decimal(13, 3)                                                                                     @mandatory;

    @Measures.Unit       : 'PC'
    quantityInUnits          : Decimal = cartonPack * (confirmedQuantityInCases > 0 ? confirmedQuantityInCases : quantityInCases) @readonly;

    @Measures.Unit       : unitOfVolume
    volume                   : Decimal(13, 3)                                                                                     @readonly;

    @Measures.Unit       : unitOfVolume
    confirmedVolume          : Decimal(13, 3)                                                                                     @readonly;
    unitOfVolume             : String                                                                                             @readonly;

    @Measures.Unit       : unitOfWeight
    weight                   : Decimal(13, 3)                                                                                     @readonly;

    @Measures.Unit: unitOfWeight
    confirmedWeight          : Decimal(13, 3);
    unitOfWeight             : String                                                                                             @readonly;
}

I have a service.cds with the changelog annotation :

entity PurchaseOrders            as
        projection on db.PurchaseOrders {
                *,
                null as originalReadyDate : Date @readonly,
                true as canDisplayApproverButtons: Boolean
        };

    entity PurchaseOrderItems        as
        projection on db.PurchaseOrderItems {
            *,
            false as canEnableSwitchToReject  : Boolean,
            false as isWitchToRejectVisible   : Boolean,
            false as isTagForRejectionVisible : Boolean
        }

change-tracking.cds :

using {VendorConfirmationService} from './service';
using from '@cap-js/change-tracking';

annotate VendorConfirmationService.PurchaseOrders with @changelog: [orderNumber] {
    status @changelog                                            : [status.name];
};

annotate VendorConfirmationService.PurchaseOrderItems with  @title: '{i18n>Itemnumber}'  @changelog: [
    order,
    itemNumber
]  {
    confirmedReadyDate        @changelog  @Common.Label                                            : '{i18n>Confirmedreadydate}';
    confirmedQuantityInCases  @changelog  @Common.Label                                            : '{i18n>Confirmedquantityincases}';
    volume                    @changelog  @Common.Label                                            : '{i18n>cartonVolume}';
    weight                    @changelog  @Common.Label                                            : '{i18n>cartonWeight}';
};

annotate sap.changelog.aspect @(UI.Facets: [{
    $Type        : 'UI.ReferenceFacet',
    ID           : 'ChangeHistoryFacet',
    Label        : '{i18n>ChangeHistory}',
    Target       : 'changes/@UI.PresentationVariant',
    ![@UI.PartOfPreview],,
}]);

The issue is that, and it was working a few weeks ago, but now in my app the FE object page is not generating the Change History table anymore (even before getting some records, I don't see an empty table for example) :

Image

I don't quite get why the service is not getting or do not seem to fetch the changelog anymore, we did some changes to our model but the monitored fields in change-tracking.cds were the same and we were able to see the Change History in the past. Also I'm not able to see what's going on in debug.

Could we have some help on this issue ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions