dbo.QER_TIPersonWantsOrg
SQL_TRIGGER parent PersonWantsOrg
Created 2025-06-27T18:01:08.340 · modified 2026-04-14T23:23:08.457 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogProcess | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| PersonWantsOrg | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PJobCreate_HOCallMethod_L | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YDBQueueRaw | TYPE | ||
| QBM_YParameterList | TYPE | ||
| QER_PITShopPersonHasObjFill_b | OBJECT_OR_COLUMN | ||
| QER_VPWOOrderState | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGIConfigparmValue | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create trigger QER_TIPersonWantsOrg on PersonWantsOrg for Insert not for Replication as begin declare @DecisionOnInsert int = 0 declare 2@uid_personwantsorg varchar(38) declare @isMassInsert bit = 0 declare @XUser nvarchar(64) declare @heute datetime = getutcdate() declare @Processes QBM_YParameterList 3 declare @PWOsToFillObject QBM_YParameterlist BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar 4(38) select @GenProcID = dbo.QBM_FGISessionContext('') select @XUser = dbo.QBM_FGISessionContext('XUser') if exists (select top 1 1 from inserted i join 5 PersonWantsOrg pwo on i.UID_PersonWantsOrg = pwo.UID_PersonWantsOrg join QER_VPWOOrderState s on pwo.OrderState = s.OrderState where sign(len(isnull(pwo.UID_QERWorkingMethod 6, ''))) ^ s.HasWorkingMethod = 1 ) begin raiserror('#LDS#Invalid combination of Orderstate and QERWorkingMethod.|', 18, 1) with nowait end if dbo.QBM_FGIConfigparmValue 7('Common\ProcessState') > ' ' begin if dbo.QBM_FGIConfigparmValue('Common\ProcessState\UseGenProcIDFromPWO') > ' ' begin insert into @Processes(Parameter1 8, Parameter2) select isnull(i.GenProcID, @GenProcID) , min(i.XObjectKey) from inserted i group by i.GenProcID end else begin insert into @Processes(Parameter1 9, Parameter2) select @GenProcID , min(i.XObjectKey) from inserted i end delete @Processes from @Processes p where exists (select top 1 1 from DialogProcess 10 e with (nolock) where e.GenProcID = p.Parameter1 ) if exists (select top 1 1 from @Processes ) begin insert into DialogProcess (GenProcID, BasisObjectType 11 , ObjectKey, ProcessState , XDateInserted, XDateUpdated , XUserInserted , XUserUpdated , CustomComment, DisplayName ) select p.Parameter1 , 'PersonWantsOrg' 12 as BasisObjectType , p.Parameter2 as ObjectKey, 'E' , @heute, @heute , @XUser , @XUser , '' as CustomComment, 'Insert PersonWantsOrg' as DisplayName 13from @Processes p where not exists (select top 1 1 from Dialogprocess where GenProcID = p.Parameter1) end end if dbo.QBM_FGIConfigparmValue('QER\ITShop\DecisionOnInsert' 14) > ' ' begin select @DecisionOnInsert = 1 end if (select count(*) from inserted) > 500 begin select @isMassInsert = 1 end if exists (select top 1 1 from 15 inserted i where i.UID_ITShopOrgFinal is null ) begin update personwantsorg set UID_ITShopOrgFinal = Personwantsorg.uid_Org , XDateUpdated = @heute , 16 XUserUpdated = @XUser from Personwantsorg join inserted i on Personwantsorg.uid_personwantsorg = i.uid_Personwantsorg where i.UID_ITShopOrgFinal is null 17 end if @isMassInsert = 0 begin delete @PWOsToFillObject insert into @PWOsToFillObject(Parameter1, Parameter2, Parameter3, HasContentFull) select UID_PersonWantsOrg 18, @GenProcID , '1' as CurrentLevelOnly , 1 as isNewDecisionLevel from inserted where OrderState in ('OrderProduct', 'OrderProlongate', 'OrderUnsubscribe' 19) exec QER_PITShopPersonHasObjFill_b @PWOsToFillObject, @IsCalledFromTrigger = 1 end if @DecisionOnInsert = 1 begin declare @PWOsToFire QBM_YParameterList 20 insert into @PWOsToFire(Parameter1) select i.XObjectKey from inserted i where OrderState in ('OrderProduct', 'OrderProlongate', 'OrderUnsubscribe') exec 21 QBM_PJobCreate_HOCallMethod_L @objecttype = 'PersonWantsOrg' , @XObjectKeys = @PWOsToFire , @save = 1 , @MethodName = 'MakeDecisionOnInsertAsync' , @GenProcID 22 = @GenProcID , @AdditionalObjectKeysAffected = default , @Retries = 3 , @isToFreezeOnError = 1 , @WhereClauseAdditional = 'DecisionLevel = 0 and OrderState in (''OrderProduct'', ''OrderProlongate'', ''OrderUnsubscribe'')' 23 , @checkForExisting = 1 end if @DecisionOnInsert = 0 or @isMassInsert = 1 begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 24 (object, subobject, genprocid) select x.uid, null, @GenProcID from (select i.UID_PersonWantsOrg as uid from inserted i where i.OrderState in ('OrderProduct' 25, 'OrderProlongate', 'OrderUnsubscribe') ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-ShoppingRackPWOHelperPWO', @DBQueueElements_01 exec QBM_PDBQueueInsert_Bulk 26 'QER-K-ShoppingRackPersonHasObject', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT 27 END CATCH ende: return end 28
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:23:08.457
creates object-layer jobs via QBM_PJobCreate* inserts DBQueue tasks calls object-layer method via HOCallMethod uses session context values has TRY/CATCH error handling
Summary: calls QER_PITShopPersonHasObjFill_b, QBM_PJobCreate_HOCallMethod_L, QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT not, INSERT into, INSERT DialogProcess, INSERT PersonWantsOrg, UPDATE personwantsorg; reads/joins inserted, PersonWantsOrg, QER_VPWOOrderState, DialogProcess, Dialogprocess…; uses config Common\ProcessState, Common\ProcessState\UseGenProcIDFromPWO, QER\ITShop\DecisionOnInsert; uses session context XUser
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT not INSERT into INSERT DialogProcess INSERT PersonWantsOrg UPDATE personwantsorgCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: Common\ProcessState Common\ProcessState\UseGenProcIDFromPWO QER\ITShop\DecisionOnInsert
Session: XUser
DBQueue/tasks
QER-K-ShoppingRackPWOHelperPWO QER-K-ShoppingRackPersonHasObjectTemp tables / referenced variables
Temp: #LDS #Invalid
Variables: @DecisionOnInsert @uid_personwantsorg @isMassInsert @XUser @heute @Processes @PWOsToFillObject @GenProcID @IsCalledFromTrigger @PWOsToFire @objecttype @XObjectKeys @save @MethodName @AdditionalObjectKeysAffected @Retries @isToFreezeOnError @WhereClauseAdditional @checkForExisting @DBQueueElements_01
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
No reverse dependencies extracted.