It was painful but We could import message as Draft !
The tricks is after Simulating the "Edit as New" we need to parse XML returned by API and add tag <attach> to avoid losing attachments.
To be precise this is the list of things we need to customize before calling SaveAsDraft:
- remove id in <m> tag to avoid IMMUTABLE Exception
- For each tag <mp> containing cd="Attachment" of "inline"
=> Add a following Nodes <attach><mp mid="<The message id we get previously>" part="<Value of previous mp>"/><attach>
And to finalise the process, we need to delete the imported message (by calling MsgActionRequest)
It's a lot of action (5 API called to only create draft), BUT IT WORKS !
Thanks all for you help
The tricks is after Simulating the "Edit as New" we need to parse XML returned by API and add tag <attach> to avoid losing attachments.
To be precise this is the list of things we need to customize before calling SaveAsDraft:
- remove id in <m> tag to avoid IMMUTABLE Exception
- For each tag <mp> containing cd="Attachment" of "inline"
=> Add a following Nodes <attach><mp mid="<The message id we get previously>" part="<Value of previous mp>"/><attach>
And to finalise the process, we need to delete the imported message (by calling MsgActionRequest)
It's a lot of action (5 API called to only create draft), BUT IT WORKS !
Thanks all for you help
Statistics: Posted by tglenard — Thu Dec 21, 2023 4:15 pm