PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05/26/2016 5:54 AM by  LauraBryant
Criteria in DME call - Is there an "IN" option
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages
LauraBryant
Technicial Analyst
Private
Basic Member
(14 points)
Basic Member
Posts:8


Send Message:

--
05/25/2016 12:41 PM
    Is there a way to set the criteria of a DME call to select a record if a field value is in a string? For example, I have a list of AU's stored in a string, separated by commas. I want to only select records from the WFWORKUNIT table if the WORK-CAT-VAL value is in that string.

     

    So, if the records WORK-CAT-VAL equals 305101 and the string I created equals "111205,111210,111211,305101,306106,306109", I want to select the record.

     

    I tried using the contains option and that does not work.

    John Henley
    Private
    Private
    Senior Member
    (9629 points)
    Senior Member
    Posts:3227


    Send Message:

    --
    05/25/2016 1:28 PM
    &SELECT=WORK-CAT-VAL~%2c305101%2c|WORK-CAT-VAL~%2c305101|WORK-CAT-VAL~305101%2c

     

    %2c is the hex value for comma

    | is the OR function for the &SELECT

    this will find ,305101, -or- ,305101 -or- 305101,

     

     

    Thanks for using the LawsonGuru.com forums!
    John
    David Williams
    Private
    Private
    Veteran Member
    (3055 points)
    Veteran Member
    Posts:1029


    Send Message:

    --
    05/25/2016 1:41 PM
    Still, if you know the Task then you can use the semicolon separated values with index WFSET5. You can use a range on Task if needed.
    David Williams
    LauraBryant
    Technicial Analyst
    Private
    Basic Member
    (14 points)
    Basic Member
    Posts:8


    Send Message:

    --
    05/25/2016 1:58 PM
    John, Thanks for the response. I'm not sure if the OR function will work for this. The string can have 1 acct unit or 1000. How long can the criteria statement be?
    Jason Beard
    Private
    Private
    Veteran Member
    (300 points)
    Veteran Member
    Posts:106


    Send Message:

    --
    05/25/2016 9:10 PM
    Laura -
    Is your filter intent to improve performance, enforce security, or simplify the results for the user?
    I've built similar screens where I return more data via the DME call than I need and then filter the display rather than filtering the call to the database. Depending on the desired result this may not be a valid solution for you but it does give you control in a more straightforward manner than the DME select provides.
    Just my 2 cents.
    Jason Beard
    617-548-5568
    jabeard3@gmail.com
    LauraBryant
    Technicial Analyst
    Private
    Basic Member
    (14 points)
    Basic Member
    Posts:8


    Send Message:

    --
    05/26/2016 5:54 AM
    Jason, I'm trying to filter the results. We only want people to see workunits for the accounting units they have access to. It appears that the OR statement is going to work.

    Thank you so much for the tips. I appreciate it.
    You are not authorized to post a reply.