4 weeks ago
Hello SAP Community!
I've recently encountered a puzzling issue after upgrading to CDS 8.6.1, and I'm hoping someone here might have insights or advice.
I have a CAP service that uses @Common.DefaultValuesFunction to provide default values for an action in one of my entities. This was working perfectly in CDS 7.9. The getDefaults function was executed with the Business Partner ID as the parameter, allowing me to retrieve context-specific default values.
Here is a simplified snippet of the relevant code:
extend service MyService with {
@CDS.localized: false
@(Capabilities.SortRestrictions.NonSortableProperties: [to_localData.invitationStatus.name, ])
entity SupplierEntity as
projection on bupa.A_BusinessPartner {
key BusinessPartner,
Supplier,
BusinessPartnerFullName,
BusinessPartnerIsBlocked as isBlocked,
to_Supplier : redirected to SupplierDetails,
to_BusinessPartnerAddress : redirected to BusinessPartnerAddress,
to_localData : Association to one MyService.Suppliers on to_localData.ID = Supplier,
to_customData : Association to one SupplierCustom on to_customData.Supplier = Supplier
}
actions {
@Common.DefaultValuesFunction: 'MyService.getDefaults'
action invite @(requires: [
'connector-advisor',
'connector-admin'
])(email : getDefaultsRet:email,
leadBuyer : getDefaultsRet:leadBuyer,
naceCodes : getDefaultsRet:naceCodes,
topics : getDefaultsRet:topics,
segments : getDefaultsRet:segments);
function getDefaults() returns getDefaultsRet;
}
}
Reviewing the CDS documentation: I’ve scoured the release notes and official CAP documentation to see if there were any changes to @Common.DefaultValuesFunction, but I couldn’t find anything definitive.
Debugging the implementation: Adding logs confirmed that the parameter passed to getDefaults is indeed an index rather than the expected ID.
Experimenting with parameter changes: I’ve tried to explicitly pass the Business Partner ID, but no success so far.
Has anyone else experienced this issue with CDS 8.6.1?
Was there a change in how @Common.DefaultValuesFunction works in recent versions of CDS?
Do I need to explicitly pass the Business Partner ID through the caller logic, or is there a better way to adapt to this behavior?
Thanks and best regards
Sergen
Request clarification before answering.
User | Count |
---|---|
64 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.