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

ActionField1894

Beschrijving: Cancel a Purchase. Custom: Nee

Propertiesbewerken

Property Type Accessor
Purchase Purchase Root

XMLbewerken

<Workflow Name="ActionField1894" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Cancel a Purchase.</Description>
	<Properties>
		<Property	Name="Purchase"			Type="Purchase"	Accessor="Root"		Direction="In" />

		<Property	Name="ApprovalCount"	Type="Int64"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<When Name="Only if the ummSetting UseApprovalLevelsForPurchaseOrders is True" Condition="#applicationelementenabled('d38b035e-6d67-4071-b9f8-244426c2d12d') == True &amp;&amp; #{UltimoSettings.UseApprovalLevelsForPurchaseOrders} == True &amp;&amp; ${Purchase.Status} != PurchaseStatus.Approved">
				<GetCount Name="Approval Count" Type="Approval" OutputProperty="${ApprovalCount}">
					<Filters>
						<PropertyFilter	PropertyName="Purchase"	Operator="="		PropertyValue="${Purchase}" />
					</Filters>
				</GetCount>

				<Validation Name="There are approvals" Condition="${ApprovalCount} == 0" MessageCode="3934">
					<Parameter	Name="ApprovalCount"	Direction="In"		Value="${ApprovalCount}" />
					<Parameter	Name="Purchase"			Direction="In"		Value="${Purchase}" />
				</Validation>
			</When>

			<ChangeStatus Name="Change status to Canceled" DomainObject="${Purchase}" NewStatus="PurchaseStatus.Canceled" />
		</Transaction>

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