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
ShailendraTiwariShailendraTiwari 

How to find composite fields in Account ?

I have Account object . I  am get value of  Trigger.new & Trigger.Old but I want to match of both values then I get error of composite fields can't be match and I want to iterate of composite fields , So please solve
Best Answer chosen by ShailendraTiwari
Deepak Kumar ShyoranDeepak Kumar Shyoran
As composite fields are not Groupable and not Sortable so you can find those fields by using following instance method of DescribeFieldResult

isSortable()
isGroupable()

Hope this will solve your problem.

Please mark my answer as a solution to your question if it solves your problem.

All Answers

pconpcon
Are you trying to find the old version of the account and compare variables?  If so you can do this with Trigger.oldMap

if (Trigger.isUpdate) {
     for (Account account: Trigger.new) {
          Account oldAccount = Trigger.oldMap.get(account.Id);

          if (oldAccount == null) {
               continue;
          }

          if (oldAccount.MyField__c != account.MyField__c) {
               // do something
          }
     }
}

If this is not what you are asking about, can you please expand on what your question is.
Deepak Kumar ShyoranDeepak Kumar Shyoran
As composite fields are not Groupable and not Sortable so you can find those fields by using following instance method of DescribeFieldResult

isSortable()
isGroupable()

Hope this will solve your problem.

Please mark my answer as a solution to your question if it solves your problem.
This was selected as the best answer
ShailendraTiwariShailendraTiwari
 Thanx  Deepak