So we have a lightning button which calls a LWC component. This LWC component opens up in a popup window with Save and Cancel button.
Now on the click of Cancel button the below LWC js code is called:
eval("$A.get('e.force:refreshView').fire();");
this.dispatchEvent(new CloseActionScreenEvent());
When I click on Cancel button, instead of closing the popup window I get the below error, saying:
[$A is not defined]
But the strange part is, the above syntax works fine in my dev sandbox but DOES NOT work in my one level up test sandbox. Any suggestions here?