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

ActionField947

Beschrijving: Delete RentableRealEstateContract and all linked ContractPeriods, ObjectContacts, ObjectDocuments, Notes and ContractLines. Custom: Nee

Propertiesbewerken

Property Type Accessor
RentableRealEstateContract ServiceContract Root

XMLbewerken

<Workflow Name="ActionField947" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Delete RentableRealEstateContract and all linked ContractPeriods, ObjectContacts, ObjectDocuments, Notes and ContractLines.</Description>
	<Properties>
		<Property	Name="RentableRealEstateContract"	Type="ServiceContract"		Accessor="Root"		Direction="In" />

		<Property	Name="ContractLines"				Type="List[ContractLine]"	Accessor="Internal" />
		<Property	Name="ContractPeriods"				Type="List[ContractPeriod]"	Accessor="Internal" />
		<Property	Name="Count"						Type="Int64"				Accessor="Internal" />
		<Property	Name="DeleteContractAnswer"			Type="RequestResult"		Accessor="Internal" />
		<Property	Name="Notes"						Type="List[Notes]"			Accessor="Internal" />
		<Property	Name="ObjectContacts"				Type="List[ObjectContact]"	Accessor="Internal" />
		<Property	Name="ObjectDocuments"				Type="List[ObjectDocument]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="StatusContractIsNotConcept" Condition="${RentableRealEstateContract.Status} == ServiceContractStatus.Concept" MessageCode="1771">
			<Parameter	Name="ServiceContract"	Direction="In"		Value="${RentableRealEstateContract}" />
		</Validation>

		<Transaction>
			<GetCount Name="if there are any invoices, delete isn't possible" Type="InternalChargeLine" OutputProperty="${Count}">
				<Filters>
					<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
				</Filters>
			</GetCount>
		</Transaction>

		<Validation Name="There are invoice lines for this contract. Delete not possible" Condition="${Count} == 0" MessageCode="2101">
			<Parameter	Name="ServiceContract"	Direction="In"		Value="${RentableRealEstateContract}" />
		</Validation>

		<Question Name="ContractDelete?" Type="YesNo" MessageCode="1772" OutputProperty="${DeleteContractAnswer}">
			<Parameter	Name="ServiceContract"	Direction="In"		Value="${RentableRealEstateContract}" />
		</Question>

		<Transaction IncludeTrashedObjects="True">
			<When Name="AnswerIsYes" Condition="${DeleteContractAnswer} == Yes">
				<GetList Name="Get list of contractperiods" Type="ContractPeriod" OutputProperty="${ContractPeriods}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
					</Filters>
				</GetList>

				<ForEach Name="Foreach found ContractPeriod" In="${ContractPeriods}" As="ContractPeriod">
					<DeleteObject Name="Delete ContractPeriods" DomainObject="${ContractPeriod}" />
				</ForEach>

				<GetList Name="Get list of contacts" Type="ObjectContact" OutputProperty="${ObjectContacts}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
					</Filters>
				</GetList>

				<ForEach Name="Foreach found ObjectContact" In="${ObjectContacts}" As="ObjectContact">
					<DeleteObject Name="Delete ObjectContacts" DomainObject="${ObjectContact}" />
				</ForEach>

				<GetList Name="Get list of objectdocuments" Type="ObjectDocument" OutputProperty="${ObjectDocuments}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
					</Filters>
				</GetList>

				<ForEach Name="Foreach found ObjectDocuments" In="${ObjectDocuments}" As="ObjectDocument">
					<DeleteObject Name="Delete ObjectDocuments" DomainObject="${ObjectDocument}" />
				</ForEach>

				<GetList Name="Get list of notes" Type="Notes" OutputProperty="${Notes}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
					</Filters>
				</GetList>

				<ForEach Name="Foreach found Notes" In="${Notes}" As="Note">
					<DeleteObject Name="Delete Notes" DomainObject="${Note}" />
				</ForEach>

				<GetList Name="Get list of contractlines" Type="ContractLine" OutputProperty="${ContractLines}" OrderBy="Id" OrderDirection="Ascending">
					<Filters>
						<PropertyFilter	PropertyName="ServiceContract"	Operator="="		PropertyValue="${RentableRealEstateContract}" />
					</Filters>
				</GetList>

				<ForEach Name="Foreach found ContractLine" In="${ContractLines}" As="ContractLine">
					<DeleteObject Name="Delete ContractLines" DomainObject="${ContractLine}" />
				</ForEach>

				<DeleteObject Name="Delete RentableRealEstateContract" DomainObject="${RentableRealEstateContract}" />
			</When>
		</Transaction>

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