Email Activity Creation Problem

Advertisement
October 11

I m new in MS Dynamic CRM 2013. I m trying to make a email activity on the update of a issue (case). but I m getting error at:
 CreateResponse resp = (CreateResponse)slos.Execute(reqActivity);
I m attaching the whole code here:
// <copyright file="PostIssueUpdate.cs" company="">
// Copyright (c) 2015 All Rights Reserved
// </copyright>
// <author></author>
// <date>1/29/2015 2:37:35 PM</date>
// <summary>Implements the PostIssueUpdate Plugin.</summary>
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
// </auto-generated>
namespace CrmVSSolution1.Plugins
using System;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using System.ServiceModel.Description;
using System.Text;
using System.Collections.Generic;
using System.Linq;
// These namespaces are found in the Microsoft.Xrm.Sdk.dll assembly
// found in the SDK\bin folder.
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Discovery;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Crm.Sdk.Messages;
/// <summary>
/// PostIssueUpdate Plugin.
/// Fires when the following attributes are updated:
/// All Attributes
/// </summary>
public class PostIssueUpdate: Plugin
/// <summary>
/// Initializes a new instance of the <see cref="PostIssueUpdate"/> class.
/// </summary>
public PostIssueUpdate()
: base(typeof(PostIssueUpdate))
base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Update", "incident", new Action<LocalPluginContext>(ExecutePostIssueUpdate)));
// Note : you can register for more events here if this plugin is not specific to an individual entity and message combination.
// You may also need to update your RegisterFile.crmregister plug-in registration file to reflect any change.
/// <summary>
/// Executes the plug-in.
/// </summary>
/// <param name="localContext">The <see cref="LocalPluginContext"/> which contains the
/// <see cref="IPluginExecutionContext"/>,
/// <see cref="IOrganizationService"/>
/// and <see cref="ITracingService"/>
/// </param>
/// <remarks>
/// For improved performance, Microsoft Dynamics CRM caches plug-in instances.
/// The plug-in's Execute method should be written to be stateless as the constructor
/// is not called for every invocation of the plug-in. Also, multiple system threads
/// could execute the plug-in at the same time. All per invocation state information
/// is stored in the context. This means that you should not use global variables in plug-ins.
/// </remarks>
protected void ExecutePostIssueUpdate(LocalPluginContext localContext)
if (localContext == null)
throw new ArgumentNullException("localContext");
// TODO: Implement your custom Plug-in business logic.
IPluginExecutionContext context = localContext.PluginExecutionContext;
IOrganizationService service = localContext.OrganizationService;
if (context.InputParameters.Contains("Target") &&
context.InputParameters["Target"] is Entity)
// Obtain the target entity from the input parmameters.
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName == "incident")
string entityDescription = "There is no note found";
try
if (entity.Attributes.Contains(""))
entity.Attributes["description"] = entityDescription;
CreateRequest reqActivity = new CreateRequest();
Entity newEmail = new Entity("email");
newEmail["subject"] = "This is for testing";
newEmail["description"] = entityDescription;
Entity ap = new Entity();
Entity ap2 = new Entity();
ap = new Entity("activityparty");
ap["addressused"] = "[email protected]";
Entity[] aryTo = { ap };
newEmail["to"] = aryTo;
ap2 = new Entity("activityparty");
ap2["partyid"] = new EntityReference("systemuser", new Guid(""));
Entity[] aryFrom = { ap2 };
newEmail["from"] = aryFrom;
newEmail["regardingobjectid"] = new EntityReference("account", new Guid(""));
reqActivity.Target = newEmail;
CreateResponse resp = (CreateResponse)slos.Execute(reqActivity);
catch (FaultException ex)
throw new InvalidPluginExecutionException("An error occurred in the plug-in.", ex);

Advertisement

Replay

Hello,
Could you please point to the part of your code where you have declared "slos"? I rechecked it twice and I see nothing. Also could you please provide an exception message that you are getting?
Dynamics CRM MVP/ Technical Evangelist at
SlickData LLC
My blog

View 2 Replies

How to edit the value in the email activity in process flow

October 11

I have an email activity in my process flow. I want to change the value for the message body of the email activity. But it is not editable. While creation all the columns are in editable mode and after deploying and testing, i want to change the body

View All Replies

How to create Incoming Email Activity using BAPI or Function module

October 11

To create an Incoming Email Activity using BAPI 'BAPI_ACTIVITYCRM_CREATEMULTI' or using 'CRM_ORDER_MAINTAIN' . what parameters i need to pass to a bapi. Suggest me with a solution. Regards, SanjaniFor activity you must fill the following structures o

View All Replies

Email Activity Template

November 30

Hi, I've created an email activity template, and I've added this to many of my process flows. It's all working great and emails are being fired. Within the set-up parameters of the email activity template, I've changed default value of the 'TO_ADDRES

View All Replies

Qs on setting ReplyTo multiple address in EMail activity

November 30

Hi, I am trying to put EMail activity, in that i am trying to put reply-to as two different addrerss like [email protected],[email protected] When i run bpel process i get following exception... 07/11/13 13:39:03 javax.mail.internet.AddressException: Illegal address in

