Jump to content

ptomter

Members
  • Content count

    93
  • Joined

  • Last visited

Community Reputation

11 Good

About ptomter

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ptomter

    custom client fields values retrieving

    What am I missing now in my last post to get this to work?
  2. ptomter

    custom client fields values retrieving

    Hi @brian!I think there is a misunderstanding somewhere... as this is a custom module, and I try to get the value when I use the module on the customer in the Admin Section. So im not logged in as the customer! As It seems that some misunderstanding has been the issue I also wrote a sql query that works in sql that I had hope to use in the meantime. Yes I know its not Laravel and Capsule yet and full_query may be removed from later version, but for now I need a solution to work so I can get the value from the client customer field. to use in the XML (custom module) from Admin Section on a Client, when setting up a product. As there is no auto setup if customer doesnt pay the invoice right away. Then this must be done manually from admin. $val = full_query(" SELECT b.value FROM tblcustomfieldsvalues b JOIN tblcustomfields a ON a.id = b.fieldid AND a.fieldname= 'FieldName' AND b.relid = '1'; // Here could I have $params[customerid] to get the id "); if (isset($val)) {$xml .= $val;} else { return array("error" => "Field is Empty"); } $xml .="
  3. ptomter

    custom client fields values retrieving

    Does anybody know at all a good way to retrive value from Client Custom Field that actually works? Please advice!
  4. ptomter

    custom client fields values retrieving

    $clientFields = Client::find($userID) Would alone return null as $userID is not defined. But when looking at there should be an easy way to get value for field when knowing the field name. As there are allready are methods that obtain all the client custom fields. Property for name of custom field, and property for custom field values. https://docs.whmcs.com/classes/7.6/WHMCS/CustomField.html Anyone?!
  5. ptomter

    custom client fields values retrieving

    Yes its correct, but its still not getting any values at all into the xml, but at least the xml is right just not getting any value!
  6. ptomter

    custom client fields values retrieving

    Did you find a solution, and if so please share your solution with the community (and me) 🙂
  7. ptomter

    custom client fields values retrieving

    Im not quite sure if we are getting the value at all ... as now my xml error is Parse error at line [28], column [1824]: Element 'identity': ' ' is not a valid value of the atomic type. As its empty not getting any value. Last code we have and tried is as follow. foreach($clientFields AS $field) { if (isset($field->customField->fieldName) and $field->customField->fieldName == "CustomFieldName") { $xml .= $field->customField->value; // Add ID to XML } else { return array("error" => "Some Error Message"); } }
  8. ptomter

    Custom Field Values in XML Trouble

    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 .="
  9. ptomter

    Custom Field Values in XML Trouble

    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?
  10. ptomter

    Custom Field Values in XML Trouble

    Anyone have any thoughts regarding this problem?
  11. 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 ="
  12. ptomter

    custom client fields values retrieving

    We get the value now! - but another problem occured described in new topic. The problem was that there had came som strange charchers in the php file that was not visible in Notepad ++ but in Netbeans, Thanks to @steven99
  13. ptomter

    custom client fields values retrieving

    @steven99 Then I get a beautiful message like ParseError: syntax error, unexpected 'foreach' (T_FOREACH)
  14. ptomter

    custom client fields values retrieving

    DId you find any good solution to your problem. ? Please let me know and share your thoughts and what solution you came up with.
  15. ptomter

    custom client fields values retrieving

    $clientFields = Client::find($userID)->customFieldValues; foreach($clientFields AS $field){ if (!$fieldname) { return array("error"=>"Some Error Message"); } else { $xml .=" <no-ext-contact:identity type=\"Number\"> $fieldname1 </no-ext-contact:identity>"; } $xml .=" } 1) Check if there is a value in fieldname1 2) fieldname1 value also used in the XML Please advice
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines