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 

Still Need Help with this Apex Trigger

My client is not using record type..... Account can be eith a buyer or seller. or both.
there are two sections on the account page. Buyers need is first section it contains 

Active_Buyer__c   datatype is checkbox (needs to be true)
Price_Range__c datatype is a pick list (containing min-max ranges) (ie; 100-200, 201-300, etc)

so when the Active_buyer__c is checked then the record saved it needs to look at all accounts in the system
and look for

Active_Seller__c = true  datatype is a checkbox and
Price_range__c (picklist)
       >=
to List_Price__c (which is a number field.)

and if there is a match an email notice needs to be sent to the LastModifiedBy user's email where the Active_seller__c = true.

also need a test coverage script for this
KevinPKevinP
Gar,

If you're hoping someone here will write the trigger, and the test class for you... well, I'd like you to reconsider that idea.

If you're not comfortable writing apex yourself, asking for someone here to write it for you means that you're likely unable to determine of that trigger *only* does what you want it to do. A malicious "beneveolent" coder here, or more likely, a developer who accidently included a bug, could do great harm to your org. 

If you have specific questions about writing triggers, or if you would like to ask architectural questions "is it better to do X or Y?", feel free to respond, and I'll help you however i can. However, I won't write your trigger for you, and I highly suggest you don't copy/paste code from any message board without fully understanding the code in question.