Rules use update.cfm to override the standard edit

Hi All,
Did a bit of searching around and didn’t find a clear solution for this so thought I’d share.

Unlike customising a Types edit form with edit.cfm, Rules require you to use the update.cfm webskin to create a custom edit form. Adding a bit of javascript is also needed to close the modal window once you’re finished as well.

<cfsetting enablecfoutputonly="true" />
    <cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" />
    <!-- this will process the form -->
    <ft:processform action="Save" bHideForms="true">
    <ft:processFormObjects typename="#stObj.typename#" />
    </ft:processform>

<!-- now do this to make the modal disappear when you're finished -->    
<ft:processform action="Save,Cancel" bHideForms="true">
    <cfoutput>
        <script type="text/javascript">
            $fc.closeBootstrapModal();
        </script>
        </cfoutput>
    </ft:processform> 

<!-- displaying the form -->    
<ft:form>
        <ft:object objectid="#stObj.objectid#" typename="ruleMyRule" lfields="heading,aFiles,catFiles,numItems"  />
        <ft:buttonPanel class="form-actions">
            <ft:button value="Save" class="fc-btn btn btn-primary"  />
            <ft:button value="Cancel" validate="false" />
        </ft:buttonPanel>
    </ft:form>
    <cfsetting enablecfoutputonly="false" />
3 Likes