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
Ap30Ap30 

page flickers on load

Hi All,
I have to display warning message in my standard page layout of a custom object. I'm using window onload function. Warning message is displayed but with flickers. Please guide me how to avoid this.

==============================================
<apex:page standardController="Detail__c" extensions="WarningPage">
<script>
window.onload = function()
{
    if({!Detail__c.Status__c  = 'Details needed'})
    {
        dispWarn();
    }
 }

</script>
<apex:form >
    <apex:pageBlock >
    <apex:actionFunction action="{!displayWarning}" name="dispWarn"/>
        <apex:pageMessages ></apex:pageMessages>
</apex:pageBlock>
</apex:form>
</apex:page>
Best Answer chosen by Ap30
Vishwajeet kumarVishwajeet kumar
Hello,
Is their any sepecific reason to use javascript here? Apex method can be called on "Action" attribute of page, which gets called on page load, try and see if it helps (, Use condition: Detail__c.Status__c  == 'Details needed' inside apex method - displayWarning() for different calculations/msgs).

<apex:page standardController="Detail__c" extensions="WarningPage" action="{!displayWarning}">


Thanks

All Answers

Vishwajeet kumarVishwajeet kumar
Hello,
Is their any sepecific reason to use javascript here? Apex method can be called on "Action" attribute of page, which gets called on page load, try and see if it helps (, Use condition: Detail__c.Status__c  == 'Details needed' inside apex method - displayWarning() for different calculations/msgs).

<apex:page standardController="Detail__c" extensions="WarningPage" action="{!displayWarning}">


Thanks
This was selected as the best answer
Suraj Tripathi 47Suraj Tripathi 47
Hi Ap30,

Greetings!
This problem is occurring due to the Chrome browser, not directly with Salesforce.
Please assure, you are using the latest version of the Chrome browser.
If a problem still occurs, please try to switch to the new browser(like Firefox).

Thank you!

Regards,
Suraj Tripathi
Ap30Ap30
Hi Vishwjeet, I changed my code as you said. Now I'm not getting a warning message in the object standard page layout.
Vishwajeet kumarVishwajeet kumar
Hello,
It should display the message if you are adding msg in the method - "displayWarning" to the page.

Thanks