This document describes the ObjTextCreate text factory (factory.text/package.core/ObjTextCreate.py) and its YAML configuration (factory.text/package.core/ObjTextCreate.yaml). It covers how the {create:...} macro renders a modal form, how the RPC save works, and how optional report refresh is triggered.
ObjTextCreate provides a reusable “Create ” modal button that:
/rpc/ using existing report RPC handlers.factory.text/package.core/ObjTextCreate.pyfactory.text/package.core/ObjTextCreate.yaml{create:<object_type>[:<button_label>[:<modal_title>[:<submit_label>[:<report_code>[:<refresh_report>]]]]]}
object_type (param1)
Required. The key under create: in ObjTextCreate.yaml. Example: workflow.
button_label (param2)
Optional. The button label text. Default: + Create <ObjectType>.
modal_title (param3)
Optional. Modal header title. Default: Create <ObjectType>.
submit_label (param4)
Optional. Submit button label. Default: Save.
report_code (param5)
Optional. RPC handler/report code. Default: report_code from YAML.
refresh_report (param6)
Optional. Report code to refresh after a successful save. This triggers an RPC getlist and rebuilds the table client-side.
{create:workflow::::EditWorkflow:workflows}
object_type: workflowreport_code: EditWorkflowrefresh_report: workflowsObjTextCreate.yaml defines the form fields and defaults for each type.
create:
<object_type>:
table: <db_table>
report_code: <report_code_for_rpc>
fields:
<FieldName>:
label: <Label text>
type: text|textarea|select
required: true|false
default: <default_value>
hidden: true|false
options:
- <value>
create:
workflow:
table: def_workflow
report_code: EditWorkflow
fields:
WorkflowName:
label: Workflow code
required: true
Description:
label: Description
type: textarea
Package:
label: Package
default: "$package$"
Active:
label: Active
default: "Y"
Version:
label: Version
default: "1.0"
WorkflowGuid:
label: Workflow GUID
default: "__uuid__"
hidden: true
default values are run through process_text, so $package$ and similar macros are supported.hidden: true renders a hidden input (no label/visible field).When {create:<object_type>} is processed:
ObjTextCreate.yaml.get_uuid.<script> block is appended to attach submit logic to the form.Supported field types:
text (default)textareaselect (with options)Required fields add the required attribute.
On submit:
{
object: <report_code>,
method: "create<object_type>",
data: { ...fields }
}
RemoteProcedureCall(payload) is invoked.window.jQuery(...).modal('hide') if available.refresh_report is provided, a report refresh is triggered.If refresh_report is set:
{ object: <refresh_report>, method: "getlist", param1: "", param2: "", param3: "" }
[reportname="<code>"]._foo is preferred.table table-striped classes.This is designed to match SmartTable-style content and avoid $ in selectors that would be processed by ObjProcessText.
ObjTextCreate injects a <script> block rather than inline onclick attributes to avoid macro parsing issues.getlist (array of objects).window.jQuery.report_code is missing, nothing is rendered.report_code (e.g., EditWorkflow).reportname="<code>".