Categorie: reference Bijgewerkt: 2026-04-08 actionfield workflow actionfield1820

ActionField1820

Beschrijving: Mail FieldSafetyNotice to department, employee(s) or vendor. Custom: Nee

Propertiesbewerken

Property Type Accessor
FieldSafetyNotice FieldSafetyNotice Root
EmailTemplateCodeDepartment UltimoString Optional
EmailTemplateCodeEmployee UltimoString Optional
EmailTemplateCodeEmployees UltimoString Optional
EmailTemplateCodeVendor UltimoString Optional
EmailTemplateCodeVendorContacts UltimoString Optional
EmployeeContext Context Optional
EmployeeSqlFilter String Optional
GotoMailScreen Boolean Optional
ShowDepartments Boolean Optional
ShowEmployee Boolean Optional
ShowEmployees Boolean Optional
ShowVendor Boolean Optional
ShowVendorContact Boolean Optional
TitleCode String Optional

XMLbewerken

<Workflow Name="ActionField1820" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Mail FieldSafetyNotice to department, employee(s) or vendor.</Description>
	<Properties>
		<Property	Name="FieldSafetyNotice"				Type="FieldSafetyNotice"				Accessor="Root"		Direction="In" />

		<Property	Name="EmailTemplateCodeDepartment"		Type="UltimoString"						Accessor="Optional"	Direction="In"		Default="00000000094"																Comment="Use this email template for email to departments" />
		<Property	Name="EmailTemplateCodeEmployee"		Type="UltimoString"						Accessor="Optional"	Direction="In"		Default="00000000094"																Comment="Use this email template for email to employees" />
		<Property	Name="EmailTemplateCodeEmployees"		Type="UltimoString"						Accessor="Optional"	Direction="In"		Default="00000000094"																Comment="Use this email template for email to employee" />
		<Property	Name="EmailTemplateCodeVendor"			Type="UltimoString"						Accessor="Optional"	Direction="In"		Default="00000000094"																Comment="Use this email template for email to employee" />
		<Property	Name="EmailTemplateCodeVendorContacts"	Type="UltimoString"						Accessor="Optional"	Direction="In"		Default="00000000094"																Comment="Use this email template for email to employee" />
		<Property	Name="EmployeeContext"					Type="Context"							Accessor="Optional"	Direction="In"		Default="EmployeeContext.Standard"													Comment="Used in dialog title" />
		<Property	Name="EmployeeSqlFilter"				Type="String"							Accessor="Optional"	Direction="In"		Default="EmpRecStatus &gt;= 0 AND EmpContext IN(1) AND EmpEmailAddress is not null"	Comment="Use this filter for selecting internal employees" />
		<Property	Name="GotoMailScreen"					Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Open the screen with the created Email" />
		<Property	Name="ShowDepartments"					Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Show send email to SkillCategory in dialog" />
		<Property	Name="ShowEmployee"						Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Show send email to Executor in dialog" />
		<Property	Name="ShowEmployees"					Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Show send email to reporter in dialog" />
		<Property	Name="ShowVendor"						Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Show send email to vendor in dialog" />
		<Property	Name="ShowVendorContact"				Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"																		Comment="Show send email to contact of vendor in dialog" />
		<Property	Name="TitleCode"						Type="String"							Accessor="Optional"	Direction="In"		Default="CHOOSEVENDORCONTACTS"														Comment="Labelcode for the dialog vendorcontacts" />

		<Property	Name="BCCEmailsString"					Type="String"							Accessor="Internal"						Default="Empty" />
		<Property	Name="EmailTemplateCode"				Type="UltimoString"						Accessor="Internal" />
		<Property	Name="Employee"							Type="Employee"							Accessor="Internal" />
		<Property	Name="EmployeeForEmail"					Type="Employee"							Accessor="Internal"						Default="Empty" />
		<Property	Name="FieldSafetyNotices"				Type="List[FieldSafetyNotice]"			Accessor="Internal" />
		<Property	Name="ObjectFieldSafetyNoticeList"		Type="List[ObjectFieldSafetyNotice]"	Accessor="Internal" />
		<Property	Name="Receiver"							Type="Int32"							Accessor="Internal"						Default="3" />
		<Property	Name="ReceiverEntity"					Type="DomainObject"						Accessor="Internal" />
		<Property	Name="SetToEmailAddressEmpty"			Type="Boolean"							Accessor="Internal"						Default="False"																		Comment="Put the main email address in the bcc when an email is sent to multiple recipient (privacy)" />
		<Property	Name="ToEmailString"					Type="String"							Accessor="Internal"						Default="Empty" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="Email cannot be sent for FieldSafetyNotice with status Created" Condition="${FieldSafetyNotice.Status} != FieldSafetyNoticeStatus.Created" MessageCode="3781">
			<Parameter	Name="FieldSafetyNotice"	Direction="In"		Value="${FieldSafetyNotice}" />
		</Validation>

		<When Name="ShowVendor is false set also ShowVendorContact false" Condition="${ShowVendor} == False">
			<Assign Name="Set ShowVendorContact false" Property="${ShowVendorContact}" Value="False" />
		</When>

		<WorkflowCall Name="Dialog_FieldSafetyNotice_SelectReceiverEmail" WorkflowName="Dialog_FieldSafetyNotice_SelectReceiverEmail">
			<Parameter	Name="EmployeeContext"		Direction="In"		Value="${EmployeeContext}" />
			<Parameter	Name="EmployeeSqlFilter"	Direction="In"		Value="${EmployeeSqlFilter}" />
			<Parameter	Name="FieldSafetyNotice"	Direction="In"		Value="${FieldSafetyNotice}" />
			<Parameter	Name="ShowDepartments"		Direction="In"		Value="${ShowDepartments}" />
			<Parameter	Name="ShowEmployee"			Direction="In"		Value="${ShowEmployee}" />
			<Parameter	Name="ShowEmployees"		Direction="In"		Value="${ShowEmployees}" />
			<Parameter	Name="ShowVendor"			Direction="In"		Value="${ShowVendor}" />
			<Parameter	Name="ShowVendorContact"	Direction="In"		Value="${ShowVendorContact}" />
			<Parameter	Name="Employee"				Direction="Out"										OutputProperty="${Employee}" />
			<Parameter	Name="Receiver"				Direction="Out"										OutputProperty="${Receiver}" />
		</WorkflowCall>

		<Choose Name="CheckEmailAddress">
			<When Name="Departments" Condition="${Receiver} == 1">
				<Transaction>
					<GetList Name="Get ObjectFieldSafetyNotice" Type="ObjectFieldSafetyNotice" OutputProperty="${ObjectFieldSafetyNoticeList}" OrderBy="Id" OrderDirection="Ascending">
						<Filters>
							<PropertyFilter	PropertyName="Context"				Operator="="		PropertyValue="ObjectFieldSafetyNoticeContext.Department" />
							<PropertyFilter	PropertyName="FieldSafetyNotice"	Operator="="		PropertyValue="${FieldSafetyNotice}" />
						</Filters>
					</GetList>
				</Transaction>

				<Assign Name="EmailTemplateCode" Property="${EmailTemplateCode}" Value="${EmailTemplateCodeDepartment}" />
				<Assign Name="SetToEmailAddressEmpty" Property="${SetToEmailAddressEmpty}" Value="True" />

				<ForEach Name="Loop ObjectFieldSafetyNotice" In="${ObjectFieldSafetyNoticeList}" As="ObjectFieldSafetyNotice">
					<When Name="Add separator" Condition="${BCCEmailsString} != Empty">
						<Assign Name="Add separator" Property="${BCCEmailsString}" Value="=#concat(${BCCEmailsString}, ',')" />
					</When>

					<Assign Name="Add email" Property="${BCCEmailsString}" Value="=#concat(${BCCEmailsString}, ${ObjectFieldSafetyNotice.Department.EmailAddress})" />

					<When Name="Department has an EmailAddress" Condition="${ReceiverEntity} == Empty &amp;&amp; ${ObjectFieldSafetyNotice.Department.EmailAddress?} != Empty">
						<Assign Name="ReceiverEntity" Property="${ReceiverEntity}" Value="${ObjectFieldSafetyNotice.Department}" />
					</When>
				</ForEach>
			</When>


			<When Name="Employees" Condition="${Receiver} == 2">
				<Transaction>
					<GetList Name="Get ObjectFieldSafetyNotice" Type="ObjectFieldSafetyNotice" OutputProperty="${ObjectFieldSafetyNoticeList}" OrderBy="Id" OrderDirection="Ascending">
						<Filters>
							<PropertyFilter	PropertyName="Context"				Operator="="		PropertyValue="ObjectFieldSafetyNoticeContext.Employee" />
							<PropertyFilter	PropertyName="FieldSafetyNotice"	Operator="="		PropertyValue="${FieldSafetyNotice}" />
						</Filters>
					</GetList>
				</Transaction>

				<Assign Name="EmailTemplateCode" Property="${EmailTemplateCode}" Value="${EmailTemplateCodeEmployees}" />
				<Assign Name="SetToEmailAddressEmpty" Property="${SetToEmailAddressEmpty}" Value="True" />

				<ForEach Name="Loop ObjectFieldSafetyNotice" In="${ObjectFieldSafetyNoticeList}" As="ObjectFieldSafetyNotice">
					<When Name="Add separator" Condition="${BCCEmailsString} != Empty">
						<Assign Name="Add separator" Property="${BCCEmailsString}" Value="=#concat(${BCCEmailsString}, ',')" />
					</When>

					<Assign Name="Add email" Property="${BCCEmailsString}" Value="=#concat(${BCCEmailsString}, ${ObjectFieldSafetyNotice.Employee.EmailAddress})" />

					<When Name="Employee has an EmailAddress" Condition="${ReceiverEntity} == Empty &amp;&amp; ${ObjectFieldSafetyNotice.Employee.EmailAddress?} != Empty">
						<Assign Name="ReceiverEntity" Property="${ReceiverEntity}" Value="${ObjectFieldSafetyNotice.Employee}" />
					</When>
				</ForEach>
			</When>


			<When Name="Employee" Condition="${Receiver} == 3">
				<Assign Name="ReceiverEntity" Property="${ReceiverEntity}" Value="${Employee}" />
				<Assign Name="EmailTemplateCode" Property="${EmailTemplateCode}" Value="${EmailTemplateCodeEmployee}" />
				<Assign Name="Set Employee" Property="${EmployeeForEmail}" Value="${Employee}" />
			</When>


			<When Name="Vendor" Condition="${Receiver} == 4">
				<Validation Name="ValidateVendorEmailAddress" Condition="${FieldSafetyNotice.Vendor.EmailAddress} != Empty" MessageCode="1120">
					<Parameter	Name="Vendor"	Direction="In"		Value="${FieldSafetyNotice.Vendor}" />
				</Validation>

				<Assign Name="ReceiverEntity" Property="${ReceiverEntity}" Value="${FieldSafetyNotice.Vendor}" />
				<Assign Name="EmailTemplateCode" Property="${EmailTemplateCode}" Value="${EmailTemplateCodeVendor}" />
			</When>


			<When Name="VendorContact" Condition="${Receiver} == 5">
				<WorkflowCall Name="FieldSafetyNotice_VendorContracts" WorkflowName="FieldSafetyNotice_VendorContracts">
					<Parameter	Name="FieldSafetyNotice"	Direction="In"		Value="${FieldSafetyNotice}" />
					<Parameter	Name="TitleCode"			Direction="In"		Value="${TitleCode}" />
					<Parameter	Name="EmployeeForEmail"		Direction="Out"										OutputProperty="${EmployeeForEmail}" />
					<Parameter	Name="ReceiverEntity"		Direction="Out"										OutputProperty="${ReceiverEntity}" />
					<Parameter	Name="ToEmailString"		Direction="Out"										OutputProperty="${ToEmailString}" />
				</WorkflowCall>

				<Assign Name="EmailTemplateCode" Property="${EmailTemplateCode}" Value="${EmailTemplateCodeVendorContacts}" />
			</When>
		</Choose>

		<AddToList Name="Add FieldSafetyNotice to list" List="${FieldSafetyNotices}" Item="${FieldSafetyNotice}" />

		<WorkflowCall Name="FieldSafetyNotice_SendEmail" WorkflowName="FieldSafetyNotice_SendEmail">
			<Parameter	Name="BCCEmailString"			Direction="In"		Value="${BCCEmailsString}" />
			<Parameter	Name="EmailTemplateCode"		Direction="In"		Value="${EmailTemplateCode}" />
			<Parameter	Name="Employee"					Direction="In"		Value="${EmployeeForEmail}" />
			<Parameter	Name="FieldSafetyNotice"		Direction="In"		Value="${FieldSafetyNotice}" />
			<Parameter	Name="GotoMailScreen"			Direction="In"		Value="${GotoMailScreen}" />
			<Parameter	Name="ReceiverEntity"			Direction="In"		Value="${ReceiverEntity}" />
			<Parameter	Name="RelatedSubjects"			Direction="In"		Value="${FieldSafetyNotices}" />
			<Parameter	Name="SetToEmailAddressEmpty"	Direction="In"		Value="${SetToEmailAddressEmpty}" />
			<Parameter	Name="ToEmailString"			Direction="In"		Value="${ToEmailString}" />
		</WorkflowCall>

		<UserContent Name="Post" />
	</Execution>
</Workflow>