‎2019 Aug 21 6:32 PM
hi,
I have created a CDS view with draft enabled annotations. However, when I am running the application in front end(which i exposed via Odatapublish: true) then the draft feature is not working.
@ObjectModel:{ representativeKey: 'salesorder',
semanticKey: ['salesorder'],
compositionRoot: true,
createEnabled: true,
updateEnabled: true,
deleteEnabled: true,
transactionalProcessingEnabled: true,
draftEnabled: true,
usageType.dataClass: #TRANSACTIONAL,
usageType.serviceQuality: #C,
usageType.sizeCategory: #S,
writeActivePersistence: 'ZSM_VBAK',
writeDraftPersistence: 'ZSMVBRK_D'
please help. it is only saving in active persistent. Why it is happening. am i missing anything?
‎2019 Aug 21 8:12 PM
Please follow the standard doccumenation tutorial below. it is very explanatory and if you follow it, it should solve your issue.
Note; Keys should be uuid for this scenario.
Thanks,
Mahesh
‎2019 Aug 21 6:50 PM
Hi,
Just try with transactionalProcessingEnabled: true, createEnabled: true,deleteEnabled: true,updateEnabled: true,
@ObjectModel: {
compositionRoot: true,
transactionalProcessingEnabled: true,
createEnabled: true,
deleteEnabled: true,
updateEnabled: true,
draftEnabled: true ,
entityChangeStateId: 'changedat', --Required for ETag check
writeActivePersistence: 'db_salesorder',
writeDraftPersistence: 'db_salesorder_d',
semanticKey: [ 'SalesOrder'] }
define view I_SalesOrder as select from db_salesorder as SalesOrder
association [0..1] to I_BusinessPartner as _BusinessPartner on $projection.customerID = _BusinessPartner.businesspartnerID
{
key salesorderID,
...
customerID,
...
@ObjectModel.association.draftEnabled: true
@ObjectModel.association.draft.fieldNamePrefix: 'BuPa'
_BusinessPartner }
‎2019 Aug 21 7:04 PM
Thanks for your reply. However, I already used those annotations but it is not working. Please suggest. it is getting saved in active persistent only. Draft is not working.
‎2019 Aug 21 7:09 PM
‎2019 Aug 21 7:25 PM
I have gone through whole blog. They are not using active persistence annotations. They are saving the draft data in copy draft to active using modify statement. But in my case and example you provided there both active and draft persistence annotations are there. My all data getting save in active persistence, draft not working at all
‎2019 Aug 21 8:12 PM
Please follow the standard doccumenation tutorial below. it is very explanatory and if you follow it, it should solve your issue.
Note; Keys should be uuid for this scenario.
Thanks,
Mahesh
‎2019 Aug 22 6:10 AM
Thank You Mahesh. I will go through the Help document and get back here. Moreover, I gone through your blogs in SAP and It is very much useful. I appreciate your effort there. The Durable lock was a new thing in draft i got to know. 🙂
‎2019 Aug 22 7:51 AM
Welcome and thanks for the feedback 🙂 🙂 I was and am still new to these concepts and it's a learning whenever I dig through them.. Hope to see you share your learnings in the future 🙂 🙂
Let me know if you face any issues while going through.
Thanks,
Mahesh
‎2019 Sep 10 6:07 PM
Sorry for late reply. Now the draft is working. Thank you so much for the help. 🙂