Afform - Set default values from URL with or without field prefix
authorColeman Watts <coleman@civicrm.org>
Mon, 27 Sep 2021 17:42:57 +0000 (13:42 -0400)
committerColeman Watts <coleman@civicrm.org>
Sun, 3 Oct 2021 17:31:08 +0000 (13:31 -0400)
commit0420c56a9b040a5867589d74585f649ccfda9dc2
tree495c2c429d83139464ead1f5463f295520351604
parent9d6c81e202caeb265316de8a3dd4d3d7cd89e158
Afform - Set default values from URL with or without field prefix

For input forms, either of these will work:
  #?first_name=Bob
  #?Individual1.first_name=Bob

For search forms, the display name is used as the field prefix (and range values are separated with a dash). Either of these will work:
  #?total_amount=500-1000
  #?MySearchDisplay.total_amount=500-1000

Note that this assumes the main search entity is Contribution. For joins, the name of the join is required e.g. #?Contribution_Contact.first_name=Bob
ext/afform/core/ang/af/afField.component.js
ext/afform/core/ang/af/afFieldset.directive.js