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

ActionField047

Beschrijving: Create PmJob for PmWorkOrder and open PmJob screen. Custom: Nee

Propertiesbewerken

Property Type Accessor
PmWorkOrder PmWorkOrder Root
FormName UltimoString Optional
PmJobContext Context? Optional

XMLbewerken

<Workflow Name="ActionField047" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create PmJob for PmWorkOrder and open PmJob screen.</Description>
	<Properties>
		<Property	Name="PmWorkOrder"	Type="PmWorkOrder"	Accessor="Root"		Direction="In" />

		<Property	Name="FormName"		Type="UltimoString"	Accessor="Optional"	Direction="In"										Comment="Open this screen when PmJob is created" />
		<Property	Name="PmJobContext"	Type="Context?"		Accessor="Optional"	Direction="In"		Default="PmJobContext.Standard"	Comment="Create the PmJob with this context" />

		<Property	Name="CountPmJobs"	Type="Int64"		Accessor="Internal"						Default="0" />
		<Property	Name="PmJob"		Type="PmJob"		Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<GetCount Name="Count all PmJobs" Type="PmJob" OutputProperty="${CountPmJobs}">
				<Filters>
					<PropertyFilter	PropertyName="Id.PmWorkOrder"	Operator="="		PropertyValue="${PmWorkOrder}" />
					<PropertyFilter	PropertyName="Status"			Operator="&gt;"		PropertyValue="0" />
				</Filters>
			</GetCount>
		</Transaction>

		<When Name="IsNotEmpty" Condition="${PmWorkOrder.ParentPeriodicActivity} == False &amp;&amp; ${PmWorkOrder.IsBulk} == True">
			<Validation Name="CheckIfPmWorkOrderWithBulkHasExactlyOnePoJob" Condition="${CountPmJobs} == 0" MessageCode="1444">
				<Parameter	Name="PmJobContext"	Direction="In"		Value="${PmJobContext}" />
				<Parameter	Name="PmWorkOrder"	Direction="In"		Value="${PmWorkOrder}" />
			</Validation>
		</When>

		<Validation Name="PmWorkOrder Created" Condition="${PmWorkOrder.Status} == PmWorkOrderStatus.Created" MessageCode="1170">
			<Parameter	Name="PmJobContext"	Direction="In"		Value="${PmJobContext}" />
			<Parameter	Name="PmWorkOrder"	Direction="In"		Value="${PmWorkOrder}" />
		</Validation>

		<Transaction>
			<Command Name="PmWorkOrder_CreatePmJob" CommandName="PmWorkOrder_CreatePmJob">
				<Parameter	Name="PmJobContext"	Direction="In"		Value="${PmJobContext}" />
				<Parameter	Name="PmWorkOrder"	Direction="In"		Value="${PmWorkOrder}" />
				<Parameter	Name="PmJob"		Direction="Out"								OutputProperty="${PmJob}" />
			</Command>

			<WorkflowCall Name="Copy operation loss for PmJob" WorkflowName="PmJob_CopyOperationLoss">
				<Parameter	Name="PmJob"	Direction="In"		Value="${PmJob}" />
			</WorkflowCall>
		</Transaction>

		<UserContent Name="Post" />

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