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

ActionField300

Beschrijving: Create an Invoice/InvoiceLines for a Purchase and open Invoice screen. Custom: Nee

Propertiesbewerken

Property Type Accessor
Purchase Purchase Root
FormName UltimoString Optional
InvoiceContext Context Optional

XMLbewerken

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

		<Property	Name="FormName"			Type="UltimoString"	Accessor="Optional"	Direction="In"		Comment="Open this screen with the created Invoice" />
		<Property	Name="InvoiceContext"	Type="Context"		Accessor="Optional"	Direction="In"		Comment="Create the Invoice with this context" />

		<Property	Name="CreatedInvoice"	Type="Invoice"		Accessor="Internal" />
		<Property	Name="NewInvoiceId"		Type="UltimoString"	Accessor="Internal" />
		<Property	Name="UseAutoKey"		Type="Boolean"		Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="PurchaseStatus OK?" Condition="${Purchase.Status} == PurchaseStatus.Active || ${Purchase.Status} == PurchaseStatus.PartReceived || ${Purchase.Status} == PurchaseStatus.Received" MessageCode="0675">
			<Parameter	Name="Purchase"	Direction="In"		Value="${Purchase}" />
		</Validation>

		<Transaction>
			<Command Name="HasAutoKey" CommandName="HasAutoKey">
				<Parameter	Name="EntityName"	Direction="In"		Value="Invoice" />
				<Parameter	Name="HasAutoKey"	Direction="Out"						OutputProperty="${UseAutoKey}" />
			</Command>
		</Transaction>

		<When Name="UseAutoKeyIsFalse" Condition="${UseAutoKey} == False">
			<Dialog Name="AskForNewInvoiceId" TitleCode="ASKFORNEWINVOICEID">
				<Container Border="True">
					<Text Name="NewInvoiceId" OutputProperty="${NewInvoiceId}" ColumnName="InvId" Required="True" LabelCode="CODEINVOICE" />
				</Container>
			</Dialog>
		</When>

		<Transaction>
			<Command Name="Create invoice" CommandName="Purchase_CreateInvoice">
				<Parameter	Name="InvoiceContext"	Direction="In"		Value="${InvoiceContext}" />
				<Parameter	Name="InvoiceId"		Direction="In"		Value="${NewInvoiceId}" />
				<Parameter	Name="Purchase"			Direction="In"		Value="${Purchase}" />
				<Parameter	Name="Invoice"			Direction="Out"									OutputProperty="${CreatedInvoice}" />
			</Command>

			<WorkflowCall Name="Create invoicelines from purchaselines" WorkflowName="Purchase_CreateInvoiceLines">
				<Parameter	Name="Invoice"	Direction="In"		Value="${CreatedInvoice}" />
				<Parameter	Name="Purchase"	Direction="In"		Value="${Purchase}" />
			</WorkflowCall>
		</Transaction>

		<UserContent Name="Post" />

		<View Name="Open screen to view created invoice" ViewName="DataEntryScreen">
			<Parameter	Name="DomainObject"			Direction="In"		Value="${CreatedInvoice}" />
			<Parameter	Name="FocusEditableField"	Direction="In"		Value="=${CreatedInvoice.Description} == Empty" />
			<Parameter	Name="ScreenName"			Direction="In"		Value="${FormName}" />
		</View>
	</Execution>
</Workflow>