Criteria in DME call - Is there an "IN" option

Sort:
You are not authorized to post a reply.
Author
Messages
LauraBryant
Basic Member
Posts: 8
Basic Member
    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
    Senior Member
    Posts: 3348
    Senior Member
      &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
      Veteran Member
      Posts: 1127
      Veteran Member
        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
        Basic Member
        Posts: 8
        Basic Member
          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
          Veteran Member
          Posts: 124
          Veteran Member
            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
            Basic Member
            Posts: 8
            Basic Member
              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.