cancel
Showing results for 
Search instead for 
Did you mean: 

Update Service Request from Activity

preethi_santhanam
Participant
0 Kudos

Hi All,

I'm trying to update the customer on the ticket (ServiceRequest BO) when the selected caller on Live activity pane(Activity BO) changes. I query the ServiceRequest BO but unable to update the PartyKey fields even though the documentation shows that this field is available for Read/Write access.

Is anyone able to help please?

Best Regards,

Preethi Santhanam

Accepted Solutions (0)

Answers (4)

Answers (4)

preethi_santhanam
Participant
0 Kudos

Hi Alexandre and Horst,


Many thanks for all your inputs, has been very useful. I did consider Internal communication, but would need a custom object in to interact between Activity and Service Request BO.


I tried another approach and seems to work well.

I created an extension in Activity BO and populated this field based on caller in Live Activity. On the after modify event of Service Request, I read the Activity Reference node to get the reference of Activity and the extension field. As I was in Service Request BO, I was able to update the Party ID.


Best Regards,

Preethi Santhanam.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Preethi,

From the "higher" level Deployment Unit you can always write in the "lower" (= Foundation) one.

Bye,

   Horst

preethi_santhanam
Participant
0 Kudos

Hi Horst,

Yes, hence reading the Activity BO which is part of AP/PC/ActivityManagement/Global from Service Request BO in AP/CRM/Global and updating Service Request BO without use of any additional steps

Best Regards,

Preethi Santhanam

former_member186648
Active Contributor
0 Kudos

Hi Preethi,

This might be helpful: http://scn.sap.com/docs/DOC-73609

Thanks, Pradeep.

preethi_santhanam
Participant
0 Kudos

Thanks Pradeep. Horst has mentioned this link and its a very helpful blog!

Best Regards,

Preethi Santhanam

Former Member
0 Kudos

Hi Preethi,

Retrieve the ticket:

var ticket = ServiceRequest.Retrieve(this.TicketID);

ticket.BuyerParty.PartyKey.PartyID.content = ...

Best regards,

Alexandre.

preethi_santhanam
Participant
0 Kudos

Hi Alexandre,

Thanks for your reply. This is exactly what I'm doing as per my screenshot, but unable to edit the PartyKey fields

Best Regards,

Preethi Santhanam

Former Member
0 Kudos

Hello Preethi,

I was trying to say that you could try to retrieve ticket using ServiceRequest.Retrieve() method. Not by query.Execute (as in your screenshot).

Did you try that?

Regards,

Alexandre.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Preethi,

As mentions:

The "ID" in the ServiceRequest BO is an Alternative Key. Therefore it's like to using a sledegehammer to crack a nut.

Just use the code from Alexandre.

Second: From the snapshot you see the little lock in the icon for the PartyID (and the PartyTypeCode). This means that under this conditons the element cannot be changed.

However if you use the Retrieve it shows no lock:

HTH,

    Horst

preethi_santhanam
Participant
0 Kudos

Hi Alexandre, Horst,

I did try the Retrieve method as well, I still cant update it Is there something I'm doing wrong?

Best Regards,

PreethI Santhanam

Former Member
0 Kudos

Hi Preethi,

I'm not sure about that, maybe Horst Schaude can correct me if I'm wrong, but it could be happening because Activity is in Foundation deployment unit and ServiceRequest is in CRM unit. I've read something about you cannot update a BO from Foundation to CRM synchronously. For that, you should use asynchronous methods. Maybe, you can configure an "Internal communication" for it, but I've done it before.

Best regards,

Alexandre.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alexandre,

Great you noticed. It is definitely not possible to alter data of a BO in CRM when your own BO is in Foundation.

If it would be a Custom BO you would be able to "move" it to any other Deployment Unit by adding the annotation [DeplyomentUnit(<Du name>)] before the "businessobject" keyword.

But as this is the SAP BO Activity this is not possible.

You should follow approach.

Bye,

   Horst

preethi_santhanam
Participant
0 Kudos

Hi Alexandre,

Yes, this seems to align with what I've seen too as I couldn't directly assign the values and did see a namespace error. Many thanks for pointing this out.

I tried the Internal communication route, couldn't get much further as it can link a custom object to a standard object only. Does this mean I read the values from Activity BO into a custom  object and then have an internal communication between custom object and Service Request object? Do you have any document to guide me?

Best Regards,

Preethi Santhanam

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Preethi,

describes in this document several ways of updating a BO. One of the them is via Internal Communication.

Have a look this and the referenced documentation.

HTH,

   Horst

sunil1101
Advisor
Advisor
0 Kudos

Hi

It seems issue is in accessing in SDK, you should raise incident

Regards

Sunil

preethi_santhanam
Participant
0 Kudos

Thanks Sunil, I shall raise a ticket

Best Regards,

Preethi Santhanam

former_member186648
Active Contributor
0 Kudos

Hi Preethi,

Looks like a bug, please raise a ticket.

Thanks, Pradeep.

preethi_santhanam
Participant
0 Kudos

Thanks Pradeep, I shall raise a ticket

Best Regards,

Preethi Santhanam