Adding a field to display an Image. e.g. Product Photo

Less than one minute read time.

Below is a screen that shows the product configuration area in Sage CRM.

To create this field I added a new field to the NewProducts table within the administration screens.

I called my field 'prod_productImage' and used the Entry Type 'WWW URL'. The field has a length of 200 and an entry width on 100.

I then added the field to the New Product screen 'ProductSummary'.

I put the field on a new line and allowed it to stretch over 5 columns.

I also added the following script into the custom content box.

[code language="Javascript"]
<script>
crm.ready(function () {
var myfield = crm.fields("prod_productImage")
if (myfield.getMode()=="view")
{
myfield.urlToImage({src:myfield.value(),width:100})
}
})
</script>
[/code]

The image is entered as a URL.

E.g.

http://[img].[myserver]/images/I/81ONPcrUG7L._SL1500_.jpg

Once the image has been entered and saved field shows the URL as an image.

Parents
  • Jerome

    In the example above the image is not held in the database - only the path is used. You can certainly include the path in the email template to add the image to outbound emails. But this link to an external file doesn't work within the document merge as it expects the image file to be included in the document.

Comment
  • Jerome

    In the example above the image is not held in the database - only the path is used. You can certainly include the path in the email template to add the image to outbound emails. But this link to an external file doesn't work within the document merge as it expects the image file to be included in the document.

Children
No Data