How is it possible to pass the already entered and saved values from a form to a dialog?
Entity: Mail
Field: Account
Value: Test Company
If the user opens the dialog. The Dialog box "Account" should already filled out with "Test company" from the form.
This is the JS opens the dialog with a button:
var popup;
var detailsWindowTimer;
// Parameters: DialogGUID, PrimaryEntityTypeName, PrimaryItemIds, Bool
function LaunchModalDialog(dialogID, typeName, recordId, refresh) {
var url = window.location.protocol + "//" + window.location.host;
if (window.location.href.indexOf(Xrm.Page.context.getOrgUniqueName()) > 0) {
url = url + "/" + Xrm.Page.context.getOrgUniqueName();
}
url = url + '/cs/dialog/rundialog.aspx';
popup = window.open(url + '?DialogId=' + dialogID + '&EntityName=' + typeName + '&ObjectId=' + recordId, "Dialog", "status=0,toolbar=0,scrollbars=0, resizable=1");
if (refresh != null && refresh == true) {
detailsWindowTimer = setInterval("WatchDetailsWindowForClose()", 600); //Poll
}
}
function WatchDetailsWindowForClose() {
if (!popup || popup.closed) {
clearInterval(detailsWindowTimer); //stop the timer
if(Xrm.Page.data.entity.getIsDirty() == true) {
Xrm.Page.data.entity.save();
} else {
window.location.reload(true);
}
}
}
Is it possible to pass this as argument? I also tried to realise it with the dialog arguments/parameters but wasn't able to do that...
Note: The field in the dialog is a lookup field and needs to be that.
*This post is locked for comments