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

ActionField1064

Beschrijving: Validate if Site on PurchaseRequest can be changed and restore from PurchaseRequestLine if needed. Custom: Nee

Propertiesbewerken

Property Type Accessor
PurchaseRequest PurchaseRequest Root

XMLbewerken

<Workflow Name="ActionField1064" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Validate if Site on PurchaseRequest can be changed and restore from PurchaseRequestLine if needed.</Description>
	<Properties>
		<Property	Name="PurchaseRequest"		Type="PurchaseRequest"				Accessor="Root"		Direction="In" />

		<Property	Name="NonMatchingSiteFound"	Type="Boolean"						Accessor="Internal"						Default="False"	Comment="Used to abort ForEach when non-matching site found" />
		<Property	Name="PurchaseRequestLines"	Type="List[PurchaseRequestLine]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetList Name="Get lines with status approved or beyond" Type="PurchaseRequestLine" OutputProperty="${PurchaseRequestLines}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="PurchaseRequest"	Operator="="		PropertyValue="${PurchaseRequest}" />
					<InFilter PropertyName="Status" Values="PurchaseRequestLineStatus.Approved,PurchaseRequestLineStatus.PartiallyDelivered,PurchaseRequestLineStatus.Delivered" />
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="Check each line" In="${PurchaseRequestLines}" As="PurchaseRequestLine" Condition="${NonMatchingSiteFound} == False">
			<When Name="When site on request does not match site on line" Condition="${PurchaseRequest.Site} != ${PurchaseRequestLine.Site}">
				<Message Name="MessageSitesAreNotIdentical" MessageCode="2068">
					<Parameter	Name="PurchaseRequest"		Direction="In"		Value="${PurchaseRequest}" />
					<Parameter	Name="PurchaseRequestLine"	Direction="In"		Value="${PurchaseRequestLine}" />
				</Message>

				<Transaction>
					<Assign Name="Restore correct site to request" Property="${PurchaseRequest.Site}" Value="${PurchaseRequestLine.Site}" />
					<Assign Name="Set flag to abort ForEach" Property="${NonMatchingSiteFound}" Value="True" />
				</Transaction>
			</When>
		</ForEach>

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