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

ActionField242

Beschrijving: Create an ExchangePart for this Article. Custom: Nee

Propertiesbewerken

Property Type Accessor
Article Article Root
AllowBookBeforePreviousYear Boolean Optional
AllowBookInPreviousYear Boolean Optional
CostCenterContext Context Optional
CreateAsEquipment Boolean Optional
DepartmentContext Context Optional
DialogCaption String Optional
DialogExchangePartLabelCaption String Optional
DialogExchangePartLongLabelCaption String Optional
EquipmentContext Context Optional
FormName UltimoString Optional
NewEquipmentStatus Status Optional
ShowExtended Boolean Optional
WarehouseContext Context Optional
WarehouseServeOutContext Context Optional
CreatedEquipment Equipment Optional

XMLbewerken

<Workflow Name="ActionField242" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create an ExchangePart for this Article.</Description>
	<Properties>
		<Property	Name="Article"											Type="Article"							Accessor="Root"		Direction="In" />

		<Property	Name="AllowBookBeforePreviousYear"						Type="Boolean"							Accessor="Optional"	Direction="In"													Comment="Not in use" />
		<Property	Name="AllowBookInPreviousYear"							Type="Boolean"							Accessor="Optional"	Direction="In"													Comment="Not in use" />
		<Property	Name="CostCenterContext"								Type="Context"							Accessor="Optional"	Direction="In"		Default="CostCenterContext.Standard"		Comment="Only select CostCenters with this context" />
		<Property	Name="CreateAsEquipment"								Type="Boolean"							Accessor="Optional"	Direction="In"													Comment="When CreateAsEquipment is true, an Equipment will be created" />
		<Property	Name="DepartmentContext"								Type="Context"							Accessor="Optional"	Direction="In"		Default="DepartmentContext.Standard"		Comment="Only select Departments with this context" />
		<Property	Name="DialogCaption"									Type="String"							Accessor="Optional"	Direction="In"													Comment="Caption of the ArticleToExchangePartDialog" />
		<Property	Name="DialogExchangePartLabelCaption"					Type="String"							Accessor="Optional"	Direction="In"													Comment="Not in use" />
		<Property	Name="DialogExchangePartLongLabelCaption"				Type="String"							Accessor="Optional"	Direction="In"													Comment="Label of Equipment on the ArticleToExchangePartDialog" />
		<Property	Name="EquipmentContext"									Type="Context"							Accessor="Optional"	Direction="In"		Default="EquipmentContext.Installation"		Comment="Equipment Context used for determining if feature toggle is enabled and in messages and labels" />
		<Property	Name="FormName"											Type="UltimoString"						Accessor="Optional"	Direction="In"													Comment="Open this screen with the crated Equipment/ExchangePart" />
		<Property	Name="NewEquipmentStatus"								Type="Status"							Accessor="Optional"	Direction="In"		Default="EquipmentStatus.ExchangeUsable"	Comment="Create the Equipment/ExchangePart with this status." />
		<Property	Name="ShowExtended"										Type="Boolean"							Accessor="Optional"	Direction="In"		Default="True"								Comment="When set to true, the cost carriers are shown in the dialog. Default true" />
		<Property	Name="WarehouseContext"									Type="Context"							Accessor="Optional"	Direction="In"		Default="WarehouseContext.Standard"			Comment="Warehouse Context used for label on dialog" />
		<Property	Name="WarehouseServeOutContext"							Type="Context"							Accessor="Optional"	Direction="In"		Default="WarehouseServeOutContext.Standard"	Comment="Create WarehouseServeOutContext with this context" />

		<Property	Name="CreatedEquipment"									Type="Equipment"						Accessor="Optional"	Direction="Out" />

		<Property	Name="ArticleWarehouseLocation"							Type="ArticleWarehouseLocation"			Accessor="Internal" />
		<Property	Name="ArticleWarehouseLocations"						Type="List[ArticleWarehouseLocation]"	Accessor="Internal" />
		<Property	Name="ArticleWarehousesCount"							Type="Int64"							Accessor="Internal" />
		<Property	Name="BatchWarehouseLocation"							Type="BatchWarehouseLocation"			Accessor="Internal" />
		<Property	Name="BatchWarehouseLocations"							Type="List[BatchWarehouseLocation]"		Accessor="Internal" />
		<Property	Name="CostCenter"										Type="CostCenter"						Accessor="Internal" />
		<Property	Name="Department"										Type="Department"						Accessor="Internal" />
		<Property	Name="Equipment"										Type="Equipment"						Accessor="Internal" />
		<Property	Name="EquipmentContexts"								Type="List[Context]"					Accessor="Internal" />
		<Property	Name="EquipmentIsFeatureToggleProgressStatusEnabled"	Type="Boolean"							Accessor="Internal" />
		<Property	Name="ExchangePart"										Type="Boolean"							Accessor="Internal"						Default="=(${CreateAsEquipment} == False)" />
		<Property	Name="NewEquipmentId"									Type="String"							Accessor="Internal"																	Comment="When CreateAsEquipment is true, an equipment will be created. The application setting ExchPartUseEqmIdAutoKey is used to generate a key or ask the user for a key." />
		<Property	Name="QuantityDifference"								Type="Decimal"							Accessor="Internal" />
		<Property	Name="Warehouse"										Type="Warehouse"						Accessor="Internal" />
		<Property	Name="Warehouses"										Type="List[Warehouse]"					Accessor="Internal" />
		<Property	Name="WarehouseServeOut"								Type="WarehouseServeOut"				Accessor="Internal" />
		<Property	Name="WarehouseServeOutline"							Type="WarehouseServeOutline"			Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<AddToList Name="EquipmentContext" List="${EquipmentContexts}" Item="${EquipmentContext}" />

		<Command Name="Equipment_IsFeatureToggleProgressStatusEnabled" CommandName="Equipment_IsFeatureToggleProgressStatusEnabled">
			<Parameter	Name="Contexts"					Direction="In"		Value="${EquipmentContexts}" />
			<Parameter	Name="FeatureToggleIsEnabled"	Direction="Out"										OutputProperty="${EquipmentIsFeatureToggleProgressStatusEnabled}" />
		</Command>

		<When Name="When feature toggle for progress status on Equipment is enabled" Condition="${EquipmentIsFeatureToggleProgressStatusEnabled} == True">
			<Assign Name="Set NewEquipmentStatus to Created" Property="${NewEquipmentStatus}" Value="EquipmentStatus.Created" />
		</When>

		<Transaction>
			<Command Name="Check configuration to successfully create an exchange part for the article" CommandName="ArticleCreateExchangePart_CheckConfiguration">
				<Parameter	Name="Article"				Direction="In"		Value="${Article}" />
				<Parameter	Name="CreateAsEquipment"	Direction="In"		Value="${CreateAsEquipment}" />
				<Parameter	Name="EquipmentContext"		Direction="In"		Value="${EquipmentContext}" />
			</Command>

			<Comment><![CDATA[Check wether this is an article with an inventory method. 
							If so only show warehouses with stock ordered for the inventory method]]></Comment>

			<Choose Name="InventoryMethod">
				<When Name="Inventory method used" Condition="${Article.InventoryMethod} != Empty">
					<Comment><![CDATA[Department and costcenter needed for warehouse serve out line]]></Comment>

					<Assign Name="Set ShowExtended" Property="${ShowExtended}" Value="True" />

					<Command Name="Article_FindBatchWarehouseLocations" CommandName="Article_FindBatchWarehouseLocations">
						<Parameter	Name="Article"									Direction="In"		Value="${Article}" />
						<Parameter	Name="IssueLocation"							Direction="In"		Value="True" />
						<Parameter	Name="Quantity"									Direction="In"		Value="1" />
						<Parameter	Name="UseAllAvailableBatchWarehouseLocations"	Direction="In"		Value="${Article.DeviateFromInventoryMethod}" />
						<Parameter	Name="UseAllWarehouses"							Direction="In"		Value="True" />
						<Parameter	Name="BatchWarehouseLocations"					Direction="Out"														OutputProperty="${BatchWarehouseLocations}" />
						<Parameter	Name="Warehouses"								Direction="Out"														OutputProperty="${Warehouses}" />
					</Command>

					<Validation Name="Validate if warehouse(location)s were found" Condition="${Warehouses.Count} &gt; 0" MessageCode="2108">
						<Parameter	Name="Article"			Direction="In"		Value="${Article}" />
						<Parameter	Name="EquipmentContext"	Direction="In"		Value="${EquipmentContext}" />
						<Parameter	Name="ExchangePart"		Direction="In"		Value="${ExchangePart}" />
					</Validation>
				</When>

				<Otherwise Name="No inventory method">
					<GetCount Name="Search warehouses for this article" Type="ArticleWarehouse" OutputProperty="${ArticleWarehousesCount}">
						<Filters>
							<PropertyFilter	PropertyName="Id.Article"	Operator="="		PropertyValue="${Article}" />
						</Filters>
					</GetCount>

					<Validation Name="Validate if warehouses were found" Condition="${ArticleWarehousesCount} &gt; 0" MessageCode="1417">
						<Parameter	Name="Article"			Direction="In"		Value="${Article}" />
						<Parameter	Name="EquipmentContext"	Direction="In"		Value="${EquipmentContext}" />
						<Parameter	Name="ExchangePart"		Direction="In"		Value="${ExchangePart}" />
					</Validation>

					<GetList Name="GetArticleWarehouseLocations" Type="ArticleWarehouseLocation" OutputProperty="${ArticleWarehouseLocations}" OrderBy="DefaultIssueLocation" OrderDirection="Descending">
						<Joins>
							<Join	Name="Id.WarehouseLocation"	Alias="whsl"	Type="InnerJoin" />
						</Joins>
						<Filters>
							<PropertyFilter	PropertyName="Id.Article"			Operator="="		PropertyValue="${Article}" />
							<PropertyFilter	PropertyName="whsl.IssueLocation"	Operator="="		PropertyValue="True" />
						</Filters>
					</GetList>

					<Validation Name="Validate if ArticleWarehouseLocations were found" Condition="${ArticleWarehouseLocations.Count} &gt; 0" MessageCode="2311">
						<Parameter	Name="Article"			Direction="In"		Value="${Article}" />
						<Parameter	Name="EquipmentContext"	Direction="In"		Value="${EquipmentContext}" />
						<Parameter	Name="ExchangePart"		Direction="In"		Value="${ExchangePart}" />
					</Validation>

					<Comment><![CDATA[get warehouses for which een articlewarehouse exists for this article]]></Comment>

					<GetList Name="Warehouses" Type="Warehouse" OutputProperty="${Warehouses}" OrderBy="Description" OrderDirection="Ascending">
						<Filters>
							<InFilter PropertyName="Id">
								<Subquery Type="ArticleWarehouse">
									<Filters>
										<PropertyFilter	PropertyName="Id.Article"	Operator="="		PropertyValue="${Article}" />
									</Filters>
									<Properties>
										<Property Name="Id.Warehouse" Alias="whsid" Type="Property" />
									</Properties>
								</Subquery>
							</InFilter>
							<InFilter PropertyName="Id">
								<Subquery Type="ArticleWarehouseLocation">
									<Joins>
										<Join	Name="Id.WarehouseLocation"	Alias="whsl"	Type="InnerJoin" />
									</Joins>
									<Filters>
										<PropertyFilter	PropertyName="Id.Article"			Operator="="		PropertyValue="${Article}" />
										<PropertyFilter	PropertyName="whsl.IssueLocation"	Operator="="		PropertyValue="True" />
									</Filters>
									<Properties>
										<Property Name="whsl.Id.Warehouse" Alias="whslWhsid" Type="Property" />
									</Properties>
								</Subquery>
							</InFilter>
						</Filters>
					</GetList>
				</Otherwise>
			</Choose>
		</Transaction>

		<WorkflowCall Name="Dialog_ArticleToExchangePartDialog" WorkflowName="Dialog_ArticleToExchangePartDialog">
			<Parameter	Name="Article"						Direction="In"		Value="${Article}" />
			<Parameter	Name="ArticleWarehouseLocations"	Direction="In"		Value="${ArticleWarehouseLocations}" />
			<Parameter	Name="BatchWarehouseLocations"		Direction="In"		Value="${BatchWarehouseLocations}" />
			<Parameter	Name="Caption"						Direction="In"		Value="${DialogCaption}" />
			<Parameter	Name="CostCenterContext"			Direction="In"		Value="${CostCenterContext}" />
			<Parameter	Name="DepartmentContext"			Direction="In"		Value="${DepartmentContext}" />
			<Parameter	Name="EquipmentContext"				Direction="In"		Value="${EquipmentContext}" />
			<Parameter	Name="ExchangePart"					Direction="In"		Value="${ExchangePart}" />
			<Parameter	Name="ExchangePartLabelCaption"		Direction="In"		Value="${DialogExchangePartLabelCaption}" />
			<Parameter	Name="ExchangePartLongLabelCaption"	Direction="In"		Value="${DialogExchangePartLongLabelCaption}" />
			<Parameter	Name="ShowExtended"					Direction="In"		Value="${ShowExtended}" />
			<Parameter	Name="WarehouseContext"				Direction="In"		Value="${WarehouseContext}" />
			<Parameter	Name="Warehouses"					Direction="In"		Value="${Warehouses}" />
			<Parameter	Name="ArticleWarehouseLocation"		Direction="Out"														OutputProperty="${ArticleWarehouseLocation}" />
			<Parameter	Name="BatchWarehouseLocation"		Direction="Out"														OutputProperty="${BatchWarehouseLocation}" />
			<Parameter	Name="CostCenter"					Direction="Out"														OutputProperty="${CostCenter}" />
			<Parameter	Name="Department"					Direction="Out"														OutputProperty="${Department}" />
			<Parameter	Name="NewEquipmentId"				Direction="Out"														OutputProperty="${NewEquipmentId}" />
			<Parameter	Name="Warehouse"					Direction="Out"														OutputProperty="${Warehouse}" />
		</WorkflowCall>

		<Transaction>
			<Command Name="Article_CreateExchangePart" CommandName="Article_CreateExchangePart">
				<Parameter	Name="Article"				Direction="In"		Value="${Article}" />
				<Parameter	Name="CostCenter"			Direction="In"		Value="${CostCenter}" />
				<Parameter	Name="CreateAsEquipment"	Direction="In"		Value="${CreateAsEquipment}" />
				<Parameter	Name="Department"			Direction="In"		Value="${Department}" />
				<Parameter	Name="EquipmentContext"		Direction="In"		Value="${EquipmentContext}" />
				<Parameter	Name="EquipmentStatus"		Direction="In"		Value="${NewEquipmentStatus}" />
				<Parameter	Name="NewEquipmentId"		Direction="In"		Value="${NewEquipmentId}" />
				<Parameter	Name="Warehouse"			Direction="In"		Value="${Warehouse}" />
				<Parameter	Name="Equipment"			Direction="Out"										OutputProperty="${CreatedEquipment}" />
			</Command>

			<When Name="CreateWarehouseServeOut" Condition="${ShowExtended} == True || ${BatchWarehouseLocation} != Empty || ${ArticleWarehouseLocation} != Empty">
				<Insert Name="Create WarehouseServeOut" ObjectType="WarehouseServeOut" OutputProperty="${WarehouseServeOut}">
					<Parameter	Name="Context"		Direction="In"		Value="${WarehouseServeOutContext}" />
					<Parameter	Name="Status"		Direction="In"		Value="WarehouseServeOutStatus.Created" />
					<Parameter	Name="BookDate"		Direction="In"		Value="#{Environment.CurrentDate}" />
					<Parameter	Name="CostCenter"	Direction="In"		Value="${CostCenter}" />
					<Parameter	Name="Department"	Direction="In"		Value="${Department}" />
					<Parameter	Name="Site"			Direction="In"		Value="${Warehouse.Site}" />
					<Parameter	Name="Type"			Direction="In"		Value="Warehouse" />
					<Parameter	Name="Warehouse"	Direction="In"		Value="${Warehouse}" />
				</Insert>

				<Insert Name="Create WarehouseServeOutline" ObjectType="WarehouseServeOutline" OutputProperty="${WarehouseServeOutline}">
					<Parameter	Name="Id.WarehouseServeOut"	Direction="In"		Value="${WarehouseServeOut}" />
					<Parameter	Name="Status"				Direction="In"		Value="WarehouseServeOutlineStatus.Created" />
					<Parameter	Name="Article"				Direction="In"		Value="${Article}" />
					<Parameter	Name="QuantityOut"			Direction="In"		Value="1" />
				</Insert>

				<When Name="We have a BatchWarehouseLocation" Condition="${BatchWarehouseLocation} != Empty">
					<Assign Name="Set Batch" Property="${CreatedEquipment.Batch}" Value="${BatchWarehouseLocation.Id.Batch}" />

					<Command Name="DomainObject_CreateObjectBatch" CommandName="DomainObject_CreateObjectBatch">
						<Parameter	Name="BatchWarehouseLocation"	Direction="In"		Value="${BatchWarehouseLocation}" />
						<Parameter	Name="DomainObject"				Direction="In"		Value="${WarehouseServeOutline}" />
						<Parameter	Name="Quantity"					Direction="In"		Value="${WarehouseServeOutline.QuantityOut}" />
					</Command>

					<Assign Name="Vendor" Property="${CreatedEquipment.Vendor}" Value="${BatchWarehouseLocation.Id.Batch.Vendor}" />
				</When>

				<When Name="We have an ArticleWarehouseLocation" Condition="${ArticleWarehouseLocation} != Empty">
					<Assign Name="${WarehouseServeOutline}" Property="${WarehouseServeOutline.WarehouseLocation}" Value="${ArticleWarehouseLocation.Id.WarehouseLocation}" />
				</When>

				<AddToList Name="Add WarehouseServeOutline to WarehouseServeOut.Lines" List="${WarehouseServeOut.Lines}" Item="${WarehouseServeOutline}" />

				<ChangeStatus Name="WarehouseServeOut Approve" DomainObject="${WarehouseServeOut}" NewStatus="WarehouseServeOutStatus.Approved" />
			</When>
		</Transaction>

		<UserContent Name="Post" />

		<View Name="OpenScreen" ViewName="DataEntryScreen">
			<Parameter	Name="DomainObject"			Direction="In"		Value="${CreatedEquipment}" />
			<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${CreatedEquipment.Description} == Empty" />
			<Parameter	Name="ScreenName"			Direction="In"		Value="${FormName}" />
		</View>
	</Execution>
</Workflow>