Jump to content

CustomField


cesarlopes

Recommended Posts

Hello,

I would like to know how to use the CustomField or Client Class and obtain all registered custom fields and their values.

I tried the code below but didn't get any results:

<?php

use WHMCS\User\Client;
use \WHMCS\CustomField;

require_once __DIR__ . '/../../../init.php';

$Client = Client::find('110'); //user id example
$clientFields = $Client->customFieldValues;

print_r($clientFields);

 

Link to comment
Share on other sites

Hello,

I got it to retrieve all the values, but did not return the name of the custom fields

$clientFields = $Client->customFieldValues()->get();

Could someone help me?

I think I need to use this other class, but I didn't quite understand how to relate the client object to it.

https://classdocs.whmcs.com/7.9/WHMCS/CustomField.html

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