Update a Customer Record | CRM Interface

The add method can also be used to update a customer record if an existing record can be identified from the parameters and the MERGE option is not skip. There are 3 ways to identify a customer record.

  1. crmentid is specified
  2. A phone number is specified
  3. An email address is specified and MERGEBYEMIAL is set to 1

The preferred way is to use the entity ID (crmentid) for identifying a record. The other two methods may not find the correct record if there are duplicate records of the same phone number or email.

The update method uses the MERGE option the same way as the add method does. To update existing values, the MERGE option must be set to yes.

Example

This simple example shows how to conduct a online survey for your customers and have the survey results directly saved to corresponding customer records. This example assumes your website is mywebsite.com and the survey page is mysurvey.php.

  1. Email the survey URL to customers. The URL should contain entity ID information, such as http://mywebsite.com/mysurvey.php?id=12345. To specify the URL in an email template in Voicent software, use: http://mywebsite.com/mysurvey.php?id=${CUSTOMER_ID}.
  2. Your survey form should be rendered dynamically to include the entity ID, normally as a hidden input value. You can create a web form to see other parameters to include. The following PHP code shows one way to render the survey form.

<?php
$id 
$_GET['id'];
...
?>
...
<form method="POST" class="horizontal-form" id="webform" action="http://[voicent_server_ip_address]:8155/vxcrm.jsp">
    <div class="form-body">
        <h3 class="form-section" id="form_sec">Survey</h3>
        <input name="vgformid" type="hidden" value="your_webform_id">
        <input name="vgformtoken" type="hidden" value="your_form_token_id">
        <input name="vgformid2" type="hidden" value="0">
        <input name="action" type="hidden" value="add">
        <input name="MOD" type="hidden" value="CUS">
        <input name="crmentid" type="hidden" value="<?php=$id?>">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <div class="form-group"><label class=" control-label">Question 1</label><input name="CF_1" type="text" id="q1_input" value="" class="form-control "></div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group"><label class=" control-label">Question 2</label><input name="CF_2" type="text" id="q2_input" value="" class="form-control "></div>
            </div>
        </div>
        <div class="form-actions fluid">
            <div class="row">
                <div class="col-md-offset-3 col-md-9">
                    <button id="webform-submitbtn" type="submit" class="btn green mt-ladda-btn ladda-button" data-style="expand-left"><span class="ladda-label">Submit</span></button>
                </div>
            </div>
        </div>
    </div>
</form>
...