function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Juan GraciaJuan Gracia 

Event after Standard Modal Component is closed in a lwc

I'm opening a standard modal component in my lwc in this way:
 
newContract(event) {
        let temp = {
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Contract',
                actionName: 'new'
            },
            state: {
                nooverride: '1',
                useRecordTypeCheck: '1',
                defaultFieldValues: "AccountId=" + this.currentPageReference.state.c__id,
                navigationLocation: 'RELATED_LIST'
            }
        };
        this[NavigationMixin.Navigate](temp);

    }

Once the user closes the modal component I want to capture the event to refresh a section of my component. Some help?
{tushar-sharma}{tushar-sharma}
This is not a Modal, you are opening standard new page. We can't catch this once user click on close/cancel.
You need to implment your own modal to catch it. You can take help from here: https://newstechnologystuff.com/2020/04/28/lightning-record-edit-form-prepopulate-fields/

If this answer helps you, please mark it as accepted.

Regards,
Tushar Sharma
https://newstechnologystuff.com/
Juan GraciaJuan Gracia
Thanks Tushar.

Yes is and standard page, but It is showed like modal. I don't want to create a new page because the process of contracts is outside of my requirements and is managed by Business/Admin Users. Then I can't create a special page or lwc to manage the contract. This snippet works perfectly with the exception that I can't know when the frame / window is closed.

Any workaround without creating a new lwc o component?