Customer Portal

Get Involved. Join the Conversation.

Comments

  • Baljeet Singh

    Thanks Deniel for your reply

    I have already tried hard coded value in view.php but it is not working

    <rn:widget path="custom/Report/ReportGrid_v2"  report_id="100268"  static_filter="Master=474"/>

    I was able to get these value in controller.php file but unable to get desire result based on this value. Here is an array I get when I debugged it

    Array
    (
        [Master] => stdClass Object
            (
                [filters] => stdClass Object
                    (
                        [rnSearchType] => custom
                        [searchName] => Master
                        [report_id] => 100268
                        [data] => 474
                        [oper_id] => 1
                        [fltr_id] => 1
                    )

            )

    )

     

    After setting dynamic filter, I am not able to get result

     

    //Set Dynmaic Filter For Master Store
            $getFilter = $this->CI->model('Report')->getFilterByName($this->data['attrs']['report_id'], 'Master');
            $masterFilter = $getFilter->result;
            $widgetArg = $masterFilter['name'];
            $filters[$widgetArg]->filters->rnSearchType = 'custom';
            $filters[$widgetArg]->filters->fltr_id = $masterFilter['fltr_id'];
            $filters[$widgetArg]->filters->oper_id = $masterFilter['oper_id'];
            $filters[$widgetArg]->filters->name    = $masterFilter['name'];
            $filters[$widgetArg]->filters->data = 474;           
            
            $results = $this->CI->model('Report')->getDataHTML($this->data['attrs']['report_id'], $reportToken, $filters, $format)->result;
            

        It display all result but we need to get result based on filter value i.e. 474

     

    Thanks!!

    Baljeet 

  • Daniel Rocha

    The field name you are using must match the exact name you gave to the filter in the console. If it's the same and it's still not working you could try set it directly in the view like this:

     

    <?php

    $idMaster = \RightNow\Utils\Url::getParameter('master'); // just as example, the markup below is the important part

    ?>

    <rn:widget path="custom/Report/ReportGrid_v2"  report_id="100268"  static_filter="Master=#rn:php:$idMaster#"/>

  • 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