ensure spreadsheet: EventSheet
withFields: [
"RelatedTo*",
"Refresh",
"FormMode",
"GetEventDetailButton",
"RowId",
"Id",
"Subject*",
"Description",
"StartDateTime*",
"EndDateTime*",
"IsAllDayEvent",
"Location",
"AssignedTo",
"RelatedToId",
"RelatedToValue"
]
ofTypes: [
pcikText,
button,
text,
button,
rowId,
text,
text,
paragraph,
dateTime,
dateTime,
bool,
text,
pcikText,
text,
text
]
removeRoleSet: [Owner]
readRoleSet: [Owner]
insertRoleSet: [Owner]
updateRoleSet: [Owner]
ensure spreadsheet EventSheet
searchables: [Subject, Description, StartDateTime, EndDateTime, Location]
queryables: [Id]
ensure form EntityEvent commentRoleSet: [Owner]
ensure section: Details
ensure field RelatedTo
plugIn: SalesforcePlugin
pluginApi: GetOpportunitiesDropdownList
ensure field Refresh
icon: "RefreshRounded"
btnPosDoNotInline: true
btnPosToolbar: true
buttonKind: normal
actionCloseAside: true
targetType: invokePlugin
plugIn: SalesforcePlugin
pluginApi: SyncDetail
ensure field FormMode
permissionMatrix: {
'defaultPermission': 'invisible'
}
ensure field GetEventDetailButton
permissionMatrix: {
'defaultPermission': 'invisible'
}
buttonKind: normal
targetType: invokePlugin
plugIn: SalesforcePlugin
pluginApi: GetEventDetails
ensure field RowId
permissionMatrix: {
'defaultPermission': 'invisible'
}
ensure field Id
permissionMatrix: {
'defaultPermission': 'invisible'
}
ensure field StartDateTime defaultVar: VarDateTimeStartActivity
ensure field EndDateTime defaultValue: "tomorrow"
ensure field AssignedTo plugIn: SalesforcePlugin pluginApi: GetUsers
ensure field RelatedToId
permissionMatrix: {
'defaultPermission': 'invisible'
}
ensure field RelatedToValue
permissionMatrix: {
'defaultPermission': 'invisible'
}
ensure var VarConditionCreateEventUpdateRelatedToField kind: condition
deploy: fixedOnDeploy
sourceForm: EntityEvent
value: "<root>
<and>
<stmt>${f:Details.FormMode} == ${var:VarTextFormModeCreate}</stmt>
<stmt>${f:Details.RelatedToId} has value</stmt>
<stmt>${f:Details.RelatedToValue} has value</stmt>
</and>
</root>"
ensure form EntityEvent
ensure formula RelatedTo
conditionVar: VarConditionCreateEventUpdateRelatedToField
assignToField: Details.RelatedTo
formula: "var d = {};
d['optionId'] = ${f:Details.RelatedToId};
d['value'] = ${f:Details.RelatedToValue};
d
"
ensure visibilityRule OnEditEventVisibilityRule
condition: "<root>
<and>
<stmt>Details.Id has changed</stmt>
<stmt>Details.FormMode == ${var:VarTextFormModeEdit}</stmt>
<stmt>Details.FormMode has value</stmt>
<stmt>Details.Id has value</stmt>
</and>
</root>"
ensure actionMapIfTrue MakeGetEventDetailButtonClick
comp: Details.GetEventDetailButton
visibilityAction: click
visibilityActionOn: field
ensure visibilityRule RefreshButtonVisibilityRule
condition: "<root>
<and>
<stmt>Details.Id has value</stmt>
<stmt>Details.FormMode has no value</stmt>
</and>
</root>"
ensure actionMapIfTrue MakeRefreshVisible
comp: Details.Refresh
visibilityAction: visible
visibilityActionOn: field
ensure actionMapIfFalse MakeRefreshInvisible
comp: Details.Refresh
visibilityAction: invisible
visibilityActionOn: field