Hi,
We had a requirement to immediately close the Appointment record as completed after creating it. The initial thought was to call Set State Request on the Post Create plugin. That approach gave error. Then we tried passing statecode and statuscode value as input parameter in Pre Plugin. That approach also didn’t work.
Finally we registered a pre update plugin on appointment entity and set the values for statecode and statuscode attributes. This worked for us.
The learning is that on create of Appointment record, update message is also called.
Sample Code (Pre Update)
Hope it helps.