Legacy Knowledge Base
Published Jun. 30, 2025

I cannot use the PUT method of the Object API's Batch endpoint with External Reference Codes (ERC)

Written By

Orsolya Hegedus

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • It is not possible to mass update a custom object's entries if:
    • using the PUT method of the object's batch API endpoint
    • and the External Reference Code (ERC) is given instead of the object entry's ID.
  • The operation fails with
NullPointerException: Cannot invoke "java.lang.Long.LongValue()" because "objectEntryId" is null

Environment

  • Quarterly Releases

Resolution

  • This is the expected behavior. This endpoint identifies which object entries to update via their IDs.
  • A possible workaround:
    • Use this endpoint with the POST method
    • Add the createStrategy=UPSERT parameter to your request URL
    • So, a request URL for this operation will look something like this: http://your_domain/o/c/your_objects/batch?createStrategy=UPSERT

Additional Information

 

 

Did this article resolve your issue ?

Legacy Knowledge Base