onSend REST API changes do not reflect in the UI

2019-04-16 17:12发布

We are using the onSend event to perform some REST API requests that may change and update recipients and the draft item body.

However, those changes are not reflected in the UI and when the onSend event is completed while allowing the send event to continue, the draft item is sent without the changes (successfully) made through the REST API.

Can this behaviour be confirmed ? and if so, is there a way to force the UI to update before completing the onSend event?

We are trying to work around this by sending the item through the REST API as well, but that conflicts with completing the onSend event in the following cases:

  • item sent through REST API + onSendEvent.complete(allowEvent : true) I believe we get a UI error after OWA tries to send the item

  • item sent through REST API + onSendEvent.complete(allowEvent : false) Nothing happens, the UI still shows the draft that no longer exists

Might it be the case that the REST API does not cause the UI to be updated, but using the OfficeJs API dóes update the UI ?

1条回答
我想做一个坏孩纸
2楼-- · 2019-04-16 17:59

Yes, the behavior is expected. REST API modifies the copy on the server. During onSend event, the message is still on the client and the message itself is not necessarily updated to the server yet. After the onSend event completes, OWA will then update the message to the server and send. There is no way to force OWA to update from the server during onSend event or before onSend event completes.

查看更多
登录 后发表回答