- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Need UDS technique for retrieving fields from IM_PriceCo de
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-24-2010 10:32 PM - last edited on 05-24-2010 10:33 PM
In order to use .GetValue on the IM_PriceCode object, how to I use .Find method to position to the needed record.
I've tried:
Set oPrcCde = oSession.AsObject(oSession.GetObject("IM_PriceCode _SVC"))
retVal = oPrcCde.MoveFirst()
retVal = oPrcCde.find(strPriceCodeKey)
retVal = oPrcCde.GetValue("BreakQuantity1",break_quantity_1 )where: strPriceCodeKey is defined in format of primary key
"2" - for PriceCodeRecord
" " - 4 blanks for no price code
"6655 " - 30 character item code paded on right
"01" - AR Customer Division
"ABF " - 20 character Customer Number paded on right
Solved! Go to Solution.
Re: Need UDS technique for retrieving fields from IM_PriceCo de
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-24-2010 11:58 PM
A couple of things:
The MoveFirst() method does just that, sets the pointer to the first row in the table and reads it. You can then do GetValue() on the different columns but it will be for the first row.
The Find() method is used to find a row and has the same effect as using the SetKey() method within a service object. SetKey() has one additional purpose in a _bus object in that it will allow the establishing of a new row and will result in a return value of 2 in that case. (_svc objects can only be read, so Find() and SetKey() are the same, either it finds it (return value = 1) or it won't find it (return value = 0).
When working with a table with multiple columns that make up the key (like this one), in order to find a row, you need to do individual SetKeyValue(<column>, <value>) calls for each key column, followed by either a SetKey() or Find() call with no arguments. This will take the individual columns and construct the necessary composite key to find the row. The only time you can call Find(<keyValue>) or SetKey(<keyValue>) is if there is a single column that makes up the key.
Hope this helps
Re: Need UDS technique for retrieving fields from IM_PriceCo de
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-25-2010 10:44 AM
Thanks for putting me back on the peak of the wave...
Re: Need UDS technique for retrieving fields from IM_PriceCo de
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-16-2012 05:34 PM - last edited on 01-16-2012 05:43 PM
I hope you're still following this thread Steve, because I need some help.
I am finding that for the KPRIMARY key of IM_ItemCost (ItemCode, WarehouseCode, TierType & GroupSort) the technique you describe in this thread (which has always worked) fails when the GroupSort value consists of a numeric string.
Easy to check in the ABC company in I/M Maintenance for item 2480-8-50 (this is a button script)
Set oItemCost = oSession.AsObject(oSession.GetObject("IM_ItemCost_
retVal = oItemCost.SetKeyValue("ItemCode$", "2480-8-50")
retVal = oItemCost.SetKeyValue("WarehouseCode$", "000")
retVal = oItemCost.SetKeyValue("TierType$", "3")
retVal = oItemCost.SetKeyValue("GroupSort$", "101")
retVal = oItemCost.SetKey()
Works with Lot No's JAN10, MAR10, but fails on 101 and 10210. If I duplicate lot 10210 as A0210 it also works.
How does one force the construction of this key to use the given string for GroupSort?
Re: Need UDS technique for retrieving fields from IM_PriceCo de
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-17-2012 06:43 AM
Dan,
Please see my reply to your post of this issue on the Business Object Forum.
Thanks,
Kent


