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 :
Customer experience | Sales, Customer Insights,...
Answered

How to get current Application ID in CRM Plugin

(0) ShareShare
ReportReport
Posted on by 55

Hi,

I have requirement that i need to append application ID to record URL and save it in CRM form field using Plugin.

Is there any solution to achieve the same?

I have the same question (0)
  • cloflyMao Profile Picture
    25,210 on at

    Hi Divya,

    We could only get application id by javascript. 

    Did you plugin only fire at some simple events such as on creation of record or on update of record?

    If so, a workaround is that you could convert your plugin into a custom workflow activity:

    1. Run javascript at onSave event of form.

    2. We can get both entity name and app id by client API.

    3. Call the custom workflow with params from step 2 by ExecuteWorkflow action.

    Regards,

    Clofly

  • Divya Bharti Profile Picture
    55 on at

    Hi problem is that we require to update this value no matter from where record is created.

    With this logic it will restrict to create with Form and run JS everytime.

  • David Jennaway Profile Picture
    14,065 on at

    As per the previous post, the Application ID is solely available on the client-side - a plugin is not aware of the Application ID. Therefore your only option is to use client script on a form to get the Application ID. You can do this is in the OnSave event, and put the Application ID in a field on the entity, which can then be read by a plugin. You can get the Application ID using the getCurrentAppProperties method

  • Verified answer
    Charles Abi Khirs Profile Picture
    3,569 on at

    Hello,

    What I suggest is to create a Parameters entity that has 2 fields: Name (i.e ApplicationGUID) and Value (<Application GUID value>).

    In your plugin code, retrieve your parameter based on the needed Name and get the Value of the Application Id that you can use in the rest of your code.

    The downside is that you have to add this entity to your solution when deployment and create the record in your new environment with the correct Application ID

  • Verified answer
    Kumar Viju Profile Picture
    1,026 on at

    Assuming the Application ID is always a constant value depending on the App the user has access.

    The recommended way is to create an environmental variable; this is a widespread practice wherein you may have an entity dedicated to holding constant values.

    Create a config entity in your system and create parameters for Key and Value(similar to config files).

    Ex.

    Key - SalesAppId

    Value - "ascef47845345erer454545ew"

    In your plugin, access this variable by passing Key and retrieving the Value from Config Entity. 

    Tip:

    - For Plugin, create a helper class and have the function defined to access any key and related values to be utilized in future

    - For Config Entity, Create attribute type Multiline Text Type so that you can reuse for future large constant values (Eg. FetchXml Script).

  • Suggested answer
    Kumar Viju Profile Picture
    1,026 on at

    Assuming the Application ID is always a constant value depending on the App the user has access.

    The recommended way is to create an environmental variable; this is a widespread practice wherein you may have an entity dedicated to holding constant values.

    Create a config entity in your system and create parameters for Key and Value(similar to config files).

    Ex.

    Key - SalesAppId

    Value - "ascef47845345erer454545ew"

    In your plugin, access this variable by passing Key and retrieving the Value from Config Entity. 

    Tip:

    - For Plugin, create a helper class and have the function defined to access any key and related values to be utilized in future

    - For Config Entity, Create attribute type Multiline Text Type so that you can reuse for future large constant values (Eg. FetchXml Script).

  • Divya Bharti Profile Picture
    55 on at

    Thanks i used this same approach i was able to do this. I used system workflow to pass application name on my condition and in custom workflow based on parameter name retrieved app ID.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans