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
james1986james1986 

alternatives to sql INSERT statement for recurring donations

hi everyone,

i work for an ngo and am tasked with moving our access database over to salesforce.

 

we have alot of recurring monthly gifts, and it would be a waste of time to enter them manually. in access, i use a bit of visual basic & sql to automate this. i am at a total loss for how to do this in salesforce... the more i read the more confused i get. in addition each pledge/donation is allocated among several funds (one gift, many allocations, one allocation, many funds - basically a many-to-many relationship). each time the values from the pledge object are added to the donation object, the corresponded pledge allocations must be added to the allocations object.

 

here is the basic algorith (without INSERT statements):

 

get firstdate variable from datepicker1

get lastdate variable from datepicker2

get paymetmethod from picklist

 

select all pledges where paymentmethod = picklist AND date >=firstdate AND date <=lastdate

 

do

      create new donation record with values from current pledge record

       select all pledges where pledge_allocation.pledgeID = current pledgeID

       do

                  create new allocation record with value from current pledge allocation record and ID from donation record just created

                  goto next pledge allocation record

        loop until end of file (or end of array selected)

 

         goto next pledge record

loop until end of file (or end of array selected)

 

 

 

this seems really basic... but i am at a total loss!

 

One option that will not work is triggering the creation of new oppourtunities after one has been updated. there are a number of reasons why i dont want to use the oppourtunities object, and i also don't want to clutter the end user's view with 25 future-dated pledges.

 

 

any help would be much appreciated!

James