Skip to main content
Solved

Inquiries: Relations - "is in"


Michaelh
Semi-Pro III
Forum|alt.badge.img+2

I cannot get “is in” to work as a realtionship condition in my inquiries.

Running: 
Acumatica 2024 R1
Build 24.102.0053

 

Here is the relationship in the editor:

 

Here is the TranDesc on the Adjustment (INRegister): 

Added costing for receipt 018261 component XS29347-C-POT and FG S29347-C

What I REALLY wanted was to ask if the Receipt Nbr AND Item Number are in the description. That failed, even though they are there. So I tried using the generic string “costing” and I still can’t get the data to link. Am I mis-using “is in” or something?

Best answer by BenjaminCrisman

@Michaelh The issue here is that it isn’t the correct use of ‘is in’, what you’re looking for is the ‘Contains’ condition.

You would use ‘is in’ when you are referencing a relationship where a branch is in a certain company, or maybe an employee is in a specific workgroup, or the expected result is in a subset of results.

Like in SQL language you could say Select * from POReceipt where RefNbr in ('PR0002517', 'PR0002518', 'PR0002519', 'PR0002523'). This example doesn’t use the ‘is’ portion of the condition, but it’s the same thing. 

View original
Did this topic help you find an answer to your question?

8 replies

BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 733 replies
  • Answer
  • January 6, 2025

@Michaelh The issue here is that it isn’t the correct use of ‘is in’, what you’re looking for is the ‘Contains’ condition.

You would use ‘is in’ when you are referencing a relationship where a branch is in a certain company, or maybe an employee is in a specific workgroup, or the expected result is in a subset of results.

Like in SQL language you could say Select * from POReceipt where RefNbr in ('PR0002517', 'PR0002518', 'PR0002519', 'PR0002523'). This example doesn’t use the ‘is’ portion of the condition, but it’s the same thing. 


Michaelh
Semi-Pro III
Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • 192 replies
  • January 6, 2025

How would you use contains, when the fields are on the wrong side though? I thought it wasn’t bi-directional.

 

I have multiple left-table fields I need to find on a right-table field. The Adjustment Description (TranDesc) contains the Receipt Nbr and it contains the Item ID, but I cannot write:

ReceiptNbr CONTAINS TranDesc
AND
InventoryID CONTAINS TranDesc

TranDesc is coming from the right and I don’t see a way to check if my left-handed values are inside of it. I was hoping that was what “is in” meant, but apparently not. So what tool do we use for this?


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 733 replies
  • January 6, 2025

@Michaelh You can use child tables on the left side, you just need to click the drop down and scroll to find them, likewise, you can use parent tables on the right side of the data links.


Michaelh
Semi-Pro III
Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • 192 replies
  • January 6, 2025

I also tried pushing this to the TOP of my relationships, changing left join to right join to make it work, and now it just spins until it times out.

The condtion was simple enough:
TRAN DESC contains RECEIPT NUMBER. 

Oh well, I’ll just keep shuffling the pieces around until it sticks. Thanks for the info on “is in”


WillH
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • 58 replies
  • January 7, 2025

@Michaelh  - You have to be really careful with putting search strings against text strings.   There’s a solid chance that your database won’t be indexed in a way that lets that kind of join work fast.

If possible I’d try to trim data further, or make it so the GI can only be run once a Parameter has been supplied that limits the information being checked significantly.


Michaelh
Semi-Pro III
Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • 192 replies
  • January 7, 2025

Thanks Will and Benjamin. I was able to avoid Contains (which was slow) by using Starts With, which has a much better runtime. Since I can control the data in the description, I pasted the LineNbr and PONbr right at the front so this would be easier to grab. Now I am using:

CSTR(LineNbr)+CSTR(PONbr) StartsWith Left(TranDesc,Len(CSTR(LineNbr)+CSTR(PONbr)-1)

It’s slow, but not an issue for this task, I just give a minute to execute. The overhead for contains resutls in a timeout.


WillH
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • 58 replies
  • January 7, 2025

@Michaelh  - Reasonable, I’d be really tempted to add an attribute/extra field/something and shove the data into a separate field just for being able to do exact string matches and improve database indexing.

Obviously you know the performance context of you/your customer in more detail than I do though.  Might be something to think of if you hit future slowdowns or if this GI is going to be referenced frequently.


Michaelh
Semi-Pro III
Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • 192 replies
  • January 7, 2025

LOLOLOL, it’s funny you should say that. I have asked for permission to add the fields this weekend to the Adjustments Screen when my users are offline.

Side Question: Anyone know if a simple UDF vs an actual field on the screen has performance implications when doing comparisons?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings