AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Strings in iif(exp,...
 
Notifications
Clear all

Questions [Solved] Strings in iif(exp, true, false)

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Royce Lithgo 7 years ago
6 Posts
2 Users
1 Reactions
3,021 Views
RSS
Alisann Crough
Posts: 28
 Alisann Crough
Topic starter
September 3, 2019 2:51 pm
(@alisann-crough)
Eminent Member
Joined: 7 years ago

= iif ( ([INKitSpecStkDet.CompInventoryID] = Null), [ARTran.InventoryID] , [INKitSpecStkDet.CompInventoryID])

This is returning an integer value for the Inventory ID if true and and integer value of the Componenet Inventory ID if false - (dB sequence numbers?) .  How do I get it to return the actual part numbers (not descriptions)?


5 Replies
Royce Lithgo
Posts: 557
 Royce Lithgo
September 3, 2019 4:03 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

You need to join ARTran and INKitSpecStkDet to IN.InventoryItem (note: the table needs to be added twice to the GI, once for each join) and then use the field [InventoryItem.InventoryCD]


Reply
Alisann Crough
 Alisann Crough
(@alisann-crough)
Joined: 7 years ago

Eminent Member
Posts: 28
September 3, 2019 5:01 pm
Reply toRoyce LithgoRoyce Lithgo

@royce-lithgo

I have both of those tables linked but I will check them again. However when I use InventoryCD  (which I had done initially) I get the error: Conversion failed when converting the nvarchar value 'part number              ' to data type int so I tried InventoryID and I got the correct # of rows and correct data everywhere except in the iff (exp, true, false). The data from the iff isn't incorrect, it is just the int value (dB seq #?) not the part #. 

Are you saying I should use InventoryCD in the iff statement or in the Relations tab or both? I get the above error in all cases.

Thanks!


Reply
Royce Lithgo
Posts: 557
 Royce Lithgo
September 3, 2019 5:42 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

In relations tab you need to relate via ID fields - in the results formula, if you want the CD values then use those in the IIf formula result. 

Check that you used the right Schema field for that formula as well. If you used an int field, then you would likely get an error (similar to the one you listed above). You can leave Schema field blank in this instance.


Reply
Alisann Crough
 Alisann Crough
(@alisann-crough)
Joined: 7 years ago

Eminent Member
Posts: 28
September 4, 2019 12:08 pm
Reply toRoyce LithgoRoyce Lithgo

@royce-lithgo

Thanks for the help! I got it working. I did need another join with IN.InventoryItem as I had INKitSpecStkDHdr as well as INKitSpecStkDet ... 

Still not sure why I got the error messages when I used InventoryCD.  I found that if I used all InventoryID I didn't get the error but it returned the int value of InventoryID and when I tried t use InventoryCD in place of just one of the InventoryID in the equation I got the error. When I replaced all of the InventoryID with InventoryCD I got the results I expected. (Schema fields were blank)


Reply
Royce Lithgo
 Royce Lithgo
(@roycelithgo)
Joined: 6 years ago

Honorable Member
Posts: 557
September 4, 2019 3:39 pm
Reply toAlisann CroughAlisann Crough
Royce Lithgo

@alisann-crough

I did say that you needed to join IN.InventoryItem twice in my original post. 😉 

Not quite sure what error you were getting, but your IIf statement needs to return consistent types (ie. you can't have one return an int and the other a varchar). 


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,530 Topics
  • 11 K Posts
  • 4 Online
  • 2,418 Members
Our newest member: Chad Treadwell
Latest Post: Negative/Credit Inventory Value?
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Johnny Tang
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×