Hi
When this link is generated, is it by a workflow/plugin or Javascript?
if its javascript, you can use the following line in your webresoruce to set the link
var url = "https://www.ourwebsiteurl.com/survey/?caseid=" + formContext.data.entity.getId();
[View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/formcontext-data-entity/getid:750:50]
if its workflow, you will have to create a custom workflow activity, something like the following
namespace Microsoft.Crm.Sdk.Samples
{
public sealed class GenerateSurveyURL : CodeActivity
{
[Input("Case")]
[ReferenceTarget("incident")]
public InArgument<EntityReference> Case { get; set; }
[Input("Source URL")]
public InArgument<string> SourceURL { get; set; }
[Output("Generated Url")]
public OutArgument<string> GeneratedUrl { get; set; }
protected override void Execute(CodeActivityContext executionContext)
{
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
EntityReference caseER = Case.Get(activityContext);
string sourceUrl = SourceURL.Get(activityContext);
GeneratedUrl.Set(sourceUrl.Replace("{}", caseER.Id));
}
}
}
This can then be called in a workflow to generate the URL. Please see the link below to read more about custom workflow activity(CWA)
When you call this CWA in your workflow, you will have set the Case to Case input and for Source URL : https://www.ourwebsiteurl.com/survey/?caseid={}.
[View:https://community.dynamics.com/365/f/761/t/234283:750:50]
Hope this helps