Custom Checkbox default value in edit view - Bounty for Answer!

I have tried just about everything I can find. But no matter how I add a checkbox field to the cases module when I enter the edit view it defaults checked. I would love it if it pulled in the database value or defaulted unchecked!

I will paypal a bounty of $10 for the right answer!

So changing the SuiteDev\include\SugarFields\Fields\Bool\editView.tpl to:

{if strval({{sugarvar key=‘value’ stringFormat=‘false’}}) == “1” || strval({{sugarvar key=‘value’ stringFormat=‘false’}}) == “yes” || strval({{sugarvar key=‘value’ stringFormat=‘false’}}) == “on”}
{assign var=“checked” value=“CHECKED”}
{else}
{assign var=“checked” value=""}
{/if}

<input type=“checkbox” id="{{if empty($displayParams.idName)}}{{sugarvar key=‘name’}}{{else}}{{$displayParams.idName}}{{/if}}"
name="{{if empty($displayParams.idName)}}{{sugarvar key=‘name’}}{{else}}{{$displayParams.idName}}{{/if}}"
value=“1” title=’{{$vardef.help}}’ tabindex="{{$tabindex}}" {{if !empty($displayParams.accesskey)}} accesskey=’{{$displayParams.accesskey}}’ {{/if}}
{$checked} {{$displayParams.field}}>

Solved the issue of them coming in ‘checked’ to ‘unchecked’ however I would still like to have the DB value pull into the edit view.

Never mind that fixed the error! I don’t understand why my code was different in the file to begin with… I have updated recently to the newest version of suiteCRM