Ensure RelatedEntityDescription matches the Opportunity (optional but recommended). If you're receiving a 406 Not Acceptable, it's likely not because you're linking to an Opportunity. Since the same pattern works for Sales Orders, I'd verify:
The GET returns a valid Opportunity NoteID.
RelatedEntityType is PX.Objects.CR.CROpportunity.
You're using the Activity endpoint (or Email Activity endpoint if applicable) with the correct entity version.
Required fields (Type, Status, Summary/Subject, etc.) are valid for the Activity type being created.
Sample: url: /entity/Default/24.200.001/Activity Method: Put Request: { "Subject": { "value": "Draft Email for Opportunity" }, "Body": { "value": "This is the body of the draft email." }, "MailStatus": { "value": "Draft" }, "ClassID": { "value": "Email" }, "IsIncoming": { "value": false }, "RelatedEntityDescription": { "value": "OPPR000123" }, "RelatedEntityNoteID": { "value": "02686d2e-7f68-f111-bb12-0e2c1f509de5" }, "RelatedEntityType": { "value": "PX.Objects.CR.CROpportunity" }, "To": { "value": "recipient@somecompany.com" }, "From": { "value": "sender@mycompany.com" } }
Ensure RelatedEntityDescription matches the Opportunity (optional but recommended). If you're receiving a 406 Not Acceptable, it's likely not because you're linking to an Opportunity. Since the same pattern works for Sales Orders, I'd verify:
The GET returns a valid Opportunity NoteID.
RelatedEntityType is PX.Objects.CR.CROpportunity.
You're using the Activity endpoint (or Email Activity endpoint if applicable) with the correct entity version.
Required fields (Type, Status, Summary/Subject, etc.) are valid for the Activity type being created.
Sample: url: /entity/Default/24.200.001/Activity Method: Put Request: { "Subject": { "value": "Draft Email for Opportunity" }, "Body": { "value": "This is the body of the draft email." }, "MailStatus": { "value": "Draft" }, "ClassID": { "value": "Email" }, "IsIncoming": { "value": false }, "RelatedEntityDescription": { "value": "OPPR000123" }, "RelatedEntityNoteID": { "value": "02686d2e-7f68-f111-bb12-0e2c1f509de5" }, "RelatedEntityType": { "value": "PX.Objects.CR.CROpportunity" }, "To": { "value": "recipient@somecompany.com" }, "From": { "value": "sender@mycompany.com" } }
@Dmitrii Naumov I had tried both, but the 406 was because it could not location the record with the RelatedEntityNoteID alone, as soon as I added the RelatedEntityDescription & RelatedEntityType it PUT w/ 200 OK to /email, if you post to /activity it looks like you need a “Summary” { “value”: “Something”}.
@jinin Thank You, very much appreciated. Seems for me I had to use /email vs /activity for an email type activity, the system threw and error when I tried /activity with Type “AE” which is my Email type for my system.