on 09-11-2019 5:01 PM
Hi,
I've created an embedded component for a custom BO, that is added to a tab on the standard Ticket screen, binding it to the public outport of the ticket. When opening the tab the EC event handler runs a BO Action script on the custom object. However, if I then edit the ticket, and go back to the tab with the EC, the script does not get run (I have put a debug on the script)
Could this be because the public outport is not firing? Is there a different outport that I could use to trigger the event handler in my EC? Or some other method?
Thanks,
Simon
Ok, I have figured out a way to do this:
1. First, add the EditMode field to the Data Model to detect edit mode for the EC (hat tip: How to detect EditMode in an EmbeddedComponent)
2. Then create a new Event Handler in the EC that calls an Action to refresh the data held (my EC is pulling info from the Ticket and some other sources in order to display a mashup - as per HTML script mashup – launched from an Embedded Component)
3. Put a condition on the Event Handler so that it only runs if the EditMode is blank (i.e. the user has just clicked save on the ticket so EditMode has changed from X -> blank) I do not need it to run if EditMode is 'X' (i.e. the user has just clicked 'Edit' so EditMode has changed from blank -> X)
4. Then back in the Data Model, set the OnValueChanged Property of the field to call the Event Handler just created
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Minor change: in the end (given the warnings in the document about EditMode, that it could potentially be changed by SAP in future) I've gone with using a transient indicator field instead. I default it to 'false' in the BO, then 'switch' the value in the BeforeSave for the EC (i.e. indicator = !indicator) Then run the 'OnChange' script against that field. That way the EventHandler is cleaner as it just needs to run whenever that field changes.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.