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

ActionField497

Beschrijving: Create a RentableRealEstateContractLineCostMutation for this RentableRealEstateContractLine. Custom: Nee

Propertiesbewerken

Property Type Accessor
RentableRealEstateContractLine RentableRealEstateContractLine Root
ScreenName String Optional

XMLbewerken

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

		<Property	Name="ScreenName"											Type="String"											Accessor="Optional"	Direction="In"		Default="rntreclcm01"					Comment="Create RentableRealEstateContractLineCostMutation via this screen" />

		<Property	Name="Now"													Type="Date"												Accessor="Internal"						Default="#{Environment.CurrentDate}" />
		<Property	Name="PreviousRentableRealEstateContractLineCostMutation"	Type="RentableRealEstateContractLineCostMutation"		Accessor="Internal" />
		<Property	Name="RentableRealEstateContractLineCostMutation"			Type="RentableRealEstateContractLineCostMutation"		Accessor="Internal" />
		<Property	Name="RentableRealEstateContractLineCostMutations"			Type="List[RentableRealEstateContractLineCostMutation]"	Accessor="Internal" />
		<Property	Name="StateTimeslots"										Type="List[StateTimeslot]"								Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<Insert Name="RentableRealEstateContractLineCostMutation" ObjectType="RentableRealEstateContractLineCostMutation" OutputProperty="${RentableRealEstateContractLineCostMutation}">
				<Parameter	Name="Status"							Direction="In"		Value="RentableRealEstateContractLineCostMutationStatus.Concept" />
				<Parameter	Name="Employee"							Direction="In"		Value="#{User.EmployeeId}" />
				<Parameter	Name="Price"							Direction="In"		Value="CompanyMoney.Zero" />
				<Parameter	Name="RentableRealEstateContractLine"	Direction="In"		Value="${RentableRealEstateContractLine}" />
				<Parameter	Name="StartDate"						Direction="In"		Value="${Now}" />
				<Parameter	Name="Vat"								Direction="In"		Value="${RentableRealEstateContractLine.Vat?}" />
				<Parameter	Name="VatPercentage"					Direction="In"		Value="${RentableRealEstateContractLine.Vat.Percentage?}" />
			</Insert>
		</Transaction>

		<SystemDialog Name="Creating a RentableRealEstateContractLineCostMutation" DialogName="DataEntryScreen">
			<Parameter	Name="DomainObject"	Direction="In"		Value="${RentableRealEstateContractLineCostMutation}" />
			<Parameter	Name="ScreenName"	Direction="In"		Value="${ScreenName}" />
		</SystemDialog>

		<Transaction>
			<Validation Name="RentableRealEstateContractLineCostMutation.StartDate should have a value" Condition="${RentableRealEstateContractLineCostMutation.StartDate} != Empty" MessageCode="1746" />

			<Command Name="CalculateVatPrice" CommandName="CalculateVatPrice">
				<Parameter	Name="InPrice"			Direction="In"		Value="${RentableRealEstateContractLineCostMutation.Price}" />
				<Parameter	Name="InPriceIsTotal"	Direction="In"		Value="False" />
				<Parameter	Name="Percentage"		Direction="In"		Value="${RentableRealEstateContractLineCostMutation.VatPercentage}" />
				<Parameter	Name="OutVatPrice"		Direction="Out"																			OutputProperty="${RentableRealEstateContractLineCostMutation.VatPrice}" />
			</Command>

			<ChangeStatus Name="Approve mutation" DomainObject="${RentableRealEstateContractLineCostMutation}" NewStatus="RentableRealEstateContractLineCostMutationStatus.Approved" />

			<GetList Name="Check whether there are more of these CostMutationLines related to RentableRealEstateContractLine" Type="RentableRealEstateContractLineCostMutation" OutputProperty="${RentableRealEstateContractLineCostMutations}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="RentableRealEstateContractLine.Id"	Operator="="		PropertyValue="${RentableRealEstateContractLine.Id}" />
					<DateFilter PropertyName="StartDate" Operator="=" PropertyValue="${RentableRealEstateContractLineCostMutation.StartDate}" />
					<PropertyFilter	PropertyName="Id"									Operator="!="		PropertyValue="${RentableRealEstateContractLineCostMutation.Id}" />
					<PropertyFilter	PropertyName="Status"								Operator="="		PropertyValue="RentableRealEstateContractLineCostMutationStatus.Approved" />
				</Filters>
			</GetList>

			<Validation Name="There is another RentableRealEstateContractLineCostMutation record of the same date" Condition="${RentableRealEstateContractLineCostMutations.Count} == 0" MessageCode="1722" />

			<GetList Name="Get all mutations for the RentableRealEstateContractLine before the current mutation" Type="RentableRealEstateContractLineCostMutation" OutputProperty="${RentableRealEstateContractLineCostMutations}" OrderBy="StartDate" OrderDirection="Descending">
				<Filters>
					<PropertyFilter	PropertyName="RentableRealEstateContractLine.Id"	Operator="="		PropertyValue="${RentableRealEstateContractLine.Id}" />
					<CombinedFilter FilterOperator="Or">
						<PropertyFilter	PropertyName="StartDate"	Operator="&lt;"		PropertyValue="${RentableRealEstateContractLineCostMutation.StartDate}" />
						<PropertyEmptyFilter PropertyName="StartDate" Comment="the initial mutation will not have a StartDate set, descending will make it come last" />
					</CombinedFilter>
				</Filters>
			</GetList>

			<ForEach Name="Iterate the list (the element with the latest date before the date of the created mutation should be first)" In="${RentableRealEstateContractLineCostMutations}" As="FirstRentableRealEstateContractLineCostMutation">
				<AssignWhenEmpty Name="Get the first RentableRealEstateContractLineCostMutation from the list" Property="${PreviousRentableRealEstateContractLineCostMutation}" Value="${FirstRentableRealEstateContractLineCostMutation}" />
			</ForEach>

			<When Name="When mutation is found" Condition="${PreviousRentableRealEstateContractLineCostMutation} != Empty">
				<Assign Name="Set previous price based on previous mutation" Property="${RentableRealEstateContractLineCostMutation.PreviousPrice}" Value="${PreviousRentableRealEstateContractLineCostMutation.Price}" />
				<Assign Name="Set previous VAT price based on previous mutation" Property="${RentableRealEstateContractLineCostMutation.PreviousVatPrice}" Value="${PreviousRentableRealEstateContractLineCostMutation.VatPrice}" />
				<Assign Name="Set previous VAT percentage based on previous mutation" Property="${RentableRealEstateContractLineCostMutation.PreviousVatPercentage}" Value="${PreviousRentableRealEstateContractLineCostMutation.VatPercentage}" />
			</When>
		</Transaction>

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