6

I am using custom Object, I need a warning message on Detail Page, Is there anyway?

3

2 Answers 2

6

From trigger, you can not show the warning message. If you want to show the warning on the detail page of the record , just create a VF page and add it on the top of the detail page layout as inline page. Whenever your condition meets, that page will display the warning message See this image, i am showing message on the top of the screen

1
  • Could you please show some code? It will be very helpful. Aug 10, 2017 at 17:10
-1

You can do this by using the adderror function and trigger fired on after update for Example:-

trigger warning on Testwarning__c (before insert,after update) {

    for(Testwarning__c tw : trigger.new)
    {
        if(tw.yourfield__c==null)
        {
          tw.addError('please insert the field');
        }
    }
}

enter image description here

(you can also do this by validation rule for field specific error)

2
  • 3
    Hi Ajay, Thanks for reply.... I am talking about warning message not error message, Error message stop the flow of Trigger execution Apr 29, 2016 at 5:38
  • Do you get the response on this ? If yes, could you please share the code ? Aug 10, 2017 at 17:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .