Solved

How can we use custom Database methods for Object Connection Transformations ?

  • 1 October 2019
  • 3 replies
  • 474 views

Userlevel 7
Badge +18
Object Connection Transformation provides the means to support object connections to be accessed from business objects other than the ones to which they are connected. In order to do so we have to specify an object transformation method. For some scenarios it is not possible to map the target and source columns due to the fact that the source columns are not included in the target database view. Therefore how can we use custom Database methods for Object Connection Transformations ?
icon

Best answer by Amila Samarasinghe 1 October 2019, 11:15

View original

3 replies

Userlevel 6
Badge +14
For an Object connection Transformation to work, we must find columns in Target LU that fulfill all the keys in the Source LU. If we do not fulfill all the keys on the Source side, it means we cannot find the Source object, and the rule will not work.

As you mentioned, there can be cases where you cannot find related columns in Target and Source which will fulfill above requirement, so you must use a database method to find the Source object. You can either develop a method yourself in a customization package or use one of the predefined ones that IFS has already provided. The method should be a function that returns a keyref for the source object.

You can simply follow below steps to see if your custom method will correctly work
1. Select or create an object from Source LU and find related object in Target LU.
2. Connect a document to Target LU and in Database, find out key_ref value in Doc_Reference_Object_Tab for this document (search for doc_no of the document connected)
3. Do the same as step 2 on Source
4. Now you have two key_ref values, one from Target LU and one from Source LU. Execute the method in the Database passing your Target key_ref and see if it returns Source key_ref. If it do, Voila! Your custom method works 😀

PS - It is possible to handle multiple Source objects from same database method. Ex. Show all the documents connected to Customer Order Lines when you are on the Order header.

In this case, your custom method should return a list of source keyref's. Use method
code:
Obj_Connect_Lu_Transform_API.Add_To_Source_Key_Ref_List

inside a loop to add all the source keyref's to one single list.

Note – Always be mindful about the no of documents connections it will return as Oracle varchar2 variable limits to 32K characters.
Userlevel 1
Badge +4

How will i pass the values for relevant target key references as parameters to my custom method.

Userlevel 7
Badge +30

How will i pass the values for relevant target key references as parameters to my custom method.

It is done automatically. You just need to deploy your custom API and/or custom method and it needs to take the exact parameters as defined by the documentation.

 

Reply