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
Prakhyat sapraPrakhyat sapra 

The user creates the "Revenue" record and enters the Start Date, End Date, Price and Quantity. If the total run time (End Date - Start Date) spans across more than one calendar month, then Child Monthly Revenue will automatically be created.

The user creates the "Revenue" record and enters the Start Date, End Date, Price and Quantity.

If the total run time (End Date - Start Date) spans across more than one calendar month,
then Child Monthly Revenue will automatically be created.
Each Child will be broken out by calendar month and the Quantity will be divided
evenly by the number of days in each month.
Upon Save - the Total Amount gets calculated: (Quality*Price) Also, the system will
automatically create child Monthly Revenue records based on the following:

1. NO. of children would: no. of the month from Start Date to End Date.
2. The amount would be calculated as: (Total No. of Days in Current Month * Total Amount on
parent Revenue)/Total no of days from Start Date to End date on Revenue.
3. Start Date on Monthly Revenue: Start Date of the Current Month
4. End Date on Monthly Revenue: Last Date of the current Month ex. 31 for Jan, 28/29 For Feb
5. Revenue: Lookup of Revenue record
EXAMPLE:
The user enters the following data onto the Revenue record:
Start Date: 01/Oct/2018
End Date: 31/Dec/2018
Quantity: 100000
Price = 20
Monthly records would be created as:
# Total no. of Monthly records 3 (Oct, Nov, Dec), and total no of days: 92
1.
Oct 2018 (31 days)
Quantity = (31*100000)/92
Price = 20
Amount = Quantity*Price
Start Date = 01/Oct/2018
End Date = 31/Oct/2018

2.
Nov 2018 (30 days)
Quantity = (30*100000)/92
Price = 20
Amount = Quantity*Price
Start Date = 01/Nov/2018
End Date = 30/Nov/2018

3.
Dec 2018 (31 days)
Quantity = (31*100000)/92
Price = 20
Amount = Quantity*Price
Start Date = 01/Dec/2018
End Date = 31/Dec/2018
PriyaPriya (Salesforce Developers) 

Hey Prakhyat,

Can you help me with the objects name and relations between them.

Thanks,

Priya Ranjan

Prakhyat sapraPrakhyat sapra
Here the Object name is Revenue this is custom object