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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to execute a custom action ftrom C#

(0) ShareShare
ReportReport
Posted on by

1731.forum.png

And i get this exception:

I saw many examples using the Custom Action "Unique Name" as the constructor parameter.

0523.exception.png

The custom action:

7875.customaction.PNG

The custom entity:

customent1.png

*This post is locked for comments

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

    The custom action should create a new record for the ExcelExportEntity, but instead it looks for an existing entity using the GUID provided...? Whats wrong here?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    The thing is you try to execute action in the context of entity and you pass non-existing record as a target. That fairly generates an exception. If your Action is not entity-related I would suggest to redesign your action using Global action (without any relation to some type of entities).

    UPD: Make your action Global and add that entity you want to create during import as Output.

  • Community Member Profile Picture
    on at

    Ok, but then I will not show up in the Plugin Registration Tool when I want to add a new step. The Message text field will not provide me to choose the action which is defined global?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hans,

    It would. I've done that many times so I'm pretty sure what I am talking about.

  • Community Member Profile Picture
    on at

    3750.registerstep.PNG

    3750.registerstep.PNG

    As you can see, the custom global action does not show up.

    And it also starts with "rbc_". 

    At least I don't get an exception.

    var er = new OrganizationRequest("rbc_ActionExcelExport"); 
                       
    er["ViewId"] = Guid.NewGuid().ToString();
    er["EntityName"] = "rbc_actionactivityexcelexport";
    er["QueryName"] = "trallalalala";
    er["QuickFindQueryId"] = Guid.NewGuid().ToString();
    er["DefaultSavedQueryViewId"] = Guid.NewGuid().ToString();
    er["UserOwnedViewId"] = Guid.NewGuid().ToString();
    er["TotalRecordCount"] = "500";
    
    OrganizationResponse response = proxy.Execute(er);

  • Community Member Profile Picture
    on at

    restarting Plugin registration tool helped ! Thanks a lot Andrii !!!!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans