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
Shweta Choudhary 17Shweta Choudhary 17 

How to Create an inline Vf page that shows the message(Close date is near) on opportunity when a particular opportunity's close date is 5 days ahead.

Suraj Tripathi 47Suraj Tripathi 47
Hi Shweta Choudhary 17,
Greetings!!
 
<apex:page standardController=”opportunity” extensions=”oppdate”>
<apex:sectionHeader title=”opportunity close date “/>

<apex:outputpanel rendered=”{!flag}” >you have closed it near by </apex:outputpanel>

</apex:page>

public class oppdate {

public string abc{get;set;}

public boolean flag{get;set;}

public oppdate(ApexPages.StandardController controller) {

//customcont=(Contact)controller.getRecord();

String abc = controller.getId();

opportunity oppobject =[SELECT id,CloseDate FROM opportunity where id = :abc];

if(oppobject.CloseDate >= Date.Today() && oppobject.CloseDate<= Date.Today().addDays(4))

flag=true;

else

flag=false;

}

}

This might Help you
If you find this helpful mark it as the best answer.
Thanks And Regards,
Suraj Tripathi.
Haylie TurcotteHaylie Turcotte
 Expand my knowledge and abilities. Actually the article is very real.
onevanilla (https://www.onevanilla.run/)