web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Action Parameters not being set

(0) ShareShare
ReportReport
Posted on by

Hi,

Will try to explain this one as best I can.

I have a workflow that triggers on the completion of a task. It calls a Custom workflow assembly that has 2 input parameter strings. In that cwa it checks if one of the strings has text and if it does it set the input parameters of an action and calls it. The action calls another cwa and is there so that the code under can be used from jscript as well as code. All it does is pass the parameters from 1st cwa as the input parameters to the 2nd cwa. The 2nd custom activity just receives a text string and will output whether the string is valid (boolean output) and if not an error string.(string output).

Now when I debug I can see that the 2nd CWA are being set correctly, however when I try and retrieve them from the action response there is nothing there. I have not used actions extensively so am I missing a step?

//Call an action here to validate first.
OrganizationRequest req = new OrganizationRequest("ukg_ValidatorAction");
req["ValidationRulesString"] = validationString;
req["Target"] = regardingRef;

//execute the request
OrganizationResponse response = service.Execute(req);

returnResult = (bool)response.Results["ValidationResult"];
validationErrors = (string)response.Results["ValidationErrors"];

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    4370.snip2.png

  • Community Member Profile Picture
    on at

    Your regardingRef value, is that an EntityReference object? eg

    req["Target"] = new EntityReference("new_entityofaction", idOfEntity);

  • Community Member Profile Picture
    on at

    EntityReference regardingRef = new EntityReference();
    regardingRef = entity.GetAttributeValue<EntityReference>("regardingobjectid");

  • Verified answer
    Community Member Profile Picture
    on at

    Figured this one out, I was not assigning the output parameters on the 2nd cwa to the output parameters in the action. Did that and it worked perfectly. Simples!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans