cancel
Showing results for 
Search instead for 
Did you mean: 

Copy extension fields in web service to standard fields in BO

floriangu
Participant
0 Kudos

Hello,

service requests should be maintained / created via the C4C standard web service "MaintainServiceRequest".

The issue is that the standard fields in service location cannot be maintained via the web service. The idea is, that some extension fields are defined via a process extension scenario and are exposed via the web service. Is is it possible to copy the value of these extension fields to the standard BO fields after the web service is called? E.g. by calling an action in the OnSave event which then copies the values of extension fields to the standard fields.

My question is if it is possible to access the web service fields in an appropriate action and how this is done? I know how to access BO fields -> this."Elementname" but I am not sure how it is done for the fields in a web service request (if this is possible at all as afaik parameters cannot be passed into an action)


Thank you for your help!

Accepted Solutions (0)

Answers (1)

Answers (1)

VVancalbergh
Contributor
0 Kudos

"Web Service Fields" do not exist (as far as I know). All fields that are visible in a web service definition match a field in a BO somehow.

So yes, to "add" a standard field to a pre-existing WS you can:

- Add an identical extension field in the object's XBO

- Create a Process Extension Scenario to make that field available in the web service (don't forget to add the [Scenario()] annotation to the field).

- Add a BeforeSave trigger to the XBO.

- In the trigger do

this.Y = this.X;

(assuming you aren't using Mass Processing, since otherwise you'd have to loop over "this")