Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

trigger worklfow after record created?

(0) ShareShare
ReportReport
Posted on by 2,397

Hi, I am trying to get the context of newly created record during the creation, but it looks like I can not do that, so is it possible to trigger a custom workflow after record created? 

*This post is locked for comments

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: trigger worklfow after record created?

    Hi,

    If you are using a Create message to create record then do note that this returns the GUID of the newly created record which you can then use it. For example, if you create account record from SDK and then wants to create a task for it, you can do this like this..

    Sample Code:

    // Get the id of the account being created

    var accountId = _service.Create(newAccountObject);

    // Create an entity reference object from the returned account Guid

    var newAccountRef = new EntityReference()

    // Create a task for the account

    newTask["regardingobjectid"] = newAccountRef

    _service.Create(newTask);

    Hope this helps

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: trigger worklfow after record created?

    Hello,

    It is possible. What issue do you experience?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans