Question

Object connection - get information from NCR to Inventory part

  • 23 August 2022
  • 2 replies
  • 159 views

Badge +3

Hello,

i would like to get information from inventory part view throught object connection NCR x Inventory part.

I have this connection in one NCR case:

Now i have only information about site and part_no. But i want create new customfield for get more information from INVENTORY_PART like TYPE_CODE, HAZARD_CODE etc.

Does anyone have experience with a similar sql select?

Thanks for answer.

 

2 replies

Userlevel 3
Badge +8

You can use the debug window (ctrl shift & d) to display the queries happening behind the scenes.  In this case there’s a view called NCR_OBJECT_CONNECTION_DETAIL which supplies the values to that window.  I took a quick look at my system, and found that it’s not just inventory parts that can end up here, but purchase orders, RMA’s etc.  Trying to create a custom field could be tricky on such a moving target, and you’d probably need a few case statements to allow for the different types...

 

You can right click the object line, and select “object details” which will take you to the associaated object if that helps.

 

Badge +3

Hello, we find the solution how get keys from the object connection. For example i want get PART_NO from the object connection key by get_key funcion.

 

Client_SYS.Get_Key_Reference_Value(x.key_ref,  'PART_NO')

and there is example of my select depanding on the type of the connected LU_NAME.

 

 

select case
         when x.lu_name = 'InventoryPart' then
          Client_SYS.Get_Key_Reference_Value(x.key_ref, 'PART_NO')
         when x.lu_name = 'ReceiptInfo' then
          RECEIPT_INFO_API.Get_Source_Part_No(Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                                 'RECEIPT_SEQUENCE'))
         when x.lu_name = 'ShopOrd' then
          SHOP_ORD_API.Get_part_no(Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'ORDER_NO'),
                                   Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'RELEASE_NO'),
                                   Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'SEQUENCE_NO'))
         when x.lu_name = 'ShopMaterialAlloc' then
          SHOP_ORD_API.Get_part_no(Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'ORDER_NO'),
                                   Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'RELEASE_NO'),
                                   Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'SEQUENCE_NO'),
                                   Client_SYS.Get_Key_Reference_Value(x.key_ref,
                                                                      'LINE_ITEM_NO'))
                                                             
                                                                      
       end
  from NCR_OBJECT_CONNECTION_DETAIL x
 where x.ncr_no = :NCR_NO
 

 

 

 

Reply