@EmadBeshai I have solved the issue.
1. Use Ribbon Workbench to add a new Button (JS function) to Subgrid
2. The new func navigates (Xrm.Navigation.navigateTo) to Main Form of Subgrid record. I can use createFromEntity to catch an attribute i need.
3. It calls success after Subgrid Main form is closed.
formContext = Xrm.Page;
let createFromEntity = {
entityType: "pbl_doc_purchase",
id: formContext.data.entity.getId().replace(/[{}]/g, ""),
name: "pbl_owner"
};
let pageInput = {
pageType: "entityrecord",
entityName: "pbl_doc_purchase_vt_goods",
createFromEntity: createFromEntity
};
let navigationOptions = {
target: 2,
height: { value: 80, unit: "%" },
width: { value: 30, unit: "%" },
position: 2
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success(result) {
//Here you can call the func you need
//alert("Record created with ID: " + result.savedEntityReference[0].id + " Name: "
+ result.savedEntityReference[0].name);
},
function error() {
}
);
In that case it navigates to Main Form - not Quick create, but I got the similar form behavior.
I'll try to figure out how to navigate to a quick form.