質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top