FAQ: Smart Doc
This section contains frequently asked questions related to ServiceMax Smart Doc
Feature Area
Question
Answer
Formatting
How can the numbers and currencies be formatted based on the logged-in user's locale?
Use LNUMBER function. For more information, seeNumber Functions.
How can the company logo be displayed in Smart Docs?
Refer to sections Uploading image files and Inserting company logo under Images section for the procedure to achieve this.
How to set Header and Footer in Smart Document Templates?
You can set Header and Footer in Templates by defining the div classes for header and footer in the HTML template. The below steps illustrate as to how to include images in the header and page numbers in the footer of every page.
1. Include the below-mentioned print media query within a style tag in the Template Designer
2. Define the image within a div tag
3. Assign a class to the div tag with the value set to the header (as shown in the sample code)
Sample Code:
<style type="text/css">
@media print {
div.header {
display: block;
position: running(header);
}
div.footer {
display: block;
position: running(footer);
}
}
@page {
@top-left {
content: element(header);
}
margin-bottom:200px;
@bottom-center {
content: element(footer);
}
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
<div class="header">
<img alt="LOGO" svmx-data="{{$F.IMAGE('ServiceMaxLogo')}}" />
</div>
Language And Locale
Are Smart Documents rendered in the language of the technician or customer?
They are rendered in the language of the logged-in Salesforce User (technician).
Are SFDC Custom Labels supported in Smart Docs?
SFDC Custom Labels are not supported in Smart Docs. However, there is a workaround for achieving the same:
If the requirement is for a translatable string of up to 255 characters in length, dummy custom fields of type Picklist can be defined and included in Smart Docs, and their labels and values can be translated.
If the requirement is for translatable string is greater than 255 characters in length:
Define a custom label. Define a long text area field in the required object. Have a before insert and before update trigger on this object, which sets this long text area field to the value of this custom label. Use the value of this long text area field in the Output Document Template.
Signature
How can the size of signature areas be configured?
Use the last two optional parameters of the SIGNATURE function to specify height and width in pixels. Their default values are 186px and 350px respectively. For more details and examples, refer to sections Signatures and Widget Functions.
General
How can a checkbox image be displayed in Smart Documents?
Use the steps below to display the image for the checkbox field in Smart Docs:
1. Create two images to depict the picture of the checkbox in checked and unchecked respectively.
2. Refer to this section to know how to upload image files and how to access the uploaded image files in Template Designer.
3. Use the following syntax in Template Designer for the required checkbox:
<td>
<img src="" svmx-data="{{$F.IMAGE($F.IF($F.FORMAT('{0}',fieldname) == 'true', 'checkbox_checked', 'checkbox_unchecked'))}}" />
<p style="display:none;">
{{fieldname}}
</p>
</td>
Note that for the value of the checkbox field to be considered consistently, the field has to be referenced at least once outside of the IMAGE function. For this purpose, the code has been included in the above syntax. If it is not included, the image might not be displayed at times, and a blank image outline or blank space might be displayed instead.
For example, to display 'Customer Down' value with a checkbox image in Output Documents, use the following syntax:
<td>
<img src="" svmx-data="{{$F.IMAGE($F.IF($F.FORMAT('{0}',$D.Work_Order.SVMXC__Customer_Down__c) == 'true', 'checkbox_checked', 'checkbox_unchecked'))}}" />
<p style="display:none;">
{{$D.Work_Order.SVMXC__Customer_Down__c}}
</p>
</td>
Note that if you are using this template in mobile devices such as in the iPad app, the IMAGE function will not automatically download the mentioned image files to the device. So, the following code should be added to the template, to enable the downloading of image files:
<p style="display:none;">
<img src="" svmx-data="{{$F.IMAGE('checkbox_checked')}}" />
</p>
<p style="display:none;">
<img src="" svmx-data="{{$F.IMAGE('checkbox_unchecked')}}" />
</p>
Is it possible to display Yes or No when checkbox fields are checked or unchecked, instead of the default true or false?
Yes, it is possible to achieve this using IF function. Sample code for a header section field is given below:
{{$M.Work_Order.SVMXC__Customer_Down__c.label}}: {{$F.IF($F.FORMAT('{0}',$D.Work_Order.SVMXC__Customer_Down_
_c) == 'true', 'Yes', 'No')}}
Sample code for a child section field is given below:
svmx-data="{{$F.IF($F.FORMAT('{0}',$D.Parts.SVMXC__Is_Billable__c) == 'true', 'Yes', 'No')}}"
Note that special characters such as tickmark are not supported instead of 'Yes' or 'No'. This is because 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.
Was this helpful?