Service Methods for Business Objects in Visual Builder by Shay Shmeltzer

image

In a previous blog I showed you how to create an object function for a business object to allow you to expose specific functionality on a specific row. This blog is a little variation on this capability showing you how to create service methods in your data layer that are not related to a specific row.

This is based on a use case a customer had where they would get data for a record in a table, if the row already exists in the table they need to update it. If it doesn’t exist they need to create a new row with the data. The REST API provided by the Visual Builder business objects supports this use case as long as you have the id of the record you want to update. This is done with the upsert option for a POST call – see the information about this combined insert/update operation here.

But the data that the customer got didn’t have the id of the record they would need to update. Instead they had the information about another field in the object. To resolve this we can create a function in the BO layer that will search the set of records for a specific value in a specific field, and then update that record if the value is found, or insert a record if it doesn’t exist. Read the complete article here.

Developer Partner Community

For regular information become a member in the Developer Partner Community please register here.

clip_image003 Blog clip_image005 Twitter clip_image004 LinkedIn image[7][2][2][2] Facebook image Meetups

Technorati Tags: PaaS,Cloud,Middleware Update,WebLogic, WebLogic

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.