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
AALAAL 

Need Apex Trigger Code - Fixed Price Contract

We need a developer to write the code for an Apex Trigger.

Here is the background. In our SalesForce database, we track lawsuits (opportunities) and the law firms (accounts) and attorneys (contacts) handling those cases.

Our goal with the trigger is to identify Fortune 1000 companies which are parties to the lawsuits. Those names will appear in the Opportunity Name field and/or a custom opportunity field we created called Represented Party. We have concatenated the Opportunity Name and Represented Party fields into a new custom field called NRCU. In NRCU, all of the text is normalized to all caps.

We have also created a custom tab called Parties with 1000 custom objects - each is the name of one Fortune 1000 company. We have also created a custom lookup field (Parties Lookup) in the opportunity tab which associates the opportunity with the custom object. SO, we are trying to build a trigger which looks at NRCU, compares it to each of the 1000 custom objects and if the trigger finds the custom object name anywhere in the opportunity name, then it returns the custom object name in the Parties Lookup field.

In our circumstance, the party name custom object (ie. "SHELL OIL") would almost certainly be a subset of the text in NRCU (ie. "SHELL OIL V. ABC or PLAINTIFF SHELL OIL").

This is a fixed price contract paying $350.
AALAAL
UPDATE:

We spoke to a developer yesterday who does not think a trigger will work due to the volume of data it would have to process at one time. Instead, he was recommending using the chron kit to perform like asynchronous apex code and that this same functionality will be native to apex in the next Salesforce release. We are open to any suggestions along these lines as long as they work.
SteveBowerSteveBower
I'm curious what limits you think you'd be bumping into?  The 1000 records per query limit is the obvious one, but if you have 1000 records in your Fortune 1000 object, then that should just fit.   [There are different limits for testing, but that's no big deal.]  Perhaps I'm missing something, but I think the simple approach would work?

1. prune activity if trigger.new's size is one record.  If your field is empty, return.  If it's an update and the field didn't change, return.
2. Since it's needed, query the Name, ID for the 1000 Fortune records into local storage.
3. For each object in trigger.new that changed, do a search through the 1000 names for a hit.
4. if found, load trigger.new.
5. done.

-Steve
omerutahomerutah

Hello,

we may be able to offer you a good solution. We've done plenty of coding and our team specializes in APEX coding.

Please write me at omer@blat-lapidot.co.il  or contact through this link

Best regards,
Omer C.
Blat-lapidot consulting.