Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Unable to get OutArgument values in action calling from web resource

(0) ShareShare
ReportReport
Posted on by 8

Response in web resource, Object reference not set to an instance of an object. issue is with Out argument. tried 

Declared :

[Output("SessionId")]
public OutArgument<string> SessionId { get; set; }

Tried with both, issue not resolved

SessionId.Set(context, SessionIdLocal); and  

SessionId = new OutArgument<string>(new Variable<string>() { Default = SessionIdLocal });

Please posts any reference document that implements OutArgument for workflow action.

Thanks.

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Unable to get OutArgument values in action calling from web resource

    OutArgument references don't need to be directly instantiated. OutArgument references are automatically instantiated by the workflow engine, though it's possible that it may not instantiate them if the result is not then used anywhere in the workflow. I use the following pattern:

    if (SessionId != null)

    {

    SessionId.Set(context, SessionIdLocal);

    }

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,959 Super User 2024 Season 1 on at
    RE: Unable to get OutArgument values in action calling from web resource

    Hi,

    Did you try executing custom from C# code using organizationrequest and check if output parameter is getting retuned?

    As per microsoft docs syntax seems to be correct.

    Can you also try implementing plugin code and see if it works.

    If found helpful, Please mark my answer verified.

  • phanikumar Profile Picture
    phanikumar 8 on at
    RE: Unable to get OutArgument values in action calling from web resource

    Hi David,

    Thanks for the response. Context variable is not null... Does OutArgument require any initialization.? any default value 

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Unable to get OutArgument values in action calling from web resource

    The syntax using Set looks correct. Are you sure the context variable is not null ?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans