I am trying to post the data via CQL after enabling change tracking for the service and connecting to it.
const srv = await cds.connect.to("MasterDataMapService");
const masterEntity = srv.entities[entity];
const insertResult = await INSERT.into(masterEntity).entries(aInsertData);
Above Insert Query shows the change tracking only if I insert one record into it, otherwise it does not show any change tracking.
Can you please check on this?
Change tracking annotation file source code:
using { MasterDataMapService } from './masterdatamap-service';
using from '@cap-js/change-tracking';
Hi Team,
I am trying to post the data via CQL after enabling change tracking for the service and connecting to it. const srv = await cds.connect.to("MasterDataMapService"); const masterEntity = srv.entities[entity]; const insertResult = await INSERT.into(masterEntity).entries(aInsertData);
Above Insert Query shows the change tracking only if I insert one record into it, otherwise it does not show any change tracking. Can you please check on this?
Change tracking annotation file source code: using { MasterDataMapService } from './masterdatamap-service'; using from '@cap-js/change-tracking';
annotate MasterDataMapService.TaxCodeMap with @title: 'Tax Code' @changelog: [author, timestamp]{ companyCode @changelog; sourceTaxCode @changelog; targetTaxCode @changelog;
} annotate sap.changelog.aspect @(UI.Facets: [{ $Type : 'UI.ReferenceFacet', ID : 'ChangeHistoryFacet', Label : '{i18n>ChangeHistory}', Target: 'changes/@UI.PresentationVariant', ![@UI.PartOfPreview] }]);
annotate sap.changelog.ChangeView with @( UI.LineItem : [ { Value: modification, @HTML5.CssDefaults: { width: 'auto' }}, { Value: createdAt, @HTML5.CssDefaults: { width: 'auto' }}, { Value: createdBy, @HTML5.CssDefaults: { width:'auto' }}, { Value : attribute, @HTML5.CssDefaults: { width:'auto' }}, { Value : valueChangedFrom, @HTML5.CssDefaults: { width:'auto' }}, { Value : valueChangedTo, @HTML5.CssDefaults: { width:'auto' }},
] );
Regards, Vishal Kwatra