Skip to content

Conversation

@yashmeet29
Copy link
Collaborator

Describe your changes

Fixed Copy and Move attachments failures when custom properties with specific types (date/codelist) are attached to documents. The root cause was improper handling of CDS association fields - for codelist properties, both the foreign key field (e.g., customProperty1_code) and its association (customProperty1) were being included, causing "Invalid CQN: Unexpected value for association" errors during Move operations. Similarly, Copy operations failed with date properties due to missing type conversion from Long timestamps to Instant.

The fix adds association filtering in DBQuery.getValidSecondaryPropertiesWithEntity(matching the existing pattern in copyAttachments, adds an association check in processSecondaryProperty to skip association fields during Move, and implements convertCustomPropertyValue() for proper type conversion during Copy operations.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I follow Java Development Guidelines for SAP
  • I have tested the functionality on my cloud environment.
  • I have provided sufficient automated/ unit tests for the code.
  • I have increased or maintained the test coverage.
  • I have ran integration tests on my cloud environment.
  • I have validated blackduck portal for any vulnerability after my commit.

Upload Screenshots/lists of the scenarios tested

List of scenarios tested:
Copy attachment having custom properties of type Integer, Boolean, Drop-down codelist & Date type from nested entity to root entity.
Copy attachment having custom properties of type Integer, Boolean, Drop-down codelist & Date type from a root entity to another root entity.
Move attachment having custom properties of type Integer, Boolean, Drop-down codelist & Date type from nested entity to root entity.
Move attachment having custom properties of type Integer, Boolean, Drop-down codelist & Date type from a root entity to another root entity.

@yashmeet29 yashmeet29 merged commit cd34db8 into develop Feb 3, 2026
9 checks passed
@yashmeet29 yashmeet29 deleted the moveAndCopyBugFix branch February 3, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants