Jump to content

How to access custom client fields via API?


apex

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated