Inventory management

SOLVED

I'm using "sage 100 Standard 2019" and Version "6.10.0.0"


I tried to get "Item Maintenance details" from Inventory Management -> Item Maintenance.

I'm able to get 'Item code value' and 'Qty values(pl refer screenshot1)', but I need to get values as mentioned based on the screenshot2.
Currently, I tried IM_ItemWarehouse_bus, but i am not able to get the required details. Can you pl guide/help what bus I need to use or pl guide/help how to get values as mentioned screenshot2

 screenshot1:

screenshot2:

  • 0
    SUGGESTED

    If you are not setting values (modifying records), use the *_SVC objects instead.

    Refer to the online file layouts and object reference to see which fields exist in each table.

    https://help-sage100.na.sage.com/2019/FLOR/index.htm

    You need data from CI_Item (may also need CI_ExtendedDescription if you want extended descriptions) and IM_ItemWarehouse.

    https://help-sage100.na.sage.com/2019/FLOR/index.htm#File_Layouts/Common_Information/CI_Item.htm

    https://help-sage100.na.sage.com/2019/FLOR/index.htm#File_Layouts/Inventory_Management/IM_ItemWarehouse.htm

    You can use CI_ItemCode_Svc and IM_ItemWarehouse_Svc to read the values for each field.

    For the extended description. Using the CI_ItemCode_Svc object, you can use GetChildHandle and pass it "ExtendedDescriptionKey" to get a handle to CI_ExtendedDescription_Svc. Before doing so, you may want to call the ReadAdditional method on CI_ItemCode_Svc and pass it "ExtendedDescriptionKey", this will make sure the CI_ExtendedDescription_Svc object is placed on the correct record.

    https://help-sage100.na.sage.com/2019/FLOR/index.htm#File_Layouts/Common_Information/CI_ExtendedDescription.htm

    https://help-sage100.na.sage.com/2019/FLOR/index.htm#Object_Reference/CI/CI_ExtendedDescription_svc.html

  • 0 in reply to David Speck

    Hello David Speck,
    :) Thank you for helping and suggestions. I used CI_ItemCode_Svc business object to get Miscellaneous items value. I succeed here.
    Also, I used IM_ItemWarehouse_Svc business object, but not able to get the Item maintenance (Desc, Total (QtyOnHand, QtyOnPO, QtyOnSO), UOM, Sales Price, Purchases Cost) values.

    I tried most of the business object but not able to get the Item Maintenance values (Desc, Total (QtyOnHand, QtyOnPO, QtyOnSO), UOM, Sales Price, Purchases Cost) & not able to find a solution. Please suggest the correct way of achieving my result.

    https://help-sage100.na.sage.com/2019/FLOR/index.htm#Program_Listings/imprograms.htm%3FTocPath%3DProgram%2520Listings%7C_____20

  • 0 in reply to Manavallan
    SUGGESTED

    Review the file layout links i included previously to make sure your field names are correct. One that stands out is UnitOfMeasure, the actual field name is StandardUnitOfMeasure.

    You can not use a single object to get all the values you are after. You must use CI_ItemCode_Svc to get the fields in CI_Item and IM_ItemWarehouse_Svc to get the fields in IM_ItemWarehouse.

    Also, i'm not sure what you are doing with the GetDataObject and GetNumericDataObject methods as i'm unfamiliar with them but looking at them doesn't seem like they are doing what they need to.

    All of sage 100 *_Svc objects have a method called GetValue, the *_Bus objects have an additional method called SetValue. For numeric fields, you do not add the trailing $ to the field name in the first argument, for string fields, you must add the trailing $ to the field name in the first argument.

    For SetValue you can pass a literal value or a variable containing a value of the correct data type for the field in second argument and for some fields, you can pass an alternate index as the third argument.

    For GetValue, you have to pass a variable in the second argument to receive the value of the field in. This variable needs to first have been initialized with the correct data type for the field's who value it is going to receive. Numeric fields should be initialized to 0 and string fields should be initialized to a blank string (""). Sage 100 methods do not support the variant data type.

  • 0 in reply to David Speck

    Hello David Speck,

    :) Thank you for helping,


    I used and tried CI_ItemCode_Svc and layout link ( https://help-sage100.na.sage.com/2019/FLOR/index.htm#File_Layouts/Common_Information/CI_Item.htm ), so i am able to get only the Common Information -> Miscellaneous Item Maintenance screen values.

    Actually I need to get all the Inventory Management -> Item Maintenance(Please see the below screenshot) - All the Item list values(Item Code, Desc, Total (QtyOnHand, QtyOnPO, QtyOnSO), UOM, Sales Price, Purchases Cost)

    So, i checked IM_ItemWarehouse_Svc and layout link (  https://help-sage100.na.sage.com/2019/FLOR/index.htm#File_Layouts/Inventory_Management/IM_ItemWarehouse.htm ), but i did not get all the required values and also i tried with various related layout link but not able to find the expected result.

    I added GetDataObject, GetDataNumericObject functions screen short. It was same as GetValue functions

       

    Please see the below screenshot, I use IM_ItemWarehouse_Svc to get Item code values since I don't know the correct data type name, so I have commended lines & set it as a blank string (""). please suggest what are the layouts to be used, to get all Item list(Item Code, Desc, Total (QtyOnHand, QtyOnPO, QtyOnSO), UOM, Sales Price, Purchases Cost)

  • 0 in reply to Manavallan

    The CI_Item table contains both miscellaneous items and standard inventory items. The ItemType field determines which UI task is used to maintain the record. "Regular Item" is maintained with Item Maintenance, all others are maintained with Miscellaneous Item Maintenance.

    CI_ItemCode_Svc will read all records in CI_Item, unless you put a browse filter on it with an alternate index specified for ItemType.

    You CANNOT get values from the CI_Item table using the IM_ItemWarehouse_Svc object. It isn't gonna happen. Each *_Svc or *_Bus class object only reads data from it's primary/main table. There are some cases where an object will create instances of child handles for related tables and you can use the GetChildHandle method to retrieve the object handle and use the returned object handle to read values from its table.

    In this example, i've started a new object for CI_ItemCode_Svc and then moved to the first record, displayed its key, then moved to the last record and displayed its key. You can see how both a miscellaneous item and regular item have been read.

    I don't know C# all that well so i don't really understand what your custom methods are doing without really drilling down into them.

    However, sage 100's will store numeric fields with a maximum value of 99,999,999.9999 so you should not be defaulting/converting all numeric values to Int32 which is what your custom method appears to be doing. Double, Float, or Decimal is what you should be using, IIRC, i use use Double in my VBScripts.

  • +1 in reply to David Speck
    verified answer

    Also, if you do use a *_Bus object, they usually have child handles to a limited set of related tables.

    You can view which child handles are available for any given table by using "User-Defined Field and Table Maintenance". Add a new field to the target table, then given it a throw-away name. Select "Business Object" from the "Source" radio options. Then click the dropbox for the "Data Source". Each value listed can be passed as the first argument to the target table's *_Bus object handle's GetChildHandle method.

    Here's more info on the related methods.

    So you could use IM_ItemWarehouse_Bus, read your IM_ItemWarehouse record, use IM_ItemWarehouse_Bus.ReadAdditional("ItemCode"), then get the child handle for "ItemCode", this will give you the handle to CI_ItemCode_Svc and you can then use it to get values from CI_Item.