2020 Dec 07 12:19 AM - edited 2024 Feb 03 7:21 PM
I want to fetch the workflow of the products where the status of the product would be "VALIDATE" and "Isworkflowrequired" (a attb in GenericVariantProductModel) and additionally the workflowitemattachement type should be ="GenericVariantProduct".
So I have this query
SELECT DISTINCT {w.pk} FROM {Workflow AS w JOIN WorkflowAction AS wa ON {w.pk} = {wa.workflow} JOIN WorkflowActionItemAttachmentRelation AS rel ON {rel:source}={wa:pk} JOIN WorkflowItemAttachment AS attachment ON {rel:target}={attachment:pk} JOIN GenericVariantProduct as p ON {attachment.item}={p.pk}join ArticleApprovalStatus AS aas ON {p:approvalStatus} = {aas:pk}} WHERE {aas.code}='VALIDATE' and {p.IsWorkflowRequired}='1' AND {attachment.typeOfItem} ='8796103409746'
So in the query above , this attribute "{attachment.typeOfItem}" holds the PK of the composed type, so in the code I need to fetch the composedtype PK and i need to set it as a query parameter and in my case the composed type attached is "GenericVariantProduct" as show below in the attribute "type"



so how to fetch the PK of the type "GenericVariantProduct" type itself??
Request clarification before answering.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.