How to store the guid of cloned record in the parent record so that we can use the guid to open the created case form?
*This post is locked for comments
How to store the guid of cloned record in the parent record so that we can use the guid to open the created case form?
*This post is locked for comments
Have you tried following:
Xrm.Utility.openEntityForm("incident", guid, null, { openInNewWindow: false });
Hello,
Thanks for your response!
I am able to clone the records but facing problem while opening created record in same window. I am able to open newly created cloned record in new window but I want in same (can be in different tab). I have tried Xrm.Utility.openEntityForm("incident", guid) and Xrm.Navigation.openUrl(url) but it is getting into different window.
Could you please suggest something how can I open record in same window.
I would suggest to regroup. Based on your code all your cloning is happening inside workflow. You can do following - use action instead of workflow with output of Lookup, EntityReference type. In this way you can do both - cloning and obtaining of resulting record id. Good luck.
new_guid is the hidden field in the case form. I want it to be populated with the guid of the cloned record when the workflow is executed but I am not able to populate the field new_guid. If anyhow I am able to get new_guid, I can open the cloned record form.
So the problem is how to retrieve new_guid.
How can i get the record id in the look up field and what shall i populate from the workflow?
https://community.dynamics.com/crm/f/117/p/236706/822028#822028
Thanks!
What is new_guid field and how is it populated?
Hello Andrew,
I am using the following code to clone the case record. While opening the cloned record, I need new guid. Can you please help me in that.
function ShowAlert_CloneCase() {
debugger;
Alert.show("Do you want to clone this existing case?", "", [
new Alert.Button("Clone", onAlertCloneButton), new Alert.Button("Cancel")
], "Info");
}
function HideAlert() {
Alert.hide();
}
function onAlertCloneButton() {
debugger;
Process.callWorkflow("6B537EDB-E446-442F-89FE-E993D05271B9",
Xrm.Page.data.entity.getId(),
function success() {
debugger;
alert("Workflow executed successfully");
try {
var url = "";
var guid = "";
if (Xrm.Page.getAttribute("new_guid") != null && Xrm.Page.getAttribute("new_guid").getValue() != null) {
url = Xrm.Page.getAttribute("new_guid").getValue();
var preUrl = url.substr(0, url.length - 55);
// Retrievinmg Guid - 184f3bc9-5d83-e811-81a1-0050568a58b2
guid = preUrl.substr(66);
Xrm.Page.getAttribute("new_waguid").setValue(guid);
// opening the newly created record using the guid
var windowOptions = { openInNewWindow: true }; Xrm.Utility.openEntityForm("incident", guid, null, windowOptions);
}
}
},
function () {
debugger;
alert("Error executing workflow");
});
}
function onAlertCloseButtonClick(args) {
Alert.hide();
}
Thanks!
Can you please post a code that should open record form? This is what you should use - msdn.microsoft.com/.../jj602956.aspx
Hello Andrew,
Thanks for the suggestion.
I am trying to clone the case record using javascript on the click of button and open the created record form but I am not able to open the form. Could you please suggest any solution to that.
Thanks!
Hello,
You can write code to do that ;)
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,235 Most Valuable Professional
nmaenpaa 101,156