Actually there is another possiblity.
We had a standard page that showed a customer's email address and wanted the agents to click a button that simply "verifies" it. The email address would appear in different annoying colors like highlighted yellow if it had been a long time since the email was verified.
We implemented this by making a little-tiny visual force page with a custom extension.
The standard controller was the object on the page (Account, in our case), of course.
I put a form with a single field and custom button. Clicking the button called the controller which of course updated the last-verified date in the Account object.
Then, we simply went into the page layout and added that VF page right onto the form in a little tiny single field size slice of a standard section. (It looks like a regular field on the form, albeit with a button next to it)
Now we have the most effectively annoying yellow field that forces the agent to click the button if they want to get rid of the nasty yellow. It's quite difficult to be on the page and not click the button, you know, just to get rid of the yellow.
But, hey, now our email addresses get validated every 3 months.
I'm happy to share the code if you like.
Here's the VF Page:
<apex:page standardController="Account" extensions="CustomerConfirmedEmailExtension">
<apex:form >
<font style="background: {!highlight}">
<apex:outputText rendered="{! NOT(ISBLANK(Account.Other_Email_Confirm_Date__c))}" value="{0,date,MM'/'dd'/'yyyy}">
<apex:param value="{!Account.Other_Email_Confirm_Date__c}" />
</apex:outputText>
<apex:outputText rendered="{! ISBLANK(Account.Other_Email_Confirm_Date__c)}" value="Never"/>
</font>
<apex:commandButton action="{!reconfirmEmail}" value="Validate" title="Click this after verifying the customer email address" />
</apex:form>
</apex:page>
Here's the Controller:
public class CustomerConfirmedEmailExtension {
private final Account acct;
public String highlight {
get {
if (acct.Other_Email_Confirm_Date__c != null && acct.Other_Email_Confirm_Date__c > System.today().addMonths(-6)) {
return 'none';
} else {
return 'yellow';
}
}
set {}
}
public CustomerConfirmedEmailExtension() {
}
public CustomerConfirmedEmailExtension(ApexPages.StandardController stdController) {
this.acct = (Account)stdController.getRecord();
}
public PageReference reconfirmEmail () {
this.acct.Other_Email_Confirm_Date__c = System.today();
update acct;
CustomerInteractionExtension.logInteraction (acct.id, 'Confirm Email', 'SFDC', null );
return null;
}
}