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
Gar SpencerGar Spencer 

Help still not working

Can someone show me how to build a trigger that

When an account record is saved and the field "Active_Buyers__c = True"  lets Call it Record A

that it loops through all accounts in system searching for account records where the field "Active_Seller__c = True" Lets call thes Record B
Then it runs a query of the records found and looks at the field "Max_Prince_Range__c" from record A  >= to the "Listed_Price__c"  field from Record B.

It then sends an email notification to the LastModifiedBy users email notifying them of the potentiam match and gives the user the name of the account, Account owner name and emaill address.
Suneel#8Suneel#8
How would it handle if there are many records like B with Active_Seller__c=true and  "Max_Prince_Range__c" from record A  >= to the "Listed_Price__c"  field from Record B? Should it identify all such records and include them in the mail?