+ Start a Discussion
rotfilrotfil 

How to change / hardcode a note heading when creating a new note in opportunity

When a new note is created in Opportunity I simply have to change / hardcode the value to 'Sales Opportunity'.

Do I need to build a trigger for this? If so how would I build a trigger to target the creation of this new note? Or is there an easier way to achieve this.

Thanks

Best Answer chosen by rotfil
Dhanya NDhanya N
Hi Rotfil,

There is no option available for object Note in workflow and process builder. So I think trigger is only the option.

Please check below code : 
trigger noteTrigger on Note (before insert) {
	for (Note n : trigger.new){     
       n.title= 'Sales Opportunity';       
    }
}

Thanks,
Dhanya

 

All Answers

Dhanya NDhanya N
Hi Rotfil,

There is no option available for object Note in workflow and process builder. So I think trigger is only the option.

Please check below code : 
trigger noteTrigger on Note (before insert) {
	for (Note n : trigger.new){     
       n.title= 'Sales Opportunity';       
    }
}

Thanks,
Dhanya

 
This was selected as the best answer
rotfilrotfil
Wow thanks - that was really quick and to the point!