Backend
1. Variables
ensure var VarDateTimeStartActivity kind: dateTime
deploy: fixedOnDeploy
value: "now"
2. EventSheet
ensure spreadsheet: EventSheet
withFields: ["RelatedTo*", "Refresh", "FormMode", "GetEventDetailButton", "RowId",
"Id", "Subject*", "Description", "StartDateTime*", "EndDateTime*", "IsAllDayEvent",
"Location", "AssignedTo", "RelatedToId", "RelatedToValue"]
ofTypes: [pickText, button, text, button, rowId,
text, text, paragraph, dateTime, dateTime, bool,
text, pickText, 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
ensure var VarTextObjectTypeEvent kind: text
deploy: fixedOnDeploy
value: "Event"
ensure var VarMappingEventToSyncDetailInputForm kind: mapping
deploy: fixedOnDeploy
fromForm: EntityEvent
toPlugin: SalesforcePlugin
toForm: SyncDetailInputForm
fieldMappingMap: {
'map': {
'${f:Details.Id}': 'Id',
'${var:VarTextObjectTypeEvent}': 'ObjectType'
}
}
ensure var VarMappingEventDetailToEvent1 kind: mapping
deploy: fixedOnDeploy
fromPlugin: SalesforcePlugin
fromForm: EventDetail
toForm: EntityEvent
fieldMappingMap: {
'map': {
'${f:Details.Subject}': 'Details.Subject',
'${f:Details.Description}': 'Details.Description',
'${f:Details.StartDateTime}': 'Details.StartDateTime',
'${f:Details.EndDateTime}': 'Details.EndDateTime',
'${f:Details.IsAllDayEvent}': 'Details.IsAllDayEvent',
'${f:Details.Location}': 'Details.Location',
'${f:Details.AssignedTo}': 'Details.AssignedTo',
'${f:Details.RelatedTo}': 'Details.RelatedTo'
}
}
ensure var VarMappingEventToRecordIdInputForm2 kind: mapping
deploy: fixedOnDeploy
fromForm: EntityEvent
toPlugin: SalesforcePlugin
toForm: RecordIdInputForm
fieldMappingMap: {
'map': {
'${f:Details.Id}': 'Id'
}
}
ensure form EntityEvent
ensure section: Details
ensure field Refresh
pluginInputMappingVar: VarMappingEventToSyncDetailInputForm
pluginOutputMappingVar: VarMappingEventDetailToEvent1
ensure field GetEventDetailButton
pluginInputMappingVar: VarMappingEventToRecordIdInputForm2
pluginOutputMappingVar: VarMappingEventDetailToEvent1