cancel
Showing results for 
Search instead for 
Did you mean: 

Extend standard web service for custom BO

sumeet_narang
Active Participant
0 Kudos

Hello Experts,

I have a requirement where I have created a custom BO with some custom fields and added its embedded component as a new tab on the Lead TI.

Now we want to integrate these custom fields to the standard lead web service to replicate these custom fields into the backend CRM system.

I tried for Process Extension Scenario but it only works for the fields added to the extended bo. Could you please suggest on how this could be achieved.

Thanks and Regards,

Sumeet Narang

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sumeet,

The above functionality already provided by SAP in 1502 released so you can use the above method. to create direct:

1) Custom Tab

2) Custom Section Group

3) Add Fields under that Custom Tab / Custom Section Group using admin user from Front-end.

Regards,

Mithun

sumeet_narang
Active Participant
0 Kudos

Hi Mithun,

Thanks for your reply.

The reason I had to create these fields from studio is that the dropdown of these fields are interdependent. So I had to do codelist context mapping for these fields which I believe is not possible if I create the fields from HTML5. Is there any other way you think I could approach this development.

Regards,

Sumeet

Former Member
0 Kudos

Yes there is another way.

Add hidden fields in the header of your standard Lead BO.

When the standard bo is save (before save event) copy the values from your custom bo to the standard BO.

Extend the ws scenario with the new added fields to see them in the webservice.

sumeet_narang
Active Participant
0 Kudos

Hi Alessandro,

Thanks for your response.

I also tried this way as you suggested. The issue that I face is that I have added the BO as a new tab on the lead. When I edit any values on the custom fields and save, it triggers Before Save event of the BO only and the Before Save event of the Lead doesn't trigger. So the change of values is not recorded on the  hidden fields. Also when I try to access and change the Lead values from the BO event, I see the hidden fields as read only which cannot be edited.

Though I have solved this issue now by creating an Embedded Component for the extended BO fields instead of the BO fields and it looks to be working fine, but I would really like to know if in case there is such a requirement where one has to use BO fields only then how do we add those fields to the standard web service.

Regards,

Sumeet

Former Member
0 Kudos

----------------------

Also when I try to access and change the Lead values from the BO event, I see the hidden fields as read only which cannot be edited.

----------------------


Readonly? They are custom fields so this is very strange. Maybe you were not pointing to the .content of those fields?

Former Member
0 Kudos

Sumeet,

By "BO" do you mean your custom Business Object? If so, check if it's in the same deployment unit as the Lead standard Business Object that you're trying to modify - if it isn't, all the fields will appear as read-only.

The deployment unit is by default inherited by the deployment unit you've specified for your solution, but it can be overwritten with a DeploymentUnit annotation on your custom Business Object (see the documentation for detail)

sumeet_narang
Active Participant
0 Kudos

Hi Dan,

I checked the Deployment Unit of the solution and it was set to Foundation whereas for Lead it should have been Customer Relationship Management. I created a new solution with the correct Deployment Unit and I was able to change the Lead values. Thanks for your help on this.

Regards,

Sumeet

Former Member
0 Kudos

Sumeet,

FYI, you can usually just add the DeploymentUnit annotation to your Business Object definition if it needs to exist in a different deployment unit than the solution.

If you add [DeploymentUnit (CustomerRelationshipManagement)] before the "businessobject" at the very beginning, that should work as well.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sumeet,

In your scenario if you have only add extension fields in your case use the below steps to achieve it.

1) Open Screen in HTML5 mode using admin user.

2) Go to Adapt -> Edit Master Layout.

3) Select the Tab and click on Plus sign and on top 1 ore sign beside the Input box.

4) Enter Your new tab name and click on sign and Apply.

5) Now Select the newly created Tab (Do not exit from the Adapt mode) under the section you have option to "Add Section" , "Add Field", "Add Mashups".

6) Now come out of the adapt mode and again go to the adapt mode and edit the Header and click "Add New Field" in header section of the screen .

7) After creating the New Field select "Save and Open" or "Field Definition" option to add those fields under respective Services.

😎 Now go to your newly created Tab and drag and drop your custom fields from Header section to New tab.

9) Now download the updated web services and check if those fields available or not

Regards,

Mithun