0

I need to be able to count the number of transactions between $100 and $150. when the first record is counted i need to stamp that transaction date to a field.

If a transaction is greater then $150 i need to reset the count to 0 and after 6 months also reset the count to 0

Have tried to use dead-haed workflow but the amount of transaction is to hight for it to cope.

I unfortunately have no code ability

thank you for reading

Michael

1
  • 1
    do you need to this a lot? Can you dataload(export) and do some excel magic? What is your use case?
    – EricSSH
    Commented Mar 14, 2015 at 6:30

1 Answer 1

0

Try following , It may not be perfect way- It will be more helpful if you explain your exact scenario in more details.

Following is PSEUDO Code for what I did understand from your question - hope that helps.

Step 1 : Create Custom Settings (create variable FirstDate__c,Count__c in it)

Step 2 : You can write Batch Class with some sort of logic like below


 1. Query all Transaction and store in LIST_Transaction
 2. Query FirstDate__c , Count__c from Custom Setting and store in one object instance - objCS.
 3. For loop to traverse through LIST_Transaction
      (i) If >$100 && < $150 Then 
           objCS.Count ++ 
          ELSE IF >$150
            Change objCS.FirstDate__c here ------ 
 4. End For
 5. Check If difference between objCS.FirstDate__c and CurrentDate is equal to or greater than Six months, 
      Set objCS.Count__c=0;
      Change value of your COUNT_VAR = objCs.Count;
 6. Update objCS;
 7. Update LIST_Transaction
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .