Topic by Yiannis Evaggeliou
PHP script does not insert custom fields in RN Agent Desktop through Single Sign On
Hello all,
We encountered an issue when trying to insert custom fields' values and update menu data type values in RN Agent Desktop through Single Sign On, using php script.
The contact is created in agent desktop but the custom fields referred above don't take the values we give them.
Below is the guide that was used and the sections of it that were used:
RightNow CX™ November 2011
Pass-Through Authentication Guide
In page 22, Table 2: Parameter Descriptions:
Parameter Notes
p_ccf_* This parameter represents a contact custom field in RightNow CX. The
* must be replaced with the number of the cf_id for the contact custom
field. If this is a menu custom field, the numbers (not the actual text) for
each menu item must be specified as the value in the integration login
code. Refer to Finding code numbers.
In page 24:
//Example of sending in custom field value where the custom field
ID is 3
'p_ccf_3' => $contact->customField3Value
According to this information
In order to get the customer data we used the following query:
$match = "select id, firstname, lastname, email, password, contact_type, gender, birthdate, customerid, customersince from $table where username = '".$_POST['username']."'
and password = '".$_POST['password']."';";
$qry = mysql_query($match);
//store all the user data
$user_data = mysql_fetch_array($qry);
$num_rows = mysql_num_rows($qry);
The values are written in session variables in order to get the data to the next page which can be seen below:
$_SESSION['username']= $_POST["username"];//customer email
$_SESSION['password']= $_POST["password"];
$_SESSION['email'] = $user_data['email'];//same as username
$_SESSION['firstname'] = $user_data['firstname'];
$_SESSION['lastname'] = $user_data['lastname'];
$_SESSION['contact_type'] = $user_data['contact_type'];
$_SESSION['gender'] = $user_data['gender'];
$_SESSION['birthdate'] = $user_data['birthdate'];
$_SESSION['customerid'] = $user_data['customerid'];
$_SESSION['customersince'] = $user_data['customersince'];
below we build the PTA table with all the required customer data for the case a new CP Account needs to be created
$ptaDataArray = array(
'p_userid' => $username,
'p_passwd' => $password,
'p_email.addr' => $email,
'p_name.first' => $firstname,
'p_name.last' => $lastname,
'p_ccf_40' => $username,
'p_ccf_41' => $gender,
'p_ccf_43' => $birthdate,
'p_ccf_39' => $customerid,
'p_ccf_60' => $customersince
);
Can you please provide us a solution ?