Skip to main content
Solved

How to use custom field method with argument?


Forum|alt.badge.img+10

Hi! Is there anybody can help me?

I use IFS8. We need input production surface arer information to Inventory Part. So I create a custom field under LU InventoryPart. Field Type is persistent. Name is “SURFACE_AREA”.  It generates the method 'Inventory_Part_cfp.Get_cf$_Surface_rea’. It works right, user can keyin number into this field.

I need create quick report with this field so that users can see this number.

Followed SQL Statement works right.

select a.part_no, a.contract, b.cf$_surface_area area, 
from inventory_part_tab a left join  inventory_part_cft b on a.rowkey=b.rowkey

 

I want use SQL Statment with method Inventory_Part_cfp.Get_cf$_Surface_rea. It should be like 

select a.part_no, a.contract, inventory_part_cfp.Get_Cf$_Surface_Area(a.part_no, a.contract)
from inventory_part_tab a 

But it doesn’t work. There is no argument for this method. How can I set  part_no and contract as arguments for this method?

 

 

Best answer by SNBSHAN

"Instead of passing contract and part_no, it's better to pass rowkey as a parameter since a persistent field is already created. For example:
SELECT a.part_no, a.contract, inventory_part_cfp.Get_Cf$_Surface_Area(a.rowkey) FROM inventory_part_tab a."

If you're using a table, you can pass rowkey, and for a view, you can pass objkey—both represent the same value.
For example:
SELECT a.part_no, a.contract, inventory_part_cfp.Get_Cf$_Surface_Area(a.objkey) FROM inventory_part a.

 

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+6
  • Sidekick (Customer)
  • 17 replies
  • Answer
  • May 23, 2025

"Instead of passing contract and part_no, it's better to pass rowkey as a parameter since a persistent field is already created. For example:
SELECT a.part_no, a.contract, inventory_part_cfp.Get_Cf$_Surface_Area(a.rowkey) FROM inventory_part_tab a."

If you're using a table, you can pass rowkey, and for a view, you can pass objkey—both represent the same value.
For example:
SELECT a.part_no, a.contract, inventory_part_cfp.Get_Cf$_Surface_Area(a.objkey) FROM inventory_part a.

 


COVJAMIEB
Hero (Partner)
Forum|alt.badge.img+11
  • Hero (Partner)
  • 218 replies
  • May 23, 2025

Assumption is the parameters arent contract and part_no, should be objkey.

 

Can you not change to,

 

select part_no, contract, Cf$_Surface_Area
from inventory_part_cfv


Manulak
Hero (Customer)
Forum|alt.badge.img+8
  • Hero (Customer)
  • 89 replies
  • May 23, 2025

You don’t need to write API calls explicitly as long as it's a custom field. The custom fields are already included in the <base_view>_CFV

 

In your example, you should see the field if you query INVENTORY_PART_CFV.

select a.part_no, a.contract, a.cf$_surface_area area from inventory_part_CFV a

In addition, try your best to not to query tables (*_TAB) but always go with the views. That’s due to many reasons including performance, data integrity, security as well as consistency. In addition, VIEWS are the predefined sources for reporting purposes in IFS terminology. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings