開発者は、カスタム オブジェクト Project_ct、

開発者は、特定のプロジェクトの拒否されたタイムシートと承認されたタイムシートの比率を示す新しいフィールドを作成するよう求められます。
開発者は、メンテナンスのオーバーヘッドを最小限に抑えるために、ビジネス要件を実装するためにどれを使用する必要がありますか?
正解:B
In this scenario, a formula field is the most appropriate choice to calculate the ratio between rejected and approved timesheets for a given project. This is because formula fields automatically calculate their values based on other fields' values, requiring no additional maintenance or manual intervention. They are used for read-only purposes and are visible to users if they have read access to the object containing the formula field.
To create the formula field, the developer can use the following expression:
IF(Total_Approved_Timesheets__c > 0, Total_Rejected_Timesheet__c / Total_Approved_Timesheets__c, 0) This expression checks if the total approved timesheets is greater than zero, and if so, divides the total rejected timesheets by the total approved timesheets. Otherwise, it returns zero. This formula field will display the ratio as a decimal number, which can be formatted as a percentage if desired.
References: The use of formula fields for automatic calculations can be referenced in the Salesforce Platform Developer I learning documents, specifically in modules that cover objects and fields management, such as:
* Create Object Relationships
* Data Modeling
* Formula Operators and Functions by Context