I need to programmatically tie an email to a Case. The code I have makes some kind of association, because the email will display in the Case activities. However, the email ‘Related Entity’ field remains blank.
// Reassign Appointment to Case instead, so the Case's 'Appointment Date' is correct bAccountGraph.Activities.Current = bAccountGraph.Activities.Search<CRPMTimeActivity.noteID>(appointment.NoteID); bAccountGraph.Activities.SetValueExt<CRPMTimeActivity.refNoteID>(appointment, taxCase.NoteID); bAccountGraph.Activities.Update(appointment); bAccountGraph.Actions.PressSave();
@Deetz can you add screenshots as well? What do you expect to see in UI field? Why you don’t like what you see in UI field? What should be there instead?
If to sum up, in order for your entity to work, it must satisfy following criteria:
is should correspond to PXProjection requirements, which states that NoteID should have record in SMEmail, classID should be equal to email or class id equal to email routing
It should live in table CRActivity
Without 1 and 2 satisfied, Acumatica will either crash, or behave in a strange way.
@yuriyzaletskyy69 I’m not sure I’m following. It sounds like those requirements would be for creating a new CRSMEmail, which is not what I’m doing. I’m simply trying to add the CRSMEmail to a Case via the RefNoteID. This works in the backend, as it shows up under the Case’s Activity tab, but the CRSMEmail ‘Related Entity’ field doesn’t give the entity description like it’s supposed to. This is a calculated field on CRActivity (PXFormula). I’m not sure how to accomplish this.
// Reassign Appointment to Case instead, so the Case's 'Appointment Date' is correct bAccountGraph.Activities.Current = bAccountGraph.Activities.Search<CRPMTimeActivity.noteID>(appointment.NoteID); bAccountGraph.Activities.SetValueExt<CRPMTimeActivity.refNoteID>(appointment, taxCase.NoteID); bAccountGraph.Activities.Update(appointment); bAccountGraph.Actions.PressSave();