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

ActionField660

Beschrijving: When Article property VendorPerSite is selected, delete all related ArticleVendors otherwise delete all ArticleSiteVendors. This is restricted with record authorization. Custom: Nee

Propertiesbewerken

Property Type Accessor
Article Article Root

XMLbewerken

<Workflow Name="ActionField660" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>When Article property VendorPerSite is selected, delete all related ArticleVendors otherwise delete all ArticleSiteVendors. This is restricted with record authorization.</Description>
	<Properties>
		<Property	Name="Article"					Type="Article"					Accessor="Root"		Direction="In" />

		<Property	Name="ArticleSites"				Type="List[ArticleSite]"		Accessor="Internal" />
		<Property	Name="ArticleSiteVendorDelete"	Type="RequestResult"			Accessor="Internal" />
		<Property	Name="ArticleSiteVendorToUse"	Type="List[ArticleSiteVendor]"	Accessor="Internal" />
		<Property	Name="ArticleVendorDelete"		Type="RequestResult"			Accessor="Internal" />
		<Property	Name="ArticleVendorToUse"		Type="List[ArticleVendor]"		Accessor="Internal" />
		<Property	Name="RecordAuthorizationSet"	Type="Boolean"					Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Choose Name="ChooseIfVendorPerSiteIsSelected">
			<When Name="WhenIfVendorPerSiteIsSelected" Condition="${Article.VendorPerSite} == True">
				<Transaction>
					<GetList Name="ListArticleVendors" Type="ArticleVendor" OutputProperty="${ArticleVendorToUse}" OrderBy="Id" OrderDirection="Descending">
						<Filters>
							<PropertyFilter	PropertyName="Id.Article"	Operator="="		PropertyValue="${Article}" />
						</Filters>
					</GetList>
				</Transaction>

				<When Name="Continue if vendors are found" Condition="${ArticleVendorToUse.Count} &gt; 0">
					<Question Name="QuestionIfVendorPerSiteIsSelected" Type="YesNo" MessageCode="1271" OutputProperty="${ArticleVendorDelete}">
						<Parameter	Name="Article"	Direction="In"		Value="${Article}" />
					</Question>

					<Choose Name="ChooseDeleteAllArticleVendors">
						<When Name="WhenDeleteAllArticleVendors" Condition="${ArticleVendorDelete} == Yes">
							<Transaction>
								<Assign Name="Set Vendor to Article" Property="${Article.PreferredVendor}" Value="Empty" />

								<GetList Name="Get ArticleSites" Type="ArticleSite" OutputProperty="${ArticleSites}" OrderBy="Id" OrderDirection="Ascending" Comment="Get articleSites by Article to empty ArticleSite.Vendor">
									<Filters>
										<PropertyFilter	PropertyName="Id.Article"	Operator="="		PropertyValue="${Article}" />
									</Filters>
								</GetList>

								<ForEach Name="Foreach ArticleSite" In="${ArticleSites}" As="ArticleSite">
									<Assign Name="Set HasPreferredVendor false" Property="${ArticleSite.HasPreferredVendor}" Value="False" />
									<Assign Name="Empty vendor" Property="${ArticleSite.Vendor}" Value="Empty" Comment="Empty vendor to avoid validation 3582" />
								</ForEach>

								<ForEach Name="GoThroughArticleVendorObjects" In="${ArticleVendorToUse}" As="ArticleVendorObject">
									<DeleteObject Name="DeleteArticleVendor" DomainObject="${ArticleVendorObject}" />
								</ForEach>
							</Transaction>
						</When>

						<Otherwise Name="WhenDeleteAllArticleVendorsPressedNo">
							<Transaction>
								<Assign Name="Reset vendor per site" Property="${Article.VendorPerSite}" Value="False" />

								<Stop Name="Stop" Mode="EndAll" />
							</Transaction>
						</Otherwise>
					</Choose>
				</When>
			</When>

			<Otherwise Name="WhenIfVendorPerSiteIsNotSelected">
				<Transaction>
					<Command Name="CheckIsAuthorizationSet" CommandName="IsAuthorizationSet" Comment="Check if record authorization is set">
						<Parameter	Name="IsSet"	Direction="Out"		OutputProperty="${RecordAuthorizationSet}" />
					</Command>
				</Transaction>

				<When Name="ChooseIsAuthorizationSet » WhenIsAuthorizationSet" Condition="${RecordAuthorizationSet} == True">
					<Message Name="MsgBoxIsAuthorizationSet" MessageCode="1133" Comment="Shows a message when record authorization is set" />

					<Transaction>
						<Assign Name="ArticleVendorPerSiteSet" Property="${Article.VendorPerSite}" Value="True" Comment="Set this option to true if record authorisation is set!" />
					</Transaction>

					<Stop Name="Stop" Mode="EndAll" />
				</When>

				<Transaction>
					<GetList Name="ListArticleSiteVendorToUse" Type="ArticleSiteVendor" OutputProperty="${ArticleSiteVendorToUse}" OrderBy="Id" OrderDirection="Descending">
						<Filters>
							<PropertyFilter	PropertyName="Id.ArticleSite.Id.Article"	Operator="="		PropertyValue="${Article}" />
						</Filters>
					</GetList>
				</Transaction>

				<When Name="Continue if site vendors are found" Condition="${ArticleSiteVendorToUse.Count} &gt; 0">
					<Question Name="QuestionIfVendorPerSiteIsNotSelected" Type="YesNo" MessageCode="1272" OutputProperty="${ArticleSiteVendorDelete}">
						<Parameter	Name="Article"	Direction="In"		Value="${Article}" />
					</Question>

					<Choose Name="ChooseDeleteAllArticleSiteVendors">
						<When Name="WhenDeleteAllArticleSiteVendors" Condition="${ArticleSiteVendorDelete} == Yes">
							<Transaction>
								<ForEach Name="GoThroughArticleSiteVendorObjects" In="${ArticleSiteVendorToUse}" As="ArticleSiteVendorObject">
									<DeleteObject Name="DeleteArticleSiteVendor" DomainObject="${ArticleSiteVendorObject}" />
								</ForEach>
							</Transaction>
						</When>

						<Otherwise Name="WhenDeleteAllArticleSiteVendorsPressedNo">
							<Transaction>
								<Assign Name="Reset vendor per site" Property="${Article.VendorPerSite}" Value="True" />

								<Stop Name="Stop" Mode="EndAll" />
							</Transaction>
						</Otherwise>
					</Choose>
				</When>
			</Otherwise>
		</Choose>

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