Algorithm for setting months on certain criteria

(Doc ID 2333537.1)

Last updated on NOVEMBER 29, 2017

Applies to:

Oracle Fusion Sales - Version 11.12.1.0.0 and later
Information in this document applies to any platform.

Goal

We have a requirement that, we need to filter the same year values from the building unit object(custom object) and set the months into Deal object (opty).

Example: we have Yr1 to yr 5 values in building unit (custom object).

But we are unable to filter the same values and get the months based on this scenario.

Year1 -40,Year2-40,Year3-20,Year4-10,Year5-20

We are able to fetch the Building unit values into deal object and we have attached the screenshot for the reference (Deal Object screen shot)
 
====================================
Before Update into database:
def min_rent_step1= Unit_Obj_c?.BudgetRentYR1psf_c
def min_rent_step2 = Unit_Obj_c?.BudgetRentYr2psf_c
def min_rent_step3 = Unit_Obj_c?.BudgetRentYr3psf_c
def min_rent_step4 = Unit_Obj_c?.BudgetRentYr4psf_c
def min_rent_step5 = Unit_Obj_c?.BudgetRentYr5psf_c
setAttribute('MinimumRentYr1psf_c',min_rent_step1);
setAttribute('MinimumRentYr2psf_c',min_rent_step2);
setAttribute('MinimumRentYr3psf_c',min_rent_step3);
setAttribute('MinimumRentYr4psf_c',min_rent_step4);
setAttribute('MinimumRentYr5psf_c',min_rent_step5);
========================================
In the above scenario yr 1 value, Yr2 value and Yr3, Yr5 values is matching.
Note: Based on these values we need to consider 1 year as 12 months,if two years is matching 24 months,if 3 yrs is matching 36 months and 4 yrs is matching 48 months and 5 yrs matches 60mnths.
As per the above scenario Yr1 value, Yr2 values is matching so we need to set 24 months into months (step 1) in deal object and Yr3, yr5 is matching so we need to set 24 months and Yr4 value is 10 so we need to set 12 months.

How to achieve this?
 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms