Our customers are getting confused by true / false on our Service Reports and have asked if the output documents can state yes / no, when a checkbox is either on or off.
Is there a way of changing this, or is this hard coded?
You can use IF function to achieve this. For example, {{$M.Work_Order.SVMXC__Customer_Down__c.label}}: {{$F.IF($D.Work_Order.SVMXC__Customer_Down__c, 'Yes','No')}}
You can use IF function to achieve this. For example, {{$M.Work_Order.SVMXC__Customer_Down__c.label}}: {{$F.IF($D.Work_Order.SVMXC__Customer_Down__c, 'Yes','No')}}
I inserted the following code in the template:
Risk Assessment Performed : {{$F.IF($D.Work_Order.AH_Risk_Assessment_Performed__c,'Yes','No')}}
This is displayed on the report:
Risk Assessment Performed : {{$F.IF($D.Work_Order.AH_Risk_Assessment_Performed__c,'Yes','No')}}
When I change the code in the template to:
Risk Assessment Performed : {{$D.Work_Order.AH_Risk_Assessment_Performed__c}}
This is displayed on the report:
Risk Assessment Performed : true
The IF function syntax for printing Yes/No for checkbox field values is correct; the result you see where the function is printed instead of function's return value can be because of formatting issues. Can you check the HTML source code by clicking the 'Source' button at the top left of the Template Designer in SFM Designer? You might be able to spot such issues.
Hi Colin
I have created a number of checklist type outputs for our engineers on service visits and changed the standard " true / false" on checkbox fields to( '✓', '✗')
What you need to do is to create a custom formula field with an IF function ( e.g IF(Check_clean_tank__c, '✓', '✗') then reference the field API name in your output document.
you just need to replace my ( '✓', '✗') with yes , no or use anything you want.
hope this helps
Nat
Being new to HTML I didn't realise that I had to edit this in the source. Having done so, it now works.
Bit premature on saying this was an answer, it works with the browser but the iPad doesn't work, it says Yes to everything! Is there a setting I'm missing?
It appears that the function is not parsed correctly in iPad app. Please check if this alternative works for you in both browser and iPad app:
{{$F.IF($F.FORMAT("{0}",$D.Work_Order.SVMXC__Customer_Down__c) == "true", "Yes", "No")}}
Regards,
Meenakshi.
Meenakshi
I finally got a chance to try this and it works on the Service Report but not on a related list on a Summary Report.
So thanks for the first part, that's great but any idea why it doesn't work on the summary report. See below.
This is the HTML
<div class="part-details">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<thead>
<tr>
<th colspan="7">
WORK ORDER SUMMARY</th>
</tr>
</thead>
</table>
<table border="0" cellpadding="1" cellspacing="0" svmx-data="{{$D.Work_Order}}" width="100%">
<thead>
<tr>
<th class="theader" svmx-data="{{PRMS_Job_Number__c}}">
Job Number</th>
<th class="theader" svmx-data="{{$D.Work_Order.PRMS_Order_Description__c}}">
Order Type</th>
<th class="theader" svmx-data="{{SVMXC__Component__c.Name}}">
Serial Number</th>
<th class="theader" svmx-data="{{SVMXC__Component__c.SVMXC__Product_Name__c}}">
Product</th>
<th class="theader" svmx-data="{{$F.IF($F.FORMAT("{0}",$D.Work_Order.Product_Located__c) == "true", "Yes", "No"}}">
Machine Located</th>
<th class="theader" svmx-data="{{$D.Work_Order.Installed_Product_Latest_Location__c}}">
Latest Location</th>
<th class="theader" svmx-data="{{$F.IF($F.FORMAT("{0}",$D.Work_Order.Safe_to_Operate__c) == "true", "Yes", "No"}}">
Safe to Operate</th>
<th class="theader" svmx-data="{{$F.IF($F.FORMAT("{0}",$D.Work_Order.Quote_Required__c) == "true", "Yes", "No"}}">
Quote Required</th>
</tr>
</thead>
The issue is because of the use of double quotes within double quotes. Please use single quotes for all the quoted function parameters and try.
Here is a sample: svmx-data="{{$F.IF($F.FORMAT('{0}',$D.Work_Order.Product_Located__c) == 'true', 'Yes', 'No'}}"
Hi,
We have the same problem but it seems the solution suggested does not solve ours.
For service Quote reports we are using this line:
<th class="theader" svmx-data="{{$F.IF($F.FORMAT('{0}',$D.Quote_Item__Service_Quote_.DM_Spare_Element_Require_Paint__c)=='true','✓','')}}" width="14%">
And, while in the preview I can see the special character "✓" when generating the actual pdf report the "✓" disappears and the cell is blank.
When replacing the special character "✓" with "V" it works in both preview and PDF and I can see the "V" character.
Is there a way of solving it and displaying "✓" characters for reports?
Thanks you.
PDF generation is done using the Salesforce platform functionality. It is a limitation of the platform that special characters are not displayed in the PDF generated in Salesforce.
Instead of special characters, you can try using images, with the sample code given below (for a Work Order field in the header section of the template):
<td>
<img src="" svmx-data="{{$F.IMAGE($F.IF($F.FORMAT('{0}',$D.Work_Order.SVMXC__Customer_Down__c) == 'true', 'Green_Tick', 'Red_Cross'))}}" /></td>
Note that the above usage of the IMAGE function will not download the image files to iPad. So, following code should be added to the template, to enable downloading of the image files:
<p style="display:none;">
<img src="" svmx-data="{{$F.IMAGE('Red_Cross')}}" /></p>
<p style="display:none;">
<img src="" svmx-data="{{$F.IMAGE('Green_Tick')}}" /></p>