web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Quick Сreate Form does...
Power Apps
Answered

Quick Сreate Form doesn't refresh parent main form, how to catch the event?

(0) ShareShare
ReportReport
Posted on by 264

Hi, guys!

There is "Parent Main Form" and Subgrid in it.

I click on "New" in Subgrid's command bar. "Quick Create Form" is open.

I make some changes and press "Save&Close".

Subgrid has been refreshed and I can see a new record, but I need to catch the event after that "update".

The event inside Parent main form. OnLoad isn't called.

I there a way to catch it?

 

I have the same question (0)
  • EmadBeshai Profile Picture
    806 Moderator on at

    No OOB JS function to do that but you can register SetTimeout function to refresh the parent form on save event of the quick create from (formContext.data.entity.addOnSave(function(){refreshParentForm()});

     refreshParentForm(){
    setTimeout(function () { Xrm.Navigation.openForm(entityFormOptions, formParameters).then(successCallback, errorCallback); }, 1000);}

     

  • Max77 Profile Picture
    264 on at

    @EmadBeshai  I tested. It works, but the parent form opens by defaults -> the first tab is active.

    OK, I believe it is possible to fix the active tab, but standard button "Go back" navigates to the same parent form. So I have to press the button twice to go back to the list.

     

    @EmadBeshai thanks for trying to help me.

     

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @Max77 ,

    Nice to hear that helped you, but I preferer to create a specific main form and pass the form id instead of showing all tabs that you may not need.

     const FORMID = "A696976B-EA8A-42F3-B4DC-F35DC9204D58"; 
    
     var formContext = primaryControl;
     var parameters = { formid: FORMID };
     var entityFormOptions = {};
     entityFormOptions["entityName"] = "new_entity_name";
    
     var recordId = formContext.data.entity.getId(); 
     var recordName = formContext.getAttribute("new_name").getValue(); 
    
     if (recordId != null) { parameters["new_targetentityfieldid"] = recordId; }
     if (recordName != null) { parameters["new_targetentityfieldname"] = recordName; }
    
     Xrm.Navigation.openForm(entityFormOptions, parameters);

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    Max77 Profile Picture
    264 on at

    @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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard