6

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

3
  • 2
    Have you tried this or this?
    – Mr.Frodo
    Commented Apr 29, 2016 at 4:58
  • salesforce.stackexchange.com/questions/23656/…
    – highfive
    Commented Apr 29, 2016 at 5:05
  • 2
    what do you consider a warning message ? when does it need to be displayed ? If you wouldn't have already accepted an answer this would probably get closed as too unclear. Please avoid that for your next questions. Commented Apr 29, 2016 at 7:51

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. Commented 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 Commented Apr 29, 2016 at 5:38
  • Do you get the response on this ? If yes, could you please share the code ? Commented 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 .