apply template
-
1 สิงหาคม 2550 11:02
I have an email message and with this, I want to create an email but apply a template to the email.
I can get the template I want, thats fine and returns a valid object. Thats all good but now when I am creating the email request, how can I apply that template?
I've tried following the code in the SDK doc but I get an "unexpected error occured".
InstantiateTemplateRequest instTemplate =
new InstantiateTemplateRequest();
// The email template to use.
instTemplate.TemplateId =
new Guid("9AF74EF9-A04C-DA11-A0C5-000D9DD8CDAC"); //replaced correctly
// The object that this email is regarding.
instTemplate.ObjectId = new Guid("A0F2D8FE-6468-DA11-B748-000D9DD8CDAC"); //replaced correctly
instTemplate.ObjectType = EntityName.account.ToString(); //replaced correctly
//Uncomment this next line to return dynamic entities.
//instTemplate.ReturnDynamicEntities = true;
// Execute the request to create an email message from the template.
InstantiateTemplateResponse instTemplateResponse =
(InstantiateTemplateResponse)service.Execute(instTemplate); //here
ตอบทั้งหมด
-
2 สิงหาคม 2550 8:05ผู้ดูแล
The initial release of CRM had a bug when programmatically using templates (http://support.microsoft.com/kb/912324/) - this was fixed in update rollup 1 - maybe this is your problem, as your code looks OK
-
2 สิงหาคม 2550 10:06
Thanks, we are actually using Rollup 2 but having this problem -
2 สิงหาคม 2550 10:24
Thanks, we are actually using Rollup 2 but having this problem