Answers.Body: <p>You're on the right track. If you go to the contact summary page and click the popup links to add/edit custom data then you can re-use those exact links in your report. Give the <code>&lt;a&gt;</code> a class of <code>crm-popup</code> and Civi's js will do the rest for you. No need to redirect back to the report, you can make it refresh automatically via ajax when the popup form is saved by using the <code>CRM.refreshParent</code> method similar to <a href="https://github.com/civicrm/civicrm-core/blob/4.7.10/js/crm.livePage.js#L11" rel="nofollow">crm.livepage.js</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-26T21:37:11.553Z
Answers.LastActivityDate: 2016-08-26T21:37:11.553Z
Answers.UserDisplayName: Coleman
Body: <p>I have a custom report generated for viewing some contact data and I would like to include a link to send the user to an edit form for a single multi-value custom field record. I would then use civicrmDestination to send them back to the report. I have tried various formats copied from links in the CiviCRM interface. None seem to work. The closest format was this but there is an issue with the "&amp;cgcount" parameter. It seems to always force editing the first record. Is there a way to ignore this and just used the multivalued set record id which is 60159 in my example below?</p>
  
  <pre><code>/civicrm/contact/view/cd/edit?reset=1&amp;type=Organization&amp;groupID=11&amp;entityID=92&amp;cgcount=1&amp;multiRecordDisplay=single&amp;mode=edit&amp;fsId=60159
  </code></pre>
  
  <p>Ideally I would also like to include a link to create a new custom value record for the row's related contact.</p>
  
  <p>Alternately I would be happy to use JavaScript to create a popup form to edit these records. I am not sure what format to use for that either.</p>
  
Tags: <custom-fields><4.7>
Title: Generating links or a popup to edit a single multivalue custom field record in CiviCRM 4.7
ThreadText: # Generating links or a popup to edit a single multivalue custom field record in CiviCRM 4.7
  
  (Asked by: username_0 on 2016-08-24)
  
  I have a custom report generated for viewing some contact data and I would like to include a link to send the user to an edit form for a single multi-value custom field record. I would then use civicrmDestination to send them back to the report. I have tried various formats copied from links in the CiviCRM interface. None seem to work. The closest format was this but there is an issue with the "&cgcount" parameter. It seems to always force editing the first record. Is there a way to ignore this and just used the multivalued set record id which is 60159 in my example below?
  
  ```
  /civicrm/contact/view/cd/edit?reset=1&type=Organization&groupID=11&entityID=92&cgcount=1&multiRecordDisplay=single&mode=edit&fsId=60159
  
  ```
  
  Ideally I would also like to include a link to create a new custom value record for the row's related contact.
  
  Alternately I would be happy to use JavaScript to create a popup form to edit these records. I am not sure what format to use for that either.
  
  **Tags:** custom-fields, 4.7
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-08-26. Score: 2
  
  You're on the right track. If you go to the contact summary page and click the popup links to add/edit custom data then you can re-use those exact links in your report. Give the `<a>` a class of `crm-popup` and Civi's js will do the rest for you. No need to redirect back to the report, you can make it refresh automatically via ajax when the popup form is saved by using the `CRM.refreshParent` method similar to [crm.livepage.js](https://github.com/civicrm/civicrm-core/blob/4.7.10/js/crm.livePage.js#L11)
  
  
  ---
  
  