问题
I am trying to create an e-mail with to and from already filled in. To create the e-mail, I'm creating a graph instance of CREmailActivityMaint. Whenever I attempt to assign new objects to the CREmailActivityMaint.CurrentMessage or CREmailActivityMaint.Message objects so that I can set values, the opening page becomes uneditable and Send is hidden:
Also when I enter values, not all of them show. In this, I entered To, From, Subject, Summary, and Body, but Body and Summary show nothing. Also if I attempt to save, I get an error stating that the Summary, To, and Subject are blank:
回答1:
CREmailActivityMaint graph = CreateInstance<CREmailActivityMaint>();
graph.Message.Current = graph.Message.Insert();
graph.Message.Current.MailTo = "other@test.com";
graph.Message.Current.MailCc = "another@test.com";
graph.Message.Current.MailBcc = "bcc@test.com";
graph.Message.Current.Subject = "Subject";
graph.Message.Current.Body = "Body";
graph.Message.Cache.IsDirty = false;
PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.NewWindow);
来源:https://stackoverflow.com/questions/47250950/how-can-i-open-an-editable-sendable-e-mail-screen-with-prepopoulated-values