Hey All,
I have a custom page which I am navigating to from a custom ribbon button on a subgrid for Entity B that is on a form for Entity A. I'm using the custom page as a sort of quick create form for a record in Entity B that is a child of Entity A. I am passing the GUID for the parent record from Entity A with the Javascript on the subgrid button:
this.navigate = function (primaryControl) {
formContext = primaryControl;
let entityA_Id = formContext.data.entity.getId().replace('{', '').replace('}', '');
console.log('entityA_Id: ' + entityA_Id); // Correctly logs GUID of Entity A parent record
let pageInput = {
pageType: "custom",
name: "my_customPage_gr34d",
entityName: formContext.data.entity.getEntityName(),
recordId: entityA_Id // Passing the GUID of Entity A parent record
};
let navigationOptions = {
target: 2,
position: 1,
height: 600,
width: 800,
title: "Add Shift Breakdown"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
console.log("Success");
},
function error() {
console.log("error");
}
);
}
In my Custom Page on the OnStart property I have the following code:
Set(_thisRecord,
If(IsBlank(Param("recordId")),
Blank(),
LookUp(
Placements,
'Placements (cr05d_placementsid)' = GUID(Param("recordId"))
)
)
);
I have tried testing by adding a label on the custom page with value of _thisRecord.{recordId} but it won't populate.
Am I passing or trying to read the GUID incorrectly?
Please let me know if I can clarify anything else