akashpagare Posted October 14, 2022 Share Posted October 14, 2022 I want to update client record custom field on Clientedit hook. 0 Quote Link to comment Share on other sites More sharing options...
0 PUQ Posted December 20, 2022 Share Posted December 20, 2022 To update a custom field for a client record on the "ClientEdit" hook, you can use the update_client_custom_field function provided by WHMCS. Here's an example of how you can use it: use WHMCS\Database\Capsule; // Update the custom field with field ID 1 for client with client ID 123 $success = Capsule::table('tblcustomfieldsvalues') ->where('fieldid', 1) ->where('relid', 123) ->update(['value' => 'new value']); if ($success) { // Custom field update was successful } else { // Custom field update failed } Note that you will need to replace 1 with the ID of the custom field you want to update, and 123 with the ID of the client whose custom field you want to update. You will also need to replace 'new value' with the new value you want to set for the custom field. You can use this code in the "ClientEdit" hook function, which is called whenever a client record is edited in the WHMCS admin area or by the client using the client area. 0 Quote Link to comment Share on other sites More sharing options...
Question
akashpagare
I want to update client record custom field on Clientedit hook.
Link to comment
Share on other sites
1 answer to this question
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.