Skip to content

Commit

Permalink
PP-104 Application record url has been added to 'Record Url' action
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Menal committed May 18, 2020
1 parent 00983d8 commit b0fa8e0
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/js/ui/pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,31 @@ $(function () {

$("#record-url").click(function () {
try {
var params = [Xrm.Page.context.getClientUrl() + "/main.aspx"];
params.push("?etn=" + Xrm.Page.data.entity.getEntityName());
params.push("&id=" + Xrm.Page.data.entity.getId());
params.push("&pagetype=entityrecord");

CrmPowerPane.UI.BuildOutputPopup(
"Record url",
"Url of current record.",
[{
label: "Record Url",
value: params.join("")
}]);
var header = "Record url";
var description = "Url of current record.";

var url = [Xrm.Page.context.getClientUrl() + "/main.aspx?"];
url.push("etn=" + Xrm.Page.data.entity.getEntityName());
url.push("&id=" + Xrm.Page.data.entity.getId());
url.push("&pagetype=entityrecord");

var result = [{
label: "Record Url",
value: url.join("")
}];

if (Xrm.Utility && Xrm.Utility.getGlobalContext && Xrm.Utility.getGlobalContext().getCurrentAppProperties) {
Xrm.Utility.getGlobalContext().getCurrentAppProperties().then(function (appDetails) {
url.splice(1, 0, "appid=" + appDetails.appId + "&");
result.push({
label: "Record Url for Current Application",
value: url.join("")
});
CrmPowerPane.UI.BuildOutputPopup(header, description, result);
});
} else {
CrmPowerPane.UI.BuildOutputPopup(header, description, result);
}
} catch (e) {
CrmPowerPane.Errors.WrongPageWarning();
}
Expand Down

0 comments on commit b0fa8e0

Please sign in to comment.