Answers.Body: <p>This is how we solved this problem for a client that has teachers as their constituents who all belong to a School Board/District. We're using the autocomplete functionality that webform_civicrm module provides to force teachers to select rather than to type. You can only imagine how many ways one could type "Grande Prairie Roman Catholic Separate School Disctrict No. 28" before we locked this down...</p>
  
  <p><a href="https://i.sstatic.net/Xdp2B.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Xdp2B.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-30T02:23:30.870Z
Answers.Text: i could imagine 'District' instead of 'Disctrict' - unless of course these areas are circular to match the shape of irrigated fields that one sees from a plane
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-29T01:51:26.263Z
Answers.LastActivityDate: 2019-11-29T01:51:26.263Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>You might be able to do it with hook_civicrm_buildForm, removing the existing <code>onbehalf[organization_name]</code> field and replacing it with a field of the same name but as a dropdown that only has the logged-in user's related orgs.</p>
  
  <p>e.g.</p>
  
  <pre><code>$form-&gt;removeElement(xxx...);
  $form-&gt;addElement(xxx...);
  </code></pre>
  
  <p>Haven't tested that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T18:01:49.460Z
Answers.LastActivityDate: 2019-10-29T18:01:49.460Z
Answers.UserDisplayName: Demerit
Body: <p>There is no nicer way to say this. My client's end users couldn't follow instructions if they were tattooed on their hands.</p>
  
  <p>It's time to renew memberships. All members are organizations, so all contributions are "on behalf of." The users can't be trusted to enter the names of their member organization correctly. Is there any way to make the "organization name" into a drop down based on relationship?</p>
  
  <p>I can't think of another way to keep users from entering initials instead of the proper organization name. I swear, they will be so creative with input that I can't even design a dedupe rule clean up afterwards. </p>
  
  <p>Help and guidance is greatly appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T19:11:37.457Z
Comments.Text: is the issue here that you cannot be certain who will fill out the form? ie it may not be someone using a checksum? if a checsum is used then my expectation is that if a checksum goes to Pete, and Pete is a permissions current employer of Fuzion, then Fuzion will automatically show in the Org Name field.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T19:17:23.577Z
Comments.Text: If only life were so simple. The problem is that Pete, Xavier,  Mary and Lourdes are all Pension fund administrators. Pete and Mary work on Fund ABC. Lourdes and Bob worked on Fund XYZ, but Bob retired and now Lourdes, Xavier and Pete all work on the fund. Tiny Fund used to be Bob's account, but now Mary took it over. No one at my client's office knows Mary. No one is the prime contact on a given fund and Mary just typed TF instead of Tiny Fund. That's more like it.
Comments.UserDisplayName: LyonsDigital
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T19:26:53.437Z
Comments.Text: You said "Is there any way to make the "organization name" into a drop down based on relationship?" is the problem that you need to use a different relationship if so
  a/ knowing your CMS might help find a work around
  b/ we have done some work on an extension which might be helpful step for you (but no expectation is currently works in the OBO scenario) https://tinyurl.com/y4pndmak
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-30T14:19:02.783Z
Comments.Text: That looks very interesting. I'll play around with it. As you can see in my example, we don't know from year to year, who will login on behalf of the organization. So each member may have several managers, who oversee the organization which itself is over multiple trustees. Parallel to all of that are associates who provide services to members and their trustees. The organizations are mostly consistent but all the contacts are subject to change.
Comments.UserDisplayName: LyonsDigital
Tags: <civicontribute><civimember><contributions>
Title: How do I make "on behalf of" user proof?
ThreadText: # How do I make "on behalf of" user proof?
  
  (Asked by: username_0 on 2019-10-29)
  
  There is no nicer way to say this. My client's end users couldn't follow instructions if they were tattooed on their hands.
  
  It's time to renew memberships. All members are organizations, so all contributions are "on behalf of." The users can't be trusted to enter the names of their member organization correctly. Is there any way to make the "organization name" into a drop down based on relationship?
  
  I can't think of another way to keep users from entering initials instead of the proper organization name. I swear, they will be so creative with input that I can't even design a dedupe rule clean up afterwards.
  
  Help and guidance is greatly appreciated.
  
  **Tags:** civicontribute, civimember, contributions
  
  > **Comments:**
  > **username_1**: is the issue here that you cannot be certain who will fill out the form? ie it may not be someone using a checksum? if a checsum is used then my expectation is that if a checksum goes to Pete, and Pete is a permissions current employer of Fuzion, then Fuzion will automatically show in the Org Name field.  
  > **username_0**: If only life were so simple. The problem is that Pete, Xavier,  Mary and Lourdes are all Pension fund administrators. Pete and Mary work on Fund ABC. Lourdes and Bob worked on Fund XYZ, but Bob retired and now Lourdes, Xavier and Pete all work on the fund. Tiny Fund used to be Bob's account, but now Mary took it over. No one at my client's office knows Mary. No one is the prime contact on a given fund and Mary just typed TF instead of Tiny Fund. That's more like it.  
  > **username_1**: You said "Is there any way to make the "organization name" into a drop down based on relationship?" is the problem that you need to use a different relationship if so a/ knowing your CMS might help find a work around b/ we have done some work on an extension which might be helpful step for you (but no expectation is currently works in the OBO scenario) https://tinyurl.com/y4pndmak  
  > **username_0**: That looks very interesting. I'll play around with it. As you can see in my example, we don't know from year to year, who will login on behalf of the organization. So each member may have several managers, who oversee the organization which itself is over multiple trustees. Parallel to all of that are associates who provide services to members and their trustees. The organizations are mostly consistent but all the contacts are subject to change.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-11-29. Score: 2
  
  This is how we solved this problem for a client that has teachers as their constituents who all belong to a School Board/District. We're using the autocomplete functionality that webform\_civicrm module provides to force teachers to select rather than to type. You can only imagine how many ways one could type "Grande Prairie Roman Catholic Separate School Disctrict No. 28" before we locked this down...
  
  [![enter image description here](https://i.sstatic.net/Xdp2B.png)](https://i.sstatic.net/Xdp2B.png)
  
  > **Comments:**
  > **username_1**: i could imagine 'District' instead of 'Disctrict' - unless of course these areas are circular to match the shape of irrigated fields that one sees from a plane  
  
  ---
  
  ### Answer by username_3 on 2019-10-29. Score: 1
  
  You might be able to do it with hook_civicrm_buildForm, removing the existing onbehalf[organization_name] field and replacing it with a field of the same name but as a dropdown that only has the logged-in user's related orgs.
  e.g.
  $form->removeElement(xxx...);
  $form->addElement(xxx...);
  
  Haven't tested that.
  
  
  ---
  
  