You need to sign in to do that
Don't have an account?

How do i code this?
Stuch on how to code this:
Starting with this…
string created = opportunityList.Quarter_Created_op__c;
decimal year = opportunityList.Start_Year__c;
decimal quarter = opportunityList.Start_Quarter__c;
decimal span = opportunityList.Quarters_Spanned_op__c;
decimal counter1 = 0;
while (counter1 < span )
{
......................................................................
How do I code this?
If quarter is =< 4
Output = year + quarter (for use in next step) should look something like this (2019-Q1 or 2019-Q2 or 2019-Q3 or 2019-Q4)
If quarter is >4 reset quarter to 1
Increment year +1
Output = year + quarter (for use in next step) should look something like this (2020-Q1)
Each time this completes, increment quarter++ until (counter > span)
I will use the output from the above loop in creating a new record.
Any help out there for a newbiw coder?
Thanks much,
Sc
Starting with this…
string created = opportunityList.Quarter_Created_op__c;
decimal year = opportunityList.Start_Year__c;
decimal quarter = opportunityList.Start_Quarter__c;
decimal span = opportunityList.Quarters_Spanned_op__c;
decimal counter1 = 0;
while (counter1 < span )
{
......................................................................
How do I code this?
If quarter is =< 4
Output = year + quarter (for use in next step) should look something like this (2019-Q1 or 2019-Q2 or 2019-Q3 or 2019-Q4)
If quarter is >4 reset quarter to 1
Increment year +1
Output = year + quarter (for use in next step) should look something like this (2020-Q1)
Each time this completes, increment quarter++ until (counter > span)
I will use the output from the above loop in creating a new record.
Any help out there for a newbiw coder?
Thanks much,
Sc
String Output = '2019-Q';
for (Integer i=0; i<4; i++) {
Output = Output + i;
// do stuff with the Output variable
}
^ that will loop through and create a new Output value every time until it gets to 2019-Q4 and then it will stop. :)
If this was helpful, leave a like!