ptomter Posted March 7, 2019 Share Posted March 7, 2019 We now getting the values it seems .. from custom fields - https://whmcs.community/topic/292801-custom-client-fields-values-retrieving/ But when we have this custom in the xml we get - " Parse error at line [5], column [5]: Extra content at the end of the document " But if we change this with a value provided by the customer instead ex. 981981981 the the module works perfectly and everything is all good! So the values retrived is this changed in someway, or added extra information ?! Whmcs Team please provide some insight to this ! "; $clientFields = Client::find($userID)->customFieldValues; foreach($clientFields AS $field) { if (isset($field->customField->fieldName) and $field->customField->fieldName == "CustomFieldName") { $xml .= $field->customField->value; // Add ID to XML } else { return ["error" => "Some Error Message"]; } } $xml =" 1 Quote Link to comment Share on other sites More sharing options...
ptomter Posted March 8, 2019 Author Share Posted March 8, 2019 Anyone have any thoughts regarding this problem? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 8, 2019 Share Posted March 8, 2019 add a period (".") before the equal ("=") sign at the end of your code example like you have in getting the field value -- which should be $field->value and not $field->customField->value. 0 Quote Link to comment Share on other sites More sharing options...
ptomter Posted March 8, 2019 Author Share Posted March 8, 2019 Hi Steven, This has been a long week and also another long day. Yes I tried $xml .=" but then everything beneth this is new xml for WHMCS suddenly and not a continue of previous XML as it should-. Before "; at top its just xml and this all works, and are correct, and all beneth $xml .=" is correct, its just when using and getting the value from the custom field its not including .. and working Is this the best way to get custom field? 0 Quote Link to comment Share on other sites More sharing options...
ptomter Posted March 8, 2019 Author Share Posted March 8, 2019 And we are sure that this actually getting the value and not just return NULL ?! "; foreach($clientFields AS $field) { if (isset($field->customField->fieldName) and $field->customField->fieldName == "FieldCustomName") { $xml .= $field->customField->value; // Add ID to XML } else { return array("error" => "Some Error Message"); } } $xml .=" 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 10, 2019 Share Posted March 10, 2019 Will test this further tomorrow or Monday depending on time. 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.