Hi, Can we create a replacement parameter for a session, which can hold some temporary value, based on which some actions cannot be called again and again?
*This post is locked for comments
Hi, Can we create a replacement parameter for a session, which can hold some temporary value, based on which some actions cannot be called again and again?
*This post is locked for comments
There are multiple ways of handling this. Like Neil suggested, you can run an action to do CopyToContext which will copy your data to "$Context" section.
Else if you are doing this for a specific hosted control inside C# code, you can copy the data to the specific hosted control. Below is the code to do the same.
1. If your Hosted Control is global hosted control :
var parameters = new Dictionary<string, CRMApplicationData>();
parameters.Add(Constants.usdParameterName, new CRMApplicationData() { name = <<Name of the Parameter>>, type = "string", value = <<Value to add>> });
((DynamicsCustomerRecord)((AgentDesktopSession)localSessionManager.GlobalSession).Customer.DesktopCustomer).MergeReplacementParameter("Name of Hosted Control", parameters, true);
2. If your Hosted Control is not Global
var parameters = new Dictionary<string, CRMApplicationData>();
parameters.Add(Constants.usdParameterName, new CRMApplicationData() { name = <<Name of the Parameter>>, type = "string", value = <<Value to add>> });
((DynamicsCustomerRecord)((AgentDesktopSession)localSessionManager.ActiveSession).Customer.DesktopCustomer).MergeReplacementParameter("Name of Hosted Control", parameters, true);
We have a concept of CopyToContext, have you looked at that?
neilparkhurst.com/.../usd-copytocontext
Each session has a context, essentially some replacement parameters that relate to the current session. A CopyToContext action lets us copy a parameter into that context that can then be used / re used. Something like "[[$Context.MyParameterName]]".
Failing that you could look at the SaveSetting concept.
neilparkhurst.com/.../usd-savesetting
This allows us to save a user setting. User settings are retained and not "just" related to the current session. You'd read one of those with syntax like "[[$Settings.MyParameterName]]".
Hopefully one of these approaches will answer you question.
What do you mean by Replacement parameter for a session?
André Arnaud de Cal...
292,494
Super User 2025 Season 1
Martin Dráb
231,309
Most Valuable Professional
nmaenpaa
101,156