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
suneel.patchipulusu@gmail.comsuneel.patchipulusu@gmail.com 

What are the Attributes and Methods??

Hello all


Could any one tell us what are the attributes and what are the Operations or methods in the belo mention code, I am trying to draw an Class UML diagram???


public with sharing class SharedConstants { private static final String STD_OPP_RECORDTYPE = 'Standard_Opportunity'; //use Singleton to query the RecordType only if really needed public static ID STD_OPP_RECORDTYPE_ID { get { if(STD_OPP_RECORDTYPE_ID == null) { STD_OPP_RECORDTYPE_ID = [SELECT Id FROM RecordType WHERE DeveloperName = :STD_OPP_RECORDTYPE AND SobjectType = 'Opportunity' LIMIT 1].Id; } return STD_OPP_RECORDTYPE_ID; } } }

 Thanks in advance

 

Best Answer chosen by Admin (Salesforce Developers) 
Eugene NeimanEugene Neiman

STD_OPP_RECORDTYPE
STD_OPP_RECORDTYPE_ID  are attributes.  The latter has a getter method.

All Answers

suneel.patchipulusu@gmail.comsuneel.patchipulusu@gmail.com
public with sharing class SharedConstants {
	
	private static final String STD_OPP_RECORDTYPE = 'Standard_Opportunity';

	//use Singleton to query the RecordType only if really needed 	
	public static ID STD_OPP_RECORDTYPE_ID {
		get {
			if(STD_OPP_RECORDTYPE_ID == null) {
				STD_OPP_RECORDTYPE_ID = [SELECT Id FROM RecordType 
	                   WHERE DeveloperName =:STD_OPP_RECORDTYPE 
			     AND SobjectType = 'Opportunity' LIMIT 1].Id;
			}
			return STD_OPP_RECORDTYPE_ID;
		}
	}

 

Eugene NeimanEugene Neiman

STD_OPP_RECORDTYPE
STD_OPP_RECORDTYPE_ID  are attributes.  The latter has a getter method.

This was selected as the best answer
suneel.patchipulusu@gmail.comsuneel.patchipulusu@gmail.com

Thanks