View All Replies

IPad mail sending one page PDF documet as a picture. This picture is not viewing for other people who email open. this problem is from iBooks and from Pages.  (if I sending one page document from Pages from iPhone is ok - PDF)

November 30

iPad mail sending one page PDF documet as a picture. This picture is not viewing for other people who email open. this problem is from iBooks and from Pages. (if I sending one page document from Pages from iPhone is ok - PDF. If I sending one page do

View All Replies

Anyone having trouble sending email but no problem receiving?

November 30

Having trouble sending messages from mac email but no problem receiving emails? Not sure how to get it working. Called apple and they want my credit card before they help me. Did anyone else have this email problem.With Mail running, click Window in

View All Replies

Apple Mail and Yahoo Web Mail won't work when iPhone Email Active

November 30

It is interesting that when I have my iPhone email active, if I try to download messages to Apple Mail on a regular computer, I get the enter password screen over and over (password is already in the system) so I never get mail. Also when I have my i

View All Replies

Using email activity in Process Flow

November 30

Hi I am creating a process flow in owb, in it I am using the email activity, that if its a success or error then send the email. In the email activity parameters there is an option of binding, so can some one tell me that how will it work and how can

View All Replies

E75 Email (Access Point problem)

October 11

Hi,   I've setup nokia email without any problem using my WiFi and it was synchronizing without a problem. Since then I've I'm unable to change the Access Point to my Mobile provider. I keep getting "Server not found", even though the server nam

View All Replies

Imtss problem, firefox cant open email activation link

November 30

hello guys, my firefox can't open the activation email i got for activating my itunes store account. i tried all things to get it work but nothing helped. can some1 of you active my account please? here's the link: https://buy.itunes.apple.com/WebObj

View All Replies

Iphone4 SLOW in sending emails - various other problems

November 30

Not sure where to stick this but I'm hoping someone can help. I recently switched from a 3G to the new iphone4 and I've noticed quite a few problems. The most annoying to me I'd say is sending pictures from my camera roll to my email (or anyones emai

View All Replies

Database creation problem on Windows XP

October 11

Hello Readers I have installed ORACLE Database Engine on windows XP. I am facing problem in database creation. I have tryed wizard as well as mannual method. in wizard at 90% it gives an error "END-OF-FILE ON COMMUNICATION CHANNEL" although CD d

View All Replies

Recently my mozilla opened emails show loading problem of pages and emails in inbox are not getting opened and other folders of email also not getting loaded

October 11

recently i have downloaded many video converter softwares. After that whenever i open my emails, I am not able to load the pages. Only it opens to inbox and when i click any mail in inbox, it opens the mail and immediately close that automatically wi

View All Replies

LDAP Active Directory Problem

October 11

Hi, i have a win 2003 server (german) and apex 3.x. I (hope i ) have read all postings to this topic. Read the Apex Book, tried the Oracle Examples but all examples i have found won´t work for me. After three hours i found one solution that works: (D

View All Replies

Email xml attachments: Problems with charset

October 11

Hi all, I have an email proxy to read emails with xml attachements. In the pipeline i recovered the xml file and covert it to Base64. When i execute it on a windows environment the process works fine with all characters (ó,ò,ñ,Ç, etc..) but if it is

View All Replies

IPad 1 email and performance problems ios5

October 11

Since I upgraded my iPad 1(wifi only) to iOS 5' I have been having numerous performance problems, and my email continuously sys "checking Email". I have tried restarting my iPod ith no luck. Deleting d reading the accounts woks briefly, but afte

View All Replies

In NWDI Activity Activate Problem

November 30

Hi Friends When i am Activate one my Activity I am got the Error. That Activation is not Activate. How to Solve the issue.      [wdgen] [Error]   coats.spi.wdjcomponent.poclosedetails.CO_POClosureDetails --> ContextModelNode Ymm_Sc_Bapi_Po_Close_Inpu

View All Replies

Auth. check for BP is invalid when do account search/activity creation

October 11

Hi Experts, I have done the configuration for BP's anthorization group(B_BUPA_GRP). But when I do the BP Search, the authorization check for B_BUPA_GRP is invalid and all BPs are shown. This also happened when create activity. When choose a Partner,

View All Replies

Email images display problem

November 30

I have a problem with email attached images.. When I open the email it's all appearing fine but after few seconds the page gets begger and only half of it appears and I can't see the other half no matter how much I scroll.. I'm om ios5.0.1 now but I'

View All Replies

Tags:

  1. ipod nano wont turn on
  2. anonymous
  3. Free youtube settings sa nokia503
  4. ifroget my icloud id n pasword
  5. itunes error code 13014 mac os 10.5.8
  6. iphoto 8.1.2 hanging delete plist
  7. FCAREGUL
  8. SAP PI CPIC-CALL: ThSAPCMRCV
  9. using outline load utility
  10. cisco ise authentication failure
Copyrights 2018 Fcffair BigData Resource, All rights reserved