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

ActionField1636

Beschrijving: Start hours and costs forecast Excel report. Custom: Nee

Propertiesbewerken

Property Type Accessor
PmSchedule PmSchedule Root
ExcelVersion UltimoString Optional
FileName UltimoString Optional
JobContextsToSearch List[Context] Optional
PeriodLimitInYears Int16 Optional
PmWorkOrderContextsToSearch List[Context] Optional
ShowTotalsLeft Boolean Optional

XMLbewerken

<Workflow Name="ActionField1636" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Start hours and costs forecast Excel report.</Description>
	<Properties>
		<Property	Name="PmSchedule"					Type="PmSchedule"		Accessor="Root"		Direction="In" />

		<Property	Name="ExcelVersion"					Type="UltimoString"		Accessor="Optional"	Direction="In"		Default="2016"										Comment="Which excel-version to use (Values: 97to2003, 2007, 2010, 2013 or 2016)" />
		<Property	Name="FileName"						Type="UltimoString"		Accessor="Optional"	Direction="In"		Default="EXPORT\#label(EXPORTFILENAME_FORECAST)"	Comment="Filename of the created excelfile" />
		<Property	Name="JobContextsToSearch"			Type="List[Context]"	Accessor="Optional"	Direction="In"		Default="Empty"										Comment="Find only jobs with these contexts" />
		<Property	Name="PeriodLimitInYears"			Type="Int16"			Accessor="Optional"	Direction="In"		Default="10"										Comment="Period limit in years default 10 years" />
		<Property	Name="PmWorkOrderContextsToSearch"	Type="List[Context]"	Accessor="Optional"	Direction="In"															Comment="Search only PmWorkorders with these contexts default Standard" />
		<Property	Name="ShowTotalsLeft"				Type="Boolean"			Accessor="Optional"	Direction="In"		Default="False"										Comment="When set to True the column with the totals (in excel) is set directly after the description" />

		<Property	Name="ExportFileName"				Type="UltimoString"		Accessor="Internal" />
		<Property	Name="RecordsFound"					Type="Boolean"			Accessor="Internal"						Default="False" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="EndDate before StartDate" Condition="${PmSchedule.StartDate} &lt; ${PmSchedule.EndDate}" MessageCode="3090" />

		<When Name="Start- and EndDate have value" Condition="${PmSchedule.StartDate} != Empty &amp;&amp; ${PmSchedule.EndDate} != Empty">
			<Validation Name="Period greater than PeriodLimitInYears" Condition="${PmSchedule.StartDate} &gt;= #addyears(${PmSchedule.EndDate},-${PeriodLimitInYears})" MessageCode="3089">
				<Parameter	Name="PeriodLimitInYears"	Direction="In"		Value="${PeriodLimitInYears}" />
			</Validation>
		</When>

		<Validation Name="Validate that a type of costs is selected" Condition="${PmSchedule.ShowMaterialsCalculated} == True || ${PmSchedule.ShowExternalsCalculated} == True || ${PmSchedule.ShowToolsCalculated} == True || ${PmSchedule.ShowResourcesCalculated} == True || ${PmSchedule.ShowPurchaseCalculated} == True || ${PmSchedule.ShowPurchaseRequestCalculated} == True" MessageCode="3223" />

		<Transaction>
			<Comment><![CDATA[ behaviour for searching should be like the properties set here ]]></Comment>

			<Assign Name="IncludeAutoPmWorkOrders" Property="${PmSchedule.IncludeAutoPmWorkOrders}" Value="True" />
			<Assign Name="PmWorkOrderContextSearchType" Property="${PmSchedule.PmWorkOrderContextSearchType}" Value="NoCourseRoutes" />
			<Assign Name="PmWorkOrderInSchemaSearchType" Property="${PmSchedule.PmWorkOrderInSchemaSearchType}" Value="0" Comment="Also find in schema" />
			<Assign Name="SearchOnlyDateNextMaintenance" Property="${PmSchedule.SearchOnlyDateNextMaintenance}" Value="False" />

			<Command Name="Export hours and costs forecast to Excel" CommandName="PmForecast_Export">
				<Parameter	Name="ExcelVersion"					Direction="In"		Value="${ExcelVersion}" />
				<Parameter	Name="FileName"						Direction="In"		Value="${FileName}" />
				<Parameter	Name="JobContextsToSearch"			Direction="In"		Value="${JobContextsToSearch}" />
				<Parameter	Name="OffsetX"						Direction="In"		Value="0" />
				<Parameter	Name="OffsetY"						Direction="In"		Value="0" />
				<Parameter	Name="PmSchedule"					Direction="In"		Value="${PmSchedule}" />
				<Parameter	Name="PmWorkOrderContextsToSearch"	Direction="In"		Value="${PmWorkOrderContextsToSearch}" />
				<Parameter	Name="ShowTotalsLeft"				Direction="In"		Value="${ShowTotalsLeft}" />
				<Parameter	Name="ExportFileName"				Direction="Out"												OutputProperty="${ExportFileName}" />
				<Parameter	Name="RecordsFound"					Direction="Out"												OutputProperty="${RecordsFound}" />
			</Command>
		</Transaction>

		<Validation Name="No records found" Condition="${RecordsFound} == true" MessageCode="3075" />

		<UserContent Name="Post" />

		<View Name="View document" ViewName="ExternalDocumentViewer">
			<Parameter	Name="FileName"	Direction="In"		Value="${ExportFileName}" />
		</View>
	</Execution>
</Workflow>