Question
call PM in the UI using startprocess
load(
local!crAppComments_cdt: rule!CR_APP_QE_getCoventsAndConditionsCommentsBasedOnFilters(
requestId_int: ri!requestId_int,
cif_int: ri!cif_int,
sourceName_txt: ri!sourceName_txt
),
{
a!boxLayout(
label: ri!sourceName_txt & " " & cons!CR_APP_LAB_COLLATERAL_COMMENT[1],
isInitiallyCollapsed: true(),
isCollapsible: true(),
contents: {
a!sideBySideLayout(
showWhen: not(
contains(
ri!buttonAction_txt,
cons!CR_APP_TXT_READ_ONLY
)
),
items: {
a!sideBySideItem(
width: "10X",
item: a!richTextDisplayField(
align: "RIGHT",
value: a!richTextIcon(
linkStyle: "STANDALONE",
icon: cons!CR_APP_TXT_ACTION_ICONS[2],
color: "ACCENT",
size: "MEDIUM",
caption: "Edit",
link: a!dynamicLink(
value: cons!CR_APP_COMMENT_EDIT_FIN_COV,
saveInto: { ri!buttonAction_txt }
)
)
)
),
a!sideBySideItem(
width: "10X",
item: a!richTextDisplayField(
align: "RIGHT",
value: a!richTextIcon(
linkStyle: "STANDALONE",
icon: cons!CR_APP_TXT_ACTION_ICONS[1],
color: "ACCENT",
size: "MEDIUM",
caption: "Save",
link: a!submitLink(
value: cons!CR_APP_COMMENT_SAVE_FIN_COV,
saveInto: {
ri!buttonAction_txt,
a!writeToDataStoreEntity(
dataStoreEntity: cons!CR_APP_ENTITY_COMMENT,
valueToStore: ri!crAppComments_cdt
),
},
skipValidation: false
)
)
),
showWhen: ri!buttonAction_txt = cons!CR_APP_COMMENT_EDIT_FIN_COV
),
a!sideBySideItem(
width: "MINIMIZE",
item: a!richTextDisplayField(
align: "RIGHT",
value: a!richTextIcon(
linkStyle: "STANDALONE",
icon: cons!CR_APP_TXT_ACTION_ICONS[3],
color: "NEGATIVE",
size: "MEDIUM",
caption: "Close",
link: a!submitLink(
confirmMessage: cons!CR_APP_TXT_CANCEL_CONFIRMATION,
value: cons!APN_TXT_CLOSE,
skipValidation: true(),
saveInto: { ri!buttonAction_txt }
)
)
),
showWhen: ri!buttonAction_txt = cons!CR_APP_COMMENT_EDIT_FIN_COV
)
}
),
richTextEditorField(
maxSize: cons!CR_TXT_RICH_TEXT_EDITOR_MAX_SIZE,
showWhen: not(
ri!buttonAction_txt = cons!CR_APP_TXT_READ_ONLY
),
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[1],
richTextValue: clean(
rule!CR_APP_FN_cleanRichTextEditorString(
if(
ri!isEditable_bool,
ri!crAppComments_cdt.comment_txt,
""
)
)
),
richTextSaveInto: {
ri!crAppComments_cdt.comment_txt,
a!save(
ri!crAppComments_cdt,
rule!NBF_COMMON_updateDictionary(
dictionary: ri!crAppComments_cdt,
fieldsAndValues: {
requestId_int: ri!requestId_int,
cif_int: ri!cif_int,
sourceName_txt: ri!sourceName_txt,
addedOn_dt: now(),
addedBy_txt: loggedInUser(),
addedByRole_txt: rule!CR_APP_FN_getUserRole(inputUser_txt: loggedInUser())
}
)
)
},
isReadOnly: not(ri!isEditable_bool),
validations: if(
ri!isEditable_bool,
if(
rule!APN_isBlank(
striphtml(ri!crAppComments_cdt.comment_txt)
),
cons!CR_APP_RTF_TXT_VALIDATION_MSG,
""
),
""
)
),
a!boxLayout(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[2],
isCollapsible: true(),
isInitiallyCollapsed: true(),
marginBelow: "NONE",
contents: {
a!gridField(
showWhen: rule!APN_isBlank(local!crAppComments_cdt),
spacing: "DENSE",
data: local!crAppComments_cdt,
columns: {
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[3],
value: rule!CR_FN_nbfDateTimeFormat(
input: local!crAppComments_cdt.addedOn_dt
),
width: "MEDIUM",
align: "START"
),
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[4],
value: rule!APN_FN_getDisplayName(
userId: local!crAppComments_cdt.addedBy_txt
),
width: "MEDIUM",
align: "START"
),
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[5],
value: rule!CR_FN_nbfDateTimeFormat(
input: local!crAppComments_cdt.addedByRole_txt
),
width: "MEDIUM",
align: "START"
)
}
),
a!forEach(
items: local!crAppComments_cdt,
expression: {
a!sectionLayout(
divider: if(fv!isFirst, "NONE", "ABOVE"),
marginBelow: "NONE",
contents: {
a!gridField(
spacing: "DENSE",
data: fv!item,
columns: {
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[3],
value: rule!CR_FN_nbfDateTimeFormat(input: fv!item.addedOn_dt),
width: "MEDIUM",
align: "START"
),
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[4],
value: rule!APN_FN_getDisplayName(userId: fv!item.addedBy_txt),
width: "MEDIUM",
align: "START"
),
a!gridColumn(
label: cons!CR_APP_LAB_COLLATERAL_COMMENT[5],
value: fv!item.addedByRole_txt,
width: "MEDIUM",
align: "START"
)
}
),
richTextEditorField(
labelPosition: "COLLAPSED",
validations: {},
isReadOnly: true(),
height: "AUTO",
richTextValue: clean(
rule!CR_APP_FN_cleanRichTextEditorString(index(fv!item, "comment_txt", {}))
)
)
}
)
}
)
}
)
}
)
}
)
is their any possibility to call a process model instead of writetodatastore on the UI
if so can i use startprocess- plz help me how can i use it with sample snippet
