@KK, if the template in question has a "required" editable of
type='relation', then it seems the field must be repeated again in the second-stage saving.
- Code: Select all
<cms:if k_cur_form_mode eq 'create'>
<!-- find newly created page and edit it -->
<cms:pages masterpage=k_template_name id=k_last_insert_id show_future_entries='1' limit='1'>
<cms:db_persist
_masterpage=k_template_name
_mode='edit'
_page_id=k_page_id
k_page_name="<cms:show k_page_name />-xxx"
k_page_title="<cms:show k_page_title /> xxx"
required_relation_field = frm_required_relation_field
/>
</cms:pages>
</cms:if>
Without this amendement there'll be an error, such as this sample
Could not successfully run query: Duplicate entry '191-687-119' for key 'PRIMARY'