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?
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?
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.
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).
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).
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
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
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156