leaving a field editable while using custom code to insert a value, in editviewdefs.php?

editviewdefs.php 

0 => array (

'name'=> 'somefield',

'label' => 'lbl_somefield',

'customCode' => '{$someVariable}',

),

Works great! Yet there is an inherent issue, it prevents the field from being editable by the user. Is there a way to do this and only pre-fill the field?

-Alek

Parents
  • Hi Aleksey Azanyan

    Both reply will work but first go with Parvezalam Kaliya

    Regards

    Vinod

  • Hi Aleksey Azanyan,

    You can try below code

    editviewdefs.php 

    0 => array (
    'name'=> 'somefield',
    'label' => 'lbl_somefield',
    'displayParams' =>
                array (
                  'field' =>
                  array (
                    'readOnly' => 'true',
                    'class' => 'autoCurrency',
                  ),
                ),
    /*'customCode' => '{$someVariable}',*/
    ),

    Dipesh

    Offshore Evolution Pvt Ltd

  • IT WAS! So in order to accomplish this all that was necessary was to change the:

    'customCode'  =>  '{$someVariable}',

    to:

    'customCode' => '<input value="{$someVariable}">',

    Thank you for all of the replies, I reverse engineered the contact's subpanel and found my answer! 

    Warning: this solution is correct, however not upgrade safe.

    p.s. All the replies were helpful in a way, however were not the answer to my question. So thank you to all.

Reply
  • IT WAS! So in order to accomplish this all that was necessary was to change the:

    'customCode'  =>  '{$someVariable}',

    to:

    'customCode' => '<input value="{$someVariable}">',

    Thank you for all of the replies, I reverse engineered the contact's subpanel and found my answer! 

    Warning: this solution is correct, however not upgrade safe.

    p.s. All the replies were helpful in a way, however were not the answer to my question. So thank you to all.

Children