alwinaugustin Posted October 3, 2012 Share Posted October 3, 2012 I am using a client custom field for a how did you find us dropdown. It is working fine and the drop -down is showing in my site using API. But when I edit the field and update, then in client profile in WHMCS end, this value is not shown as selected in the dropdown. It is always showing the first value. But if I change the value and save from WHMCS, it is showing as selected. I am using the following function for update using API. $postfields["action"] = "updateclient"; $postfields["clientid"] = $details['userid']; $postfields["firstname"] = $details['firstname']; $postfields["lastname"] = $details['lastname']; $postfields["email"] = $details['email']; $postfields["companyname"] = $details['companyname']; $postfields["address1"] = $details['address1']; $postfields["address2"] = $details['address2']; $postfields["city"] = $details['city']; $postfields["state"] = $details['state']; $postfields["postcode"] = $details['postcode']; $postfields["phonenumber"] = $details['phonenumber']; $postfields["country"] = $details['country']; if ($details['customfields']) { if (is_array($details['customfields'])) $postfields["customfields"] = base64_encode(serialize($details['customfields'])); } else $postfields["customfields"] = ''; $results = $this->initcurl($postfields); This CURL request is handled in another function and the values are successfully changed tblcustomfieldsvalues. I can see the new value in this table and also if I use getclientsdetails API call, the values are showing. But this value is not showing as selected in the custom field dropdown in WHMCS. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted October 4, 2012 Share Posted October 4, 2012 In your $details['customfields'] array, make sure you are assigning the fieldid from the tblcustomfields table properly also make sure the value your are assigning is exactly as show in the list of options you entered into WHMCS with no extra spaces. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.