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)

When to switch to Xrm development?

(0) ShareShare
ReportReport
Posted on by

I have a custom solution I am preparing for a client.  I have custom entities that are to be used by various existing Entities.  When the custom entity's status is changed, I want it to create a History Record (another of my custom entities) marking the change in status.  I have created my .js library of functions and am using it for setting defaults, etc.  However, I can't find any objects that I can use in the .js functionality that will allow me to create records in other entities.  So I have a few questions:

1) Am I missing something or do I need to move this to an Xrm project to accomplish what I want.

2) I have been a .NET developer since it came out, but the SDK docs are incredibly obtuse and fractured.  Is there an easier resource for learning how to put together a simple project that does what I need?

Any help is appreciated - thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    matthew.mickas Profile Picture
    505 on at

    CRM has a set of OData endpoints that allow a user to do your normal CRUD operations.  Here is an example in the JS libraries to create an account record.  You can do the same with your custom record, just need to get the "name" of the record you wish to create (your history record).  Should be something like [publisher prefix]_historyrecord.  Also be careful as this is case sensitive.

    So when you do the following

    SDK.REST.createRecord(

         [publisher prefix]_historyrecord,

        " [publisher prefix]_historyrecord",

        function (account) {

         writeMessage("The account named \"" + account.Name + "\" was created with the AccountId : \"" + account.AccountId + "\".");

         writeMessage("Retrieving account with the AccountId: \"" + account.AccountId + "\".");

         retrieveAccount(account.AccountId)

        },

        errorHandler

      );

    msdn.microsoft.com/.../gg334427.aspx

    Also if your using the SDK, there are examples in the SDK that can help you create simple projects if you want to do this in .Net or C#.

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    I would recommend using a Real time workflow that is triggered on change of status. You can then create a record with the necessary data.

    This will be far easier to write and maintain - plus it will work when users use bulk edit or another workflow updates the entity.

    See msdn.microsoft.com/.../dn481598.aspx

    Hope this helps,

    Scott

  • Community Member Profile Picture
    on at

    That still requires a .NET application, correct?  Simpler, true, but an app that creates the Workflow record.  (Sorry if that sounds dense, but this is my first CRM mod since CRM 4.0, so I'm playing a little catchup.)

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