Apex Bucket Replenishment Script Update

Key Information

Register
Submit
The challenge is finished.

Challenge Overview


 

Yo!  Salesforce gurus of the crowd.  We need help automating some record creation for our points buckets.  This will turn an admin's nightmare into a dream.  

Our Apex script that we use to replenish points and create "buckets", needs updated.  

Technical Overview for this Challenge

Our replenishment script is ran quarterly.  Currently it grabs all point buckets and replenishes amounts based on certain data points.  So, we will run this script every quarter.  It will check all active users for a "Thank You" points bucket, if it doesn't exist than create one for the user, if it does exist, then set the current balance to 300.

We have also attached our apex script that replenishes point amounts currently.  We want to add this functionality to this script.  A link to the AGE source code will also be available in the forums.

Steps to Get Source Code

  • A zip file of source code will be available in forums.
  • Load into your dev org.

Details of the challenge

  1.  Check if a points bucket exists for the user with "Thank You" in the name OR choose the bucket type field = Thank You.  This value will need to be added to the picklist on the points bucket object.
  2.  If no bucket exists, then create it for the user and set current balance to 300.
  3.  If exists set the current balance for "Thank You" buckets to 300.  
  4. Points bucket owner should = User for whom the bucket is being created, not the user running the script.
  5. Name format of 'Thank You' points bucket should = "owner name - Thank You Points"

 

Acceptance Criteria

After the changes, the script should, check all active users for a "Thank You" points bucket, if it doesn't exist than create one for the user, if it does exist, then set the current balance to 300.



Final Submission Guidelines

Upload

  1. Create a text file describing the changes done
  2. Changed source code files.

Include changed files only, and not the entire project. 

 

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30052919