I have a homepage component that removes some links from the Opportunity Line Item related list items on the Opportunity detail page. I'm using the JQuery .ready() function, however this is invoked before the OLI list has loaded, i.e. it's still "Loading...".

Is there a page event to indicate the loading/rendering of all page components is complete?



JQuery.ready is executed as soon as the DOM is fully constructed, but before all assets have been loaded, so things like external JavaScript and CSS won't be present. It sounds like you have enabled the "Enable Separate Loading of Related Lists" option on the user interface, which will load the lists via JavaScript after the main page detail has been changed.

While there may be an event from Salesforce (I don't know if there is or not), relying on it would be fragile as it may change without notice. Unfortunately, any other mechanism is likely to be as fragile as you'll need to look for the presence of particular HTML elements on the page, such as the 'New Opportunity' button, although these don't tend to change that often.

|improve this answer|||||
  • Thanks Bob, I've disabled the "Enable Separate Loading of Related Lists" feature and this resolved my issue as expected. As you suggest, relying on any other events is likely to be a fragile approach. – dpk Jun 19 '14 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.