Master Detail Preview auto expand

HI allI used to use the following generic code in prior versions to automatically expand the master detail views when needed.

//wait untill document has loaded
$(document).ready(function() {
//wait a few milli seconds just in case
setTimeout(function(){
//click all those buttons
$('[class="ew-preview-btn ew-icon icon-expand"]').click()
},300);//adjust time
});

I have been looking and trying to figure out what needs to change when it come to converting to 2022 but have had no luck. (or my head is not working)Can anyone help with this?

You may use Startup Script for the List page of the master table, there is no need for $(document).ready() and setTimeout(), e.g. (v2022)

$(".ew-preview-btn").click();

HI there.Thank you. All working

Good Evening AllThe latest update might of broken this. It does not expand.

There is no change and it works fine as before. Make sure your preview type is “row”. Press F12 in your browser and go to the Console to check for JavaScript errors.

Hello all.The function above has been working perfectly however it now only works occasionally.Same code. Same system.

My thoughts are that the information and server responses are delayed due to the amount of data. Should i be looking at using a delay for this now?

CraigNel wrote:

Should i be looking at using a delay for this now?

Yes, you should.