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

ActionField1835

Beschrijving: Change status stock count and stock count lines to Finished. Custom: Nee

Propertiesbewerken

Property Type Accessor
StockCount StockCount Root

XMLbewerken

<Workflow Name="ActionField1835" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Change status stock count and stock count lines to Finished.</Description>
	<Properties>
		<Property	Name="StockCount"			Type="StockCount"			Accessor="Root"		Direction="In" />

		<Property	Name="CountStockCountLines"	Type="Int64"				Accessor="Internal" />
		<Property	Name="StockCountLines"		Type="List[StockCountLine]"	Accessor="Internal" />
		<Property	Name="UpdateQuantityZero"	Type="RequestResult"		Accessor="Internal"						Default="No" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="StockCount is not Active" Condition="${StockCount.Status} == StockCountStatus.Active" MessageCode="3832">
			<Parameter	Name="StockCount"	Direction="In"		Value="${StockCount}" />
		</Validation>

		<Transaction>
			<GetCount Name="Get Lines" Type="StockCountLine" OutputProperty="${CountStockCountLines}">
				<Filters>
					<PropertyFilter	PropertyName="Id.StockCount"	Operator="="		PropertyValue="${StockCount}" />
					<PropertyFilter	PropertyName="Status"			Operator="="		PropertyValue="StockCountLineStatus.Active" />
					<PropertyFilter	PropertyName="Quantity"			Operator="="		PropertyValue="0" />
				</Filters>
			</GetCount>
		</Transaction>

		<When Name="Lines with quantity 0" Condition="${CountStockCountLines} &gt; 0">
			<Question Name="Update lines with quantity 0?" Type="YesNoCancel" MessageCode="3830" OutputProperty="${UpdateQuantityZero}">
				<Parameter	Name="CountStockCountLines"	Direction="In"		Value="${CountStockCountLines}" />
				<Parameter	Name="StockCount"			Direction="In"		Value="${StockCount}" />
			</Question>
		</When>

		<When Name="UpdateQuantityZero" Condition="${UpdateQuantityZero} == Cancel">
			<Stop Name="Stop" Mode="Abort" />
		</When>

		<Transaction>
			<GetList Name="Get StockCountLines" Type="StockCountLine" OutputProperty="${StockCountLines}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="Id.StockCount"	Operator="="		PropertyValue="${StockCount}" />
					<PropertyFilter	PropertyName="Status"			Operator="="		PropertyValue="StockCountLineStatus.Active" />
				</Filters>
			</GetList>

			<ForEach Name="For each StockCountLine" In="${StockCountLines}" As="StockCountLine">
				<Choose Name="UpdateQuantityZero">
					<When Name="UpdateQuantityZero No" Condition="${UpdateQuantityZero} == No &amp;&amp; ${StockCountLine.Quantity} != 0">
						<ChangeStatus Name="set StockCountLine to finished" DomainObject="${StockCountLine}" NewStatus="StockCountLineStatus.Finished" />
					</When>


					<When Name="UpdateQuantityZero Yes" Condition="${UpdateQuantityZero} == Yes">
						<ChangeStatus Name="set StockCountLine to finished" DomainObject="${StockCountLine}" NewStatus="StockCountLineStatus.Finished" />
					</When>
				</Choose>
			</ForEach>
		</Transaction>

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