-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about Object ID definition #69
Comments
HI @032660 , Could you provide the git repo and the detail steps how to reproduce this issue? Thanks a lot. Best Regards |
Hi @032660 , From your description I found now using But then EntityID on the Changes DB table remains empty and “Payment” is shown as Object ID . I tried But this is not the correct way to use it. You can find how to define the Object ID in the following link. Best Regards |
Hi Jocelyn, I know that correct would be @changelog: [displayId]. But if I do so and try to build I am getting an error: And the only specisl thing for this entity Payments that it has an association to the same entity Payments - that is why I thought it could be the reason. Kind regards, |
Hi @032660 , Because there is no reproducible environment from your side, so I can only try to reproduce it locally in my project. then execute "npm run build", but no error message in terminal. Are there any missing steps to reproduce this issue? Best Regards |
Hi Jocelyn, Thank you! Special in the entity Payments is that it has association to the same entity: Fee : Association to one Payments; And it has associations to other entities declared to use the changelog: Payment Orders and Business Partners. entity Payments : cuid, managed {
}; Kind regards, |
Hi @032660 , According your comment, I add two new attribute "BusinessPartner" & "PaymentOrder", "Fee" is already in Payments entity. But still no error when execute "npm run build". Here is the git repo which I want to reproduce this issue: https://github.tools.sap/ROCKETS/simple-bookshop/tree/fix/issue%2369. Best Regards |
Hi Jocelyn, I am sorry not to have explained what we are executing. It is not "npm run build" but "npm run cds2types && npm run deploy && npm run testdata:deploy-main" and I am not sure you can execute this in your branch. When I am executing the script (which has name "npm run build:dev" - that is why I provided wrong information) then I must log on with the SAP user. And I am getting the error on Error: HDI deployment failed with exit code 1 Command failed: npx cds deploy --to hana:D032660 --store-credentials --auto-undeploy So npx cds deploy seems to be an issue. Kind regards, |
P.S. I created a branch where it can be tested: https://github.tools.sap/erp4sme/crypto-for-business/tree/paymentChangelog. And on https://github.tools.sap/erp4sme/crypto-for-business/tree/main it is described what is necessary to work on our project. But you can see: you must then request some access rights and so on. I wouldn't like to make you doing all that efforts. May be you should just try "deploy" in your branch? Kind regards, |
Hi @032660 , I try to run the project in my local, when execute Is this error the same as what you encountered? In these error messages, I did not see anything related to change tracking or payment entity. In addition, when I switch to Best Regards |
Hi Jocelyn, I am getting only the error below on your screenshot and only if I define changelog for Payments as @changelog: [displayId] in db\payment\payments\Payments.cds. If I use @changelog.ObjectID: [displayId] (which however does not have any affect) then there is no any error during npm run build:dev. Concerning the error you are getting: you can just remove all the entries from the table "...ACCOUNTS_ACCOUNTS" for your local HDI container. This should help. Kind regards, |
Hi colleagues,
There was a discussion whether direct DB operations (not via services) should be also considered in the change tracking. Finally a decision was made that a service was necessary. We created such dummy-services like for example
service PaymentWrapperService @(requires: 'system-user') {
entity Payments as projection on db.payments.Payments;
entity Payables as projection on db.payables.Payables;
entity PaymentOrders as projection on db.paymentOrders.PaymentOrders;
entity Receivables as projection on db.receivables.Receivables;
entity BusinessTransactions as projection on db.businessTransactions.BusinessTransactions;
}
And all INSERT/UPDATE operations are now fulfilled via this service like:
INSERT([paymentToInsert]).into(PaymentWrapperService.Entity.Payments)
This works. Moreover, entity BusinessTransactions is a view defined as union of 3 other entities: Payments, Payables and Receivables. But on the UI based on BusinessTransactions the change history of Payment or other entities is shown – this is if course very good.
However some things do not work as expected.
All three entities Payments, Payables and Receivables in the view BusinessTransactions have a field displayId.
For Payables and Receivables it was possible to define Changelog as
@changelog: [displayId]
However for Payments it is not possible (then npm run build would bring an error saying that dependencies exist). It is only possible to define it as
@changelog.ObjectID: [displayId]
But then EntityID on the Changes DB table remains empty and “Payment” is shown as Object ID . I tried
@changelog.entityID: [displayId]
But it does not make any difference. Even in the DB table SAP_CHANGELOG_CHANGES Entity ID is empty.
I suppose that this is happening because the entity Payments has associations to other entities (Payments and PaymentOrders) having changelogs with the same entityID “displayId”:
Type : Association to one codelists.PaymentTypeCodes;
Direction : Association to one PaymentDirectionCodes;
displayId : String; //readable ID
Company : Association to one Companies;
BusinessPartner : Association to one BusinessPartners;
PaymentOrder : Association to one PaymentOrders;
Wallet : Association to one wallets.Wallets;
Transaction : Association to one wallets.Transactions;
cryptoAmount : Decimal;
CryptoAmountCurrency : Association to one Cryptocurrencies;
Am I right? Does not it work when one entity is associated with another one with the same changelog Entity ID? How should we define ObjectID in this case?
One more question: if we are showing an amount in the change log, how can we add currency to it? Is it possible? I mean not just showing “5.5” but “5.5 USD”.
I am attaching an example from UI.
Thank you and kind regards,
Elena Gurevitch
The text was updated successfully, but these errors were encountered: