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
Shri BEShri BE 

Compare Fields in 2 different Object

Hi Friends,

My requirement is to compare 2 fields (one is Opportunity and other is Custom Object). Opportunity Field is Textfree and Custom Object field is Decimal. Objects doesnt have any master-detail or lookup relationship. Check the value in the field and compare the same value in custom object. If value is available then Insert the Opportunity Line Items where Opportunity Id should be the auto populated.
I am planning to go with Trigger on Custom Object. Kindly suggest how to start. 

Thanks.
Best Answer chosen by Shri BE
Khan AnasKhan Anas (Salesforce Developers) 
Hi Shri,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.

https://developer.salesforce.com/forums/?id=906F0000000BSarIAG

https://success.salesforce.com/answers?id=9063A000000lDKXQA2

https://salesforce.stackexchange.com/questions/81764/trigger-between-2-independent-objects-but-fields-are-same

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Shri,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.

https://developer.salesforce.com/forums/?id=906F0000000BSarIAG

https://success.salesforce.com/answers?id=9063A000000lDKXQA2

https://salesforce.stackexchange.com/questions/81764/trigger-between-2-independent-objects-but-fields-are-same

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Shri BEShri BE
Hi Khan Anas,

Thanks for your links. This helped a lot in building a Apex.