Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Storing configuration data in dynamics 365

Posted on by Microsoft Employee

I need to store an external api's url in dynamic 365. Recommended ways I have found are storing it in a Key Value Pair entity or configuration entity.But I dont know how to implement/use them. I need some guidance about their implementation.Any help would be much appreciated.

Categories:
  • Suggested answer
    Dharanidharan Profile Picture
    Dharanidharan 390 User Group Leader on at
    RE: Storing configuration data in dynamics 365

    You can fetch the records from that custom entity using query expression or fetch XML by passing the configuration key name

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Storing configuration data in dynamics 365


    Thanks T.I.A. It worked. I was passing wrong select parameters.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Storing configuration data in dynamics 365

    Error details are

    1. code: 2147951872
    2. errorCode: 2147951872
    3. innerror: undefined
    4. message: ""
  • T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Storing configuration data in dynamics 365

    do you get any errors?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Storing configuration data in dynamics 365

    I'm  still unable to fetch data. the queries I have tried are
    1)window.parent.Xrm.WebApi.retrieveRecord("cml_configuration", "c82fbee3-6b97-e911-a995-00224800cc7a", "?$select=name").then(
    2)window.parent.Xrm.WebApi.retrieveMultipleRecords("cml_configuration", "?$select=name&$top=3").then(
    but none has worked. Although I dont want to hard code the record id but in an attempt to make it work I even hard coded it in the first query.This is the screenshot of my entity record

    ConfigurationRecord2.png

  • Suggested answer
    Priyesh Profile Picture
    Priyesh 7,392 User Group Leader on at
    RE: Storing configuration data in dynamics 365

    If you want to write a FetchXML in your query, you can simply query using Advanced Find and then download the FetchXML.

    Hope this helps.

  • Verified answer
    T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Storing configuration data in dynamics 365

    docs.microsoft.com/.../retrieverecord this article should get you going.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Storing configuration data in dynamics 365

    Thanks T.I.A and Priyesh Wagh. I have created a custom entity and stored configuration data n its fields. Can you please help me in writing the query for fetching data from this custom entity in javascript.

  • Verified answer
    Priyesh Profile Picture
    Priyesh 7,392 User Group Leader on at
    RE: Storing configuration data in dynamics 365

    Hi,

    Usually, it's a good idea to create an entity just for Configuration. You can have a field in the same in which you can store this key in a string field. And then also make this field as Field-level security enabled for only System Administrators to be accessible/readable.

    Supposedly, you will have a user's credentials that will access this api key, that user should be added to the access as well.

    Hope this helps.

  • Suggested answer
    T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Storing configuration data in dynamics 365

    If you create a new entity (name is up to you) you can use a text field for your API URL. So the entity has:

    Name: name of external API

    URL: string field to hold the URL of your choice.

    Now whenever you are developing etc you can query that entity by name and bring back the URL value for whatever you need to do. Let me know if this helps

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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