apex Posted January 5, 2011 Share Posted January 5, 2011 I am trying to figure out how to access and change custom client fields via a module using the API. I know these are available in email templates via smarty like this: {$client_custom_field_fieldname} or {$client_custom_fields.2} The API documentation doesn't mention custom fields on the "Update Client" page, but the "Add Client" page says: customfields - a base64 encoded serialized array of custom field values I've been trying things like this: $postfields["client_custom_field_fieldname"] = "test2"; $postfields["clientsdetails"]["fieldname"] = "test3"; I can edit other client properties just fine, and yes I am already editing the custom client fields via SQL but it is a lot of extra code and it's ugly and buggy. So, does anyone know how to do it or if they are even available via the updateclient action? 0 Quote Link to comment Share on other sites More sharing options...
apex Posted January 5, 2011 Author Share Posted January 5, 2011 I think I've gotten a bit closer as I found this code mentioned in the forum: $postfields["customfields1"] = base64_encode(serialize(array("1"=>"Google"))); However, I have tried dozens of different things with the above line and still have not been able to change the value of my existing custom client field. 0 Quote Link to comment Share on other sites More sharing options...
apex Posted January 6, 2011 Author Share Posted January 6, 2011 $postfields["customfields"] = base64_encode(serialize(array("1"=>"zzz","5"=>"xxxx"))); ^-- That is it. Thanks Matt! 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.