This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Complex SQL in Request Properties

We've extended PWO and ShoppingCartWith with FK to UNSGroupB. How to build more complex SQL in Request Properties?

I.e.: we want to query UNSAccountBInUNSGroupB if group is assigned to someone?

  • GroupType = 'COS' AND UID_UNSGroupB IN ( SELECT UID_UNSGroupB from UNSAccountBInUNSGroupB)
  • In the following screenshot you will find a more complex statement, that will filter the list for available workdesks, when you order a local application. You can see your own workdesks, the workdesks of your primary department and if you are a member of an special ESet you are able to see the workdesks of the whole Company.

    Because we have more than one OS active we also check for the OS, that is installed on each Hardware.

     

    With EXISTS you can build queries against each table within the DB in the condition editor, Independent of the selected parameter (simple or FK column) in your AccProductParamCategory object.

    EXISTS (
        SELECT TOP 1 1 FROM <TABLE1> t1
            INNER JOIN <TABLE2> t2 ON t2.UID = t1.UID
            WHERE
                <...>
    )
    
    OR
    
    NOT EXISTS (
        SELECT TOP 1 1 FROM <TABLE1> t1
            INNER JOIN <TABLE2> t2 ON t2.UID = t1.UID
            WHERE
                <...>
    )
    

     

    -

    Regards

    Sven

  • Hi, is there any way to reference the product selected within the condition? For example, if i requested a Business Role from the IT Shop which had a Request Property attached to it, can i reference the role in the condition for the AccProductParameter even though the request is not assigned or approved yet?

    Also is it possible to include other AccProductParameter decisions within the condition for another parameter part of the same AccProductParamCategory?