cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create Popup in Visit

AS_
Explorer
0 Kudos

Dear Experts,

We are trying to implement the following scenario:

If a visit is set to "completed" and no follow up activity has yet been created, we want a popup to appear before saving the visit completion reminding the user to create a follow up activity.

To meet this requirement I have taken following steps:

1. I implemented a logic in the BeforeSafe-event of the Activity.xbo, which sets a custom indicator field "Z_popupIndicator" to "true" if:

- No follow-up activity was created in the visit (FollowupBTDRef.Count() <1) AND

- The visit has been set to "completed" (LifeCycleStatusCode = "3")

2. I created an Embedded Component "Z_PopupOnVisitCompletionWithoutFollowUp_EC.EC.uicomponent"

- I have bound the DataModel of this EC to the Activity - Object and extended it with the following elements:

  • DataField "ID" (bound to "ID" of the Activity-Object)
  • DataField "Z_popupIndicator" (bound to "Z_ popupIndicator " of the Activity object)
  • Struct "Inport" with DataField "VisitID" for reading the lead instance.

- Afterwards I created and configured an InPort for the field VisitID

- Furthermore I added and configured the handler for the InPort

- Next I added another eventhandler which checks if the field "Z_popupIndicator" has been changed

- … and configured it to show the ModalDialog in case it has been set to “true”

3.finally I attached the above described EC to the COD_Visit_TI.TI.xuicomponent and bound it

For testing I select a visit with no follow up activity and set it to "completed".

In debugging I can see that my indicator field "Z_popupIndicator" is successfully set to "true".

However no popup appears.

Does anybody know why this is not working? What am I missing or doing wrong?

Thanks and kind regards,

Anna

Accepted Solutions (0)

Answers (2)

Answers (2)

Gayatri_Bagde
Active Participant
0 Kudos

Hi Anna,

You can refer to the below blog for dispalying popup

https://blogs.sap.com/2019/08/27/display-popup-in-sap-c4c/?preview_id=859204

Also, if you need to raise a simple message then you use standard method raise message to display an error message.

Thanks,

Gayatri

AS_
Explorer
0 Kudos

Hi Gayatri,

The user specifically wants a popup, not an error message.

Unfortunately, I have not been able to successfully implement the steps from this block in the visit resp. activity object.

Do you know of any difference between the business objects that might need to be considered here?

Thanks and kind regards,

Anna

nikhilwalsetwar
Contributor
0 Kudos

Hi a.schlittenhardt

Please refer below blogpost for the detailed steps to create a popup in C4C. Could you please check with these steps, I'm sure it will solve the issue.

https://blogs.sap.com/2019/08/27/display-popup-in-sap-c4c/

Hope this helps,

Nikhil

AS_
Explorer
0 Kudos

Hi Nikhil,

Thank you very much for your reply.

I have tried to apply the steps described in the block - unfortunately this was not always possible based on my requirements.

For example, in the Visit_TI there is no "GenericOutport" - I chose "PublicOutPortECVisitRoot" instead - but this did not lead to the desired result.

In the Lead object I managed to create a popup with the help of another block (https://blogs.sap.com/2018/06/20/create-pop-up-screen-sap-c4c/ ) - but I could not transfer this to the Visit object either.

Do I have to do something different when creating a popup in the visit resp. activity object?

Thanks and kind regards,

Anna