Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Output arguments in Custom Workflows do not show up in my process designer. Help please

(0) ShareShare
ReportReport
Posted on by

Hi. I just started as CRM developer at a college. We use Ellucian, which is CRM for higher ed built on MS Dynamics. Trying to test custom workflows. Code clearly has output argument. just a string for testing:

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Workflow;
using System;
using System.Activities;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WheatonPluginDelta.Activities
{
    public class AppointmentPopulateSpouse1 : CodeActivity
    {
        [RequiredArgument]
        [Input("Person")]
        [ReferenceTarget("contact")]
         public InArgument PersonRef { get; set; }

        [RequiredArgument]
        [Input("Appointment")]
        [ReferenceTarget("appointment")]
        public InArgument AppointmentRef { get; set; }

        [Output("output string")]
        public OutArgument MyOutput { get; set; }

        protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracingService = executionContext.GetExtension();
            IWorkflowContext workflowContext = executionContext.GetExtension();
            IOrganizationServiceFactory serviceFactory = executionContext.GetExtension();
            IOrganizationService orgService = serviceFactory.CreateOrganizationService(workflowContext.UserId);



            EntityReference personRef = PersonRef.Get(executionContext);
            EntityReference appointmentRef = AppointmentRef.Get(executionContext);

            var appointment = new Entity("appointment", appointmentRef.Id);

            var spouse = orgService.Retrieve("contact", personRef.Id, new ColumnSet("spousesname"));

            if (spouse["spousesname"] != null)
            {
                MyOutput.Set(executionContext, spouse["spousesname"]);
            }
            else
            {
                MyOutput.Set(executionContext, "no spouse found");
            }
        }
    }

But once I implement on a workflow, my inputs will show up on the process designer, but not my output:

pastedimage1669918333218v2.png

Like, when I click on properties for the second step:

pastedimage1669918238153v1.png

Any help would be greatly appreciated!

  • yohanhwang Profile Picture
    yohanhwang on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    Well, it will take me some time to test that because now I need to pull the actual reference rather than the string from somewhere else. But this little exchange was no doubt extremely helpful. It may seem small but for me this was major breakthrough. Thank you so much Andrew for your willingness to help. Really appreciate it.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    Not sure it will easily work but you should try with "EntityReference" output type.

  • yohanhwang Profile Picture
    yohanhwang on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    Ok, I think I see what you mean. So I had to select with my cursor the "subject" field, and then yes I can see my output on the right bar, which is great! (I'm seeing that for the first time, yeee) However, what if I had wanted to put my output in another field on the form other than "subject"? It seems to work for "subject", "objectives" and "location", but I was originally aiming at "Additional Attendees", and for that one, it doesn't seem to work. I have no outputs as my original pic showed. Is this because of not matching data types, like the one I want will not take a string but only a guid or something?

    I know I seem to ask silly questions but I just started about a month ago and it does feel like I was thrown to the deep end at once.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    In your form, you have the "Subject" field. Set focus on that field and then try to select your output from the dropdown.

  • yohanhwang Profile Picture
    yohanhwang on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    Andrew, thank you for your prompt reply. I'm sorry but I don't think I follow what you say. Can you show me how to do this please? Thank you.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Output arguments in Custom Workflows do not show up in my process designer. Help please

    Hello,

    In order to use the output in the process you should first set the focus on the applicable field (string in your case).

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans