Customer Portal

Get Involved. Join the Conversation.

Comments

  • Janusz Jasinski

    No errors.

    str_getcsv isn't the recommended way to deal with files

    Just wanted to see if there was a better way

  • Sristy Arya

    Hi Janusz,

    PFB the sample code to read csv.

    <?php
    if(isset($_FILES["file1"])){
    $lines = file($_FILES["file1"]["tmp_name"], FILE_IGNORE_NEW_LINES);
    $i=0;
    foreach ($lines as $key => $value){
    if($i==0){
    $headarr[$key] = str_getcsv($value);
    $i++;
    }
    else{
    $rowdata[$key] = str_getcsv($value);
    }
    }
    $cnt=1;
    if(count($rowdata)>0){
    //Rowdata contains all the data of the csv sheet as an array
    for($i=2; $i <= count($rowdata);$i++){
    try{

    $column1=ucfirst(strtolower(trim($rowdata[$i][0])));
    $column2 = strtolower(trim($rowdata[$i][1]));
    $column3 = strtolower(trim($rowdata[$i][2]));

    //fetch data using indexes & play around
    }
    catch(Exception $e){
    echo "<br>Error: ".$e->getMessage()." | Line: ".$e->getLine()."<br>";
    continue;
    }
    }
    }
    }

    ?>

    Thanks

    Sristy 

  • Sristy Arya
    Hi Janusz, Pls share the error you are encountering while uploading a CSV. Thanks Sristy
  • Pavel Franger

    Is it possible to update a custom field using the input/FormInput? 

    my code:

    Tried it both way...

    <rn:widget path="input/FormInput" name="contacts.customFields.c.contact_type" required="true" label_input="Who are you enquiring for" />

    <rn:widget path="input/FormInput" name="contacts.c$contact_type" required="true" label_input="Who are you enquiring for?" />

    Thank you in advance. 

  • Sebastiaan Draaisma

    Yes you can.

    Checkboxes are not available as custom fields but you are free to create one in HTML and use javascript to assign this to a custom field.
    Based on your needs:

    For a single check box, you could use a custom field yes/no and set the value through javascript based on the checkbox.
    If multiple checkboxes are required then depending on the quantity you could have multiple yes/no custom fields or assign all values into a custom field text area (as an array) and read the array in the workspace through a browser control.

    As usual, there are multiple/other ways of doing this. This is just one way :-)

  • Neil Emrich

    I'm good thanks!

    It's hard to tell what is happening from 1 line of code. The code is expecting customField.col_name to be populated but it doesn't appear to exist. If it's standard code this is most likely the request coming back from the chat server being unexpected, i.e. an error of some description. Hence I mentioned looking for network errors - which might not be reported in the console if they are not 500 errors, so it might involve inspecting the network requests in more detail. 

    I can take a quick look if you have something you can share (can be over PM), otherwise I can try and go through debugging steps but it make take some time.

    Neil

  • Nigel Oliver

    Hi Jessica

    Yes we have done this and gone round in circles with it. I dont think support know why this is happening,

    Cheers

    Nigel

  • Nigel Oliver

    Hi Neil

     

    Hope your well!  Ok tried this but still encountering same problem:

    Uncaught TypeError: Cannot read property 'split' of undefined

    columnName=customField.col_name.split("c$")[1],postedCustomFieldName="Incident_CustomFields_c_"+columnName,urlCustomFieldName="Incident.CustomFields.c."+columnName,url2CustomFieldName="incidents.c$"+columnName,postedCustomFields=this.data.js.postedCustomFields

    Cheers

    Nigel

  • Jessica Bradley

    Hi Nigel,

    If you're having issues after an upgrade, you should definitely open a Service Request with our Support team.

    HTH,

    --Jessica

  • Daniel Rocha

    I should be storing the attachment without the base64 header. After this change all environments worked properly again.

  • Cathy Cowan

    Have done quite a lot of testing of this and discovered it is working with compatibility mode off, the sort is only not working when this setting is on.

  • Daniel Rocha

    I don't know much about the process of upgrading from version 2 to 3.x but according to the widget documentation, the sorting should happen automatically. And the info.yml lists the datatable-sort module as a requirement to this widget. Can you check in some way if this dependencie is being loaded or show what errors it throws at you?

  • Neil Emrich

    Hi Nigel,

    Are you seeing any network errors? Is it on a clone site? I'm sure I have seen issues in the past where clones have not had the relevant account on the chat server even though the clone has it still enabled. I may be imagining it but I recall disabling and enabling chat in HMS to resolve similar issue.

    Cheers,

    Neil

  • Cathy Cowan

    It is a custom widget. I think its SelectionInput we extend from.

  • ashish bodhale

    yes the template is deployed yet we are getting this alignment issue.