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)

Global parameters -How to retrieve across the session/entities

(0) ShareShare
ReportReport
Posted on by

CRM experts : I am relatively new to MS Dynamics. As given in the example below, can we create static values for different attributes in an entity) and be able to retrieve from any session /connection to the system. (Via User session or back ground process to base logic in the code execution.  (I would like to avoid multiple calls to the entity to get the values instead cache them through out the session).

Thoughts on doing or achieving the requirement. Any inputs and high level direction is appreciated.

Example in Entity A :

Attribute 1 (string of values separated by comma) : email, phone, US Mail.

Attribute 2 (Integer) : 1000

Attribute n (String) : You do not have access to this operation             

Thank you for your time

Harihar

*This post is locked for comments

I have the same question (0)
  • Gus Gonzalez Profile Picture
    27,113 on at

    Hi Harihar,

    Can you be more specific about the requirements?

    I'm not sure I understand what you are trying to do.

    Thank you.

  • Community Member Profile Picture
    on at

    Hi Gus,

    Basically I am looking a way to retrieve properties or variable values that are common  to any connected session (both (UI and Non-UI) i.e., backend via webservices/loads etc., and connected users using the CRM UI) to help drive logic when the user navigates forms/views.

    Non-UI side, use the information for business logic and take action is the code/services.

    hope this clarifies further.

    Thank you for taking time to review my query and respond.

    Thank you,

    Harihar

  • Suggested answer
    Waqar Sohail Profile Picture
    on at

    Hey Harihar, your question is little confusing. As i understand that you want to save some configuration and want to retrieve it using CRM Service. 

    As you mention want to create static values. As it can be pre-define configuration store in one Entity as Key value records or as string. So you can retrieve it all in one call and use it for you. Please clarify if there is something else.

  • Suggested answer
    Hosk Profile Picture
    on at

    If you want some static variables, then the best way to this is to create an entity in CRM called configuration and have two fields called name and value.

    Then where ever you are in CRM, plugins, javascript etc you will be able to retrieve the values by retrieving the named values.

  • Community Member Profile Picture
    on at

    Thank you Waqar and Ben - thank you for your response. Wanted to confirm or get your inputs on Where to invoke the call and how we can keep the values in Cache (Name and Value) for the entire session. For example a user (Harihar) logs into CRM - I would like to have the name and value for the static info for the entire session till I log out and be able to use any of the named attribute and get the value.

    Similarly when a backend process connects to CRM - I would need the same.

    Idea is to avoid multiple calls to the entity/attributes instead use from the cache.

    Any inputs - high level approach/pointers are appreciated.

    thank you,

    Harihar

  • Community Member Profile Picture
    on at

    CRM experts - Any thoughts or suggestions. Let me know if you need further elaboration on what I am looking for.

    Thank you,

    Harihar

  • Suggested answer
    Hosk Profile Picture
    on at

    If you create a new entity and name/value records then these will be static because they will be accessible from all plugins/forms (via javascript).  

    You example of a user logs in, is a bit odd because you don't need to store name because you can access who the user is on any form/plugin.  CRM already keeps this data and it's needed to check the security for that user.

    if you wanted to store fields for each user, you could save these on their user profile but to be honest I'm not really sure you need static variables.  What is the purpose of them?

  • Community Member Profile Picture
    on at

    Ben, Thank you for your update.  I meant (Name /value pair) for all the static variables in the table and use any of them from cache to compare during the connected user session.

    User Harihar logs into CRM, Call the static table to retrieve all the Name /Value pairs - cache them in memory.

    Here is the use case: Harihar (user) when works on various forms within CRM during his session, I can use any of the static variables (kind of Global to be used within Harihar's session) to drive logic within various forms instead of querying the table every time.

    Thank you for your continued interest.

    Harihar

  • Verified answer
    Hosk Profile Picture
    on at

    When I have used CRM configuration entity.  I have not selected them all and cached them.

    instead I filtered the selection and only retrieved the fields relevant to the form the user is on.  Personally I think this would be more efficent then retrieving all the fields.  If you only select a few fields for each form the time is minimal.

    Instead of getting variables to drive logic I would use security roles. You can set different security roles to view different forms and CRM will do the querying for you.

    If you want to do this you need to create a new entity and add a value field.  Then you should create the CRM config values you want to access in the CRM system.

    You will be able to retrieve these values using Javascript

  • Community Member Profile Picture
    on at

    Thank you Ben for providing your thoughts and options.

    Harihar

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