This project has moved and is read-only. For the latest updates, please go here.

Using custom action

Dec 2, 2015 at 5:26 AM

I am trying to use the custom action 'dxtools_SendCustomEmail' through my code but I am getting object reference not set to an instance..... error. Below is my code

OrganizationRequest request = new OrganizationRequest("dxtools_SendCustomEmail");
request.Parameters.Add("EmailTemplateName", templateName);
request.Parameters.Add("ToRecipient", to);
request.Parameters.Add("FromSender", new EntityReference("systemuser", whoAmI.UserId));
request.Parameters.Add("Regarding", payment.ToEntityReference());
request.Parameters.Add("RecordContext", payment.ToEntityReference());

OrganizationResponse reponse = _helper.OrgService.Execute(request);

When I open the custom action and view the properties for first step 'Create email' nothing is mapped to the input parameters. Do I need to do something to make this work?

Dec 7, 2015 at 7:43 PM
Hi Mirhassanali,

Do you get more details from the tracing?

Have a look at this integration test, it may help you as an example:

The custom action provides 2 options to supply parameters: input parameters and workflow context parameters. Have a look at this code:

Dec 9, 2015 at 4:08 AM

Got it working after adding the following parameter:

request.Parameters.Add("Attachments", string.Empty);