cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox in doc designer

Grill Chef
Grill Chef

Checkbox in doc designer

Jump to solution

Is there a way to add a checkbox on a report using the doc designer.

Right now if we copy the field label into the doc designer it gives us "true" for checked and "false" for unchecked.

Any suggestions?

Message 1 of 9
1 Solution

Accepted Solutions
Grill Chef
Grill Chef

Re: Checkbox in doc designer

Jump to solution

Thanks to Colin Jones​ it is working now. See below for the solution:

  1. 1. Added a hidden section at the top of page to ensure the images for the checked and unchecked boxes are downloaded to the MFL or iPad if the report is ever to be used on mobile.

<div id="temp" style="display: none">

            <img svmx-data="{{$F.IMAGE('Checkbox_Checked')}}" /> <img svmx-data="{{$F.IMAGE('Checkbox_Unchecked')}}" /></div>

  1. 2. Added a hidden section for each checkbox field, as it appears the field needs to be references at least once outside of the 'if' statement for it to work properly.

example:

<div style="display: none">

            {{$D.Work_Order.Color_Target__c}}</div>

  1. 3. Added an extra condition in the 'if' to cater for both MFL and iPad as they both see the true/false condition slightly differently.

example:

<img src="" svmx-data="{{$F.IMAGE($F.IF(($D.Work_Order.SNCR_thin_target__c==true || $D.Work_Order.SNCR_thin_target__c=='true'), 'Checkbox_Checked', 'Checkbox_Unchecked'))}}" />

Message 9 of 9
8 Replies
Highlighted

Re: Checkbox in doc designer

Jump to solution

Instructions for displaying an image in place of 'true' and 'false' can be found in our help content, within the Smart Docs FAQ section (link below). It requires a little preparation of your desired images and a little work within the HTML of your document (vs. the WYSIWYG designer) but the formula is pretty straight forward.

ServiceMax Online Help

Message 2 of 9
Grill Chef
Grill Chef

Re: Checkbox in doc designer

Jump to solution

Hi Crhis,

Thanks for the answer. I was able to generate the boxes but when I check the box it still shows up as unchecked.

See my string below:

<img src="" svmx-data="{{$F.IMAGE($F.IF($F.FORMAT('{0}',$D.Work_Order.Other_Tools_Used__c) == 'true', 'Checkbox_Checked', 'Checkbox_Unchecked'))}}" /></td>

What am I missing?

Message 3 of 9
0 Likes
Retired

Re: Checkbox in doc designer

Jump to solution

See knowledge article here:  How To Display a Checkbox Image in Output documents

The formula is slightly different than the one above.  Let me know if that works.

Message 4 of 9
0 Likes
Grill Chef
Grill Chef

Re: Checkbox in doc designer

Jump to solution

Okay so now at least I have the correct box whenever it is checked/unchecked. The thing I have now is that in my output document, besides the checkbox it also says "true" or "false". Is it possible to remove that as well?

Message 5 of 9
0 Likes
Retired

Re: Checkbox in doc designer

Jump to solution

I'm not sure, but I would think you would have to remove the =='true" from the checkbox formula.  The formula mentioned in the article listed above does not have it.

Message 6 of 9
0 Likes
Grill Chef
Grill Chef

Re: Checkbox in doc designer

Jump to solution

ServiceMax Knowledge, I removed hte == 'true', but it is still showing the true as well. See below the line as I have it now.

Any other ideas?

<span style="font-size:10px;"><span style="font-family:verdana,geneva,sans-serif;"><img src="" svmx-data="{{$F.IMAGE($F.IF($D.Work_Order.Color_Target__c, 'Checkbox_Checked', 'Checkbox_Unchecked'))}}" /></span></span>

Message 7 of 9
0 Likes
Employee
Employee

Re: Checkbox in doc designer

Jump to solution

Sjef Wijnen​,

The sample code in online help was validated in both online and iPad apps. So, if it does not work, you might want to open a case with ServiceMax Support to investigate this further. If you see the issue in online app, please share the details of the browsers (along with version numbers) and your ServiceMax package version. If the issue is in a mobile app, sharing both server and client app versions will help.

Additionally, you can check the following: Is the code you have shared here the complete code between <td> and </td> tags?

If not, do you have "<p> {{$D.Work_Order.SVMXC__Customer_Down__c}}</p>" from the Knowledge article included in your template? If yes, please remove this part and try. This is for resolving the issue of the text value 'true' / 'false' being displayed in addition to the image.

If what you have shared is the complete code, please try removing the span tags. Also, please view the template HTML in Source code mode in the Template Designer and check if there are any extra characters / formatting. These might interfere with the function evaluation.

Regards,

Meenakshi.

Message 8 of 9
0 Likes
Grill Chef
Grill Chef

Re: Checkbox in doc designer

Jump to solution

Thanks to Colin Jones​ it is working now. See below for the solution:

  1. 1. Added a hidden section at the top of page to ensure the images for the checked and unchecked boxes are downloaded to the MFL or iPad if the report is ever to be used on mobile.

<div id="temp" style="display: none">

            <img svmx-data="{{$F.IMAGE('Checkbox_Checked')}}" /> <img svmx-data="{{$F.IMAGE('Checkbox_Unchecked')}}" /></div>

  1. 2. Added a hidden section for each checkbox field, as it appears the field needs to be references at least once outside of the 'if' statement for it to work properly.

example:

<div style="display: none">

            {{$D.Work_Order.Color_Target__c}}</div>

  1. 3. Added an extra condition in the 'if' to cater for both MFL and iPad as they both see the true/false condition slightly differently.

example:

<img src="" svmx-data="{{$F.IMAGE($F.IF(($D.Work_Order.SNCR_thin_target__c==true || $D.Work_Order.SNCR_thin_target__c=='true'), 'Checkbox_Checked', 'Checkbox_Unchecked'))}}" />

Message 9 of 9