Skip to main content

We are trying to make our Functional Object ID (aka mch_code) be an auto incremented field.  Does anyone know how to do this or if it is at all possible?  Maybe with control - datasource or something in Page Designer?  I am not having much luck looking for help or examples in existing posts.

@Frank H normally the mch_code is a free text field so that users could define their own values.

However at DB level, there’s a DB sequence EQUIPMENT_OBJECT_SEQ which is global (across all sites) and shared between serial objects and functional objects. This sequence is increased everytime a new FO or Serial Object is created and the value is stored in Equipment_Object_Seq field in the equipment_object_tab table.

What you could do is the following:

  • custom event on creation of new FO to get EQUIPMENT_OBJECT_SEQ.currval + 1 and modify the mch_code with the number that you get by colling the sequence +1
  • modification:
    • create your own DB sequence
    • modify the Equipment_Object_API.New to take the next number from your own defined sequence and put it in the mch_code field.

You would need quite a bit of IFS technical knowledge to pull off any of these options.


Reply