Server-side merging

Server-side merging

From version 10.3, portal pages are merged on the server. The browser sends only a page ID, an optional context record ID, and its session key. Apex resolves the published page template, works out which fields and child relationships that template references, loads the data, substitutes every merge tag and repeat section, and returns the finished HTML.

This replaces the earlier browser-side merge. Conditional display (hide-if and component-visibility) is unchanged. It stays in the browser and runs on the merged output at render time. See Conditional display.

The template decides what is queried

The merge tags on a page decide which fields are queried. The template is read from the published page file (Template_html.b3p on the Page record), never from the request, so a page returns only the fields its author placed on it. The template is the contract, and the template lives on the server.

What the browser sends and receives

The runtime sends:

Parameter Required Meaning
pageId Yes The Page record to merge
recordId No Context record for record.* tags. Defaults to the session contact
sessionKey No The portal session key

The response contains the merged html, the page css and js, and the model used for the merge. The model is still exposed to page JavaScript as window.contextData, so custom page scripts keep working.

Behaviour rules

Fallback and legacy kill switch

If the server merge fails, the runtime falls back to the legacy browser-side merge so pages keep rendering during an upgrade. That fallback stays available until you turn it off.

After verifying all portals on 10.3, enable Disable Legacy Data Loader in Setup under Custom Settings, Portal. Only the server merge then loads page data. This is the recommended state for every production installation.

If a page misbehaves with the switch enabled, turn it off, test the page again, and report the affected template so the server merge can be corrected.

Limits