Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-762

CIviContribute - Pass in contribution custom field name/value pairs via URL to set values for online contributions

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      Site administrators need the ability to assign a value custom contribution fields "automatically" by passing them in the link/url when an Online Contribution Page is loaded. For example, if they've created a custom field for "Promotion" - extends Contribution, and this field is custom_12...

      URL might be http://mysite.org/civicrm/contribution/transact?reset=1&id=1&custom_12=WinterFest-2006

      When the custom field identifier and a value for that field is included in the URL, that custom field and value is added to the session and then saved when (and if) a successful contribution is made (e.g. when the civicrm_contribution record is inserted).

      Validation - prior to adding field/value pair to the session:

      • Validate custom field identifier(s). If "no such custom field" or field doesn't extend contribution - toss (ignore) the pair. We will not throw an error (since URL's could have gotten messed up by end-user/email formatting/etc.)
      • For valid custom field id's - validate value to allowed data type (string, date, int, number, yes/no -e.g. 1/0). If value not valid, toss (ignore) the pair (again - do not throw an error).

      Save valid custom field values on success (in example above, "WinterFest-2006" is saved as value for custom_12 for the new contribution record.

        Attachments

          Activity

            People

            • Assignee:
              anil Anil Kokitkar
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: