Skip to Content
May 26, 2021 at 01:06 PM

Trying to create Popup in Visit

167 Views Last edit Jun 01, 2021 at 08:37 AM 3 rev

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,