1

Writing a plugin that calls a webservice presents a subset of the data retrieved back to the user and then processes one record out of the data to create contacts.

I want to avoid passing the whole object to the client and only pass a limited subset of the data, and less than is required to do the user creation. So I need to store the whole object retrieved from the web service somewhere while the user interaction is happening. In other applications I'd just throw it in the user session.

Does that work here? What's the best practice for this?

DiscontentDisciple
  • 466
  • 1
  • 6
  • 20

1 Answers1

1

Unfortunately what you are trying to achieve is impossible directly.

The only way for sending a message to end user (browser client) from a plugin (server stuff) is throw new InvalidPluginExecutionException(strErrorMessage); but this will rollback the entire database transaction.

Probably you can store the data in some custom entity & then retrieve it to process by user interaction on next visit.

Otherwise, you can tweak something like setting up custom attribute & onchange event to trigger on completion of plugin. Then retrieve the stored custom entity data to achieve your need.

Another SO thread talking about nuisance, so use dedicated attribute for this behavior.