Did you know.... little things in Create

I was chatting with some of our platform solution developers the other day and realised there are loads of little ‘did you know…’ bits in Create, functionality that is pretty amazing but might not necessarily be something our community has come across. Maybe you’ve been building in Create from the days of MATS 7.8 and although you’ve read the release notes, there’s little bits that have escaped you, or you’re new to the community, just started with Create and have the basics done, but want to know how to add that little bit of sparkle to your apps. My hope it this post gets those contributions, that you can skim through and go ‘huh!’ like i do everytime one of our builders, testers, designer or core team share a little nugget with me that i didn’t know!

2 Likes

I’ll kick it off with Slugs…

Did you know, when creating a page, sub tab, viewport or top tab, you can add a ‘Slug’. In the basics tab - theres a url-slug field. Putting some text in here means your url doesn’t show like this Http://didyouknow.onmats.com/i/stuff/87897A/66357B/676786/777AA8 but instead, i/stuff/toptab/viewport/subtab/excitingpagenamehere

Means when you look in browser history, it also makes sense on the journey a user has been on too!

2 Likes

A new tip I’ve recently learned about running rules in the background:
Say you have 5 rules that are triggered by an added to subset event and you have them all flagged as run in background.

Doing this will stop the rules running in the order they are listed, as they are in the background running in their own time.

To overcome this, make one rule that is triggered by the added to subset event, set this rule as run in background with an action to trigger a new event.

Change the first 5 rules to trigger from the new event and remove their run in background setting.

This will run the 5 rules in order, but because they have been triggered by a background rule, they will run in order in the background.

5 Likes

Nice tip Karen and congratulations on your first post!

Controlling record images sizes in generated PDFs
It took me a little while this morning to work this out so hopefully it can help others too.

If you are generating a PDF using properties from a record and one of those properties is an image data type, the image will be presented on the PDF in its natural form.

For example, if the user can upload a photo from a smartphone into this property, the actual image size can be huge and will spill across several pages of the PDF.

I’d like to control the width of the image so it will always fit the section of the PDF.

I’ve achieved this by viewing the “source” when editing the Template (file content) which generates the PDF.

Find the reference to the image which will look like this:
{{!field:{"base":"base_object:OBJ0000049CCCBE1","field_path":"REL0000146CCCBE1,REL0000117CCCBE1,REL0000115CCCBE1:PRO0000985CCCBE1","alternative_text":"Applicant photo"}!}}

Then wrap it in div tags and give it an id.

<div id="photo">{{!field:{"base":"base_object:OBJ0000049CCCBE1","field_path":"REL0000146CCCBE1,REL0000117CCCBE1,REL0000115CCCBE1:PRO0000985CCCBE1","alternative_text":"Applicant photo"}!}}</div>

At the top and the start of the source I add a short internal CSS style sheet:edit the value in max-width to your desired width
<style type="text/css">#photo img{max-width:500px;}</style>

This works quite nicely, please let me know if there are other options for achieving these results.

4 Likes

Thanks Craig!

Is this via a template to generate a pdf in Create? You can also use a ‘page include’ function to add a create sub page into the template. I’ve done this to put a list of images into the pdf and you can then use the max height / width to limit the images. It’s nowhere as robust as yours i believe (as with css you can make it a lot tidier / flexible) but an alternative

1 Like

Yes, via a template to generate the pdf in Create. Thanks for the tip, I’ll try it with a page include so I can make an informed decision in the future.