Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to create entity records based on SQL dataset

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have a custom activity entity (a "store audit") with a related entity ("products") that has a 1:N relationship (one activity record to multiple records in the related entity).

The idea is that a salesperson will visit a store to do an audit of the products of ours that the store sells. Since we have a dataset in another SQL database that tells us which products a given store sells... we want to use this data to automatically create records in the related "product" entity once a new "store audit" is created.

How do I do this?  Specifically... how do I create records for an entity based off a SQL dataset?  

EX: We are doing a store audit at STORE5 and we know they sell: PRODUCT1, PRODUCT3, PRODUCT4.   So, when a store audit activity is created, we want to look up in our SQL dataset for STORE5 and pull the products ->  then create records in the "products" entity and auto populate some of the fields in each record.

What is the approach to doing this?  I understand workflows can kick certain things off, like creating a new record... but it's almost like I actually need to call a stored procedure and then have records created based off the result set of this stored procedure.

*This post is locked for comments

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: How to create entity records based on SQL dataset

    Well you can create a web api to return the products from SQL DB. Then create a plugin in CRM to call that API and get the products and create records when a store audit record is created.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to create entity records based on SQL dataset

    Could that be on-demand instead and triggered some way from CRM? (Ex: triggered off the activity record creation)

    Is this Kingsway soft thing similar to cozyroc by chance?

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: How to create entity records based on SQL dataset

    You can create an SSIS package with Kingsway soft extension and schedule it to run on regular intervals. The package can read data from your SQL database and upsert records to CRM.

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