Question

In salesforce we have two objects. The first is a Component pricing object (Comp_Pricing__c). This has records with component part numbers and pricing in their respective fields, Part_Number & Pkg_Price__c. We also have an object in which we put together proposals with quotes. In this object we use an apex class and trigger to run our calculations to determine quantities of parts needed. We would like to have the apex class, based on a variable (apPart), search through the records, find the corresponding part number and then pull back the price for use in further apex calculations. I believe I will need to run a query on the records but have no idea how to do this. Can I get some help?

Était-ce utile?

La solution

list cpFTList = [SELECT Pkg_Price__c FROM Component_Pricing__c WHERE Component_Pricing__c.Part_Number__c = :PRT_Pr_Ft]; Pr_Ft = cpFTList[0].Pkg_Price__c;

This is the final query that works.

Thanks Chiz for the help.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top