+ Start a Discussion
smitha vikramsmitha vikram 

update a field based on another with click of button that pops up

So the request I have is to create a custom button on opportunity that pops a window allowing the user to add a comment
: That comment must be appended with today date and should be added to comment section
 Next time another comment is added the previous comment should be added to a description filedSo on so forth
 Where comment and description will be read only fields on the page
 Comment is Rich text field
i have my apex class
public with sharing class AddCommentbuttonOpportunity { 
public Opportunity getComments{get;set;} 
public AddCommentbuttonOpportunity(Apexpages.StandardController controller){ List<String> fields= new List<String> {'Comments_Next_Steps__c'}; controller.addFields(fields); this.getComments=(Opportunity)controller.getRecord(); if(getComments.Comments_Next_Steps__c!=null) { getComments.Comments_Next_Steps__c = System.today() + ' ' + getComments.Comments_Next_Steps__c; string temp= getComments.Description; if(temp==null && String.isBlank(temp)){ getComments.Description= getComments.Comments_Next_Steps__c; }else If(temp!=null && String.isNotBlank(temp)){ getComments.Description= getComments.Comments_Next_Steps__c +'/n' +temp; } } } public PageReference save() { insert getComments; return new PageReference('/'+getComments.id); } } This is my VF page <apex:page sidebar="false" standardController="Opportunity" extensions="AddCommentbuttonOpportunity"> <apex:form > <apex:pageBlock title="Add a New Comment"> <apex:pageBlockSection > <apex:inputfield value="{! Opportunity.Comments_Next_Steps__c}" /> <br/> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page> but when i enter value and click save i am getting error ' what am i missing

tulasi tayertulasi tayer
This creates a one-click process... ... Display Button in a Modal Popup ... to have a single button that updates a field to a custom value when clicked. ... field for the project's name, but you can feel free to include any other fields ... Xbox Steering Wheels reviews (https://10peeps.com/best-xbox-steering-wheel/)
jann castjann cast
Thanks for sharing the useful post and you explained in a detailed way. Nice to see this here. Want to know more about the private routers? Here you can check this for getting the latest updates. https://192-168-1-254.site
smitha vikramsmitha vikram

which code are you taking about?
Forix ForenForix Foren
Enter our guide for taking up the Tell the Bell - Taco Bell Customer Satisfaction Survey. And stand a chance to win $500.
For updates about the tellthebell, please visit: www.tellthebell.com (https://discosw.net/tellthebell-survey/)