Other ERPsFree generatorPDF, Excel, Word exportIFS ApplicationsAll IFS Applications tools

IFS Applications 10 PL/SQL API Call Generator for New__ and Modify__

This generator writes anonymous PL/SQL blocks that call an IFS Applications 9 or 10 logical unit API (New__ and Modify__) with a Client_SYS attribute string, the same path the client uses. Paste the output into the SQL Query Tool, IFS Developer Studio, SQL Developer or a custom event action to test a create or update without touching the tables directly.

Fill in

The <LU>_API package, e.g. Customer_Order_API, Purchase_Order_API, Inventory_Part_API.

The LU view that exposes OBJID and OBJVERSION, used to fetch the keys for Modify__.

CHECK validates without saving, DO validates and writes. Start with CHECK.

Generated code
Download:

1. Show the default attributes (PREPARE)

SET SERVEROUTPUT ON

DECLARE
   info_       VARCHAR2(32000);
   objid_      VARCHAR2(2000);
   objversion_ VARCHAR2(2000);
   attr_       VARCHAR2(32000);
BEGIN
   Client_SYS.Clear_Attr(attr_);
   Customer_Order_API.New__(info_, objid_, objversion_, attr_, 'PREPARE');
   -- attr_ now holds the default values the client would show on a new record.
   -- CHR(31) separates name from value, CHR(30) ends each item.
   Dbms_Output.Put_Line(REPLACE(REPLACE(attr_, CHR(31), ' = '), CHR(30), CHR(10)));
END;
/

2. Create a record with New__

DECLARE
   info_       VARCHAR2(32000);
   objid_      VARCHAR2(2000);
   objversion_ VARCHAR2(2000);
   attr_       VARCHAR2(32000);
BEGIN
   -- Start from the defaults, then add your values (a later item in attr_ overrides an earlier one).
   Client_SYS.Clear_Attr(attr_);
   Customer_Order_API.New__(info_, objid_, objversion_, attr_, 'PREPARE');

   Client_SYS.Add_To_Attr('CONTRACT', '1', attr_);
   Client_SYS.Add_To_Attr('CUSTOMER_NO', 'CUST100', attr_);
   Client_SYS.Add_To_Attr('WANTED_DELIVERY_DATE', TO_DATE('2026-11-30', 'YYYY-MM-DD'), attr_);

   Customer_Order_API.New__(info_, objid_, objversion_, attr_, 'CHECK');

   Dbms_Output.Put_Line('info: ' || info_);
   Dbms_Output.Put_Line('objid: ' || objid_ || '  objversion: ' || objversion_);
   -- Returned attr_ carries generated keys (for example ORDER_NO):
   Dbms_Output.Put_Line(REPLACE(REPLACE(attr_, CHR(31), ' = '), CHR(30), CHR(10)));
   -- COMMIT;
END;
/

3. Update a record with Modify__

DECLARE
   info_       VARCHAR2(32000);
   objid_      VARCHAR2(2000);
   objversion_ VARCHAR2(2000);
   attr_       VARCHAR2(32000);
BEGIN
   SELECT objid, objversion
     INTO objid_, objversion_
     FROM CUSTOMER_ORDER
    WHERE order_no = 'C12345';

   Client_SYS.Clear_Attr(attr_);
   Client_SYS.Add_To_Attr('WANTED_DELIVERY_DATE', TO_DATE('2026-11-30', 'YYYY-MM-DD'), attr_);

   Customer_Order_API.Modify__(info_, objid_, objversion_, attr_, 'CHECK');

   Dbms_Output.Put_Line('info: ' || info_);
   Dbms_Output.Put_Line('new objversion: ' || objversion_);
   -- COMMIT;
END;
/

Run as an IFS end user that has been granted the API through permission sets, not as the IFSAPP owner writing directly, and never INSERT or UPDATE the *_TAB tables. Attribute values for enumerations are client values unless you use the _DB attribute variant; check which one the LU expects. Mandatory attributes differ by LU and by configuration, so run block 1 first and debug a manual entry in the client to see the real attribute list. Test in a non-production instance and keep COMMIT commented until CHECK passes.

Get your IFS API block reviewed

Send the LU and the record you need to create or change and we will check the attribute list and action sequence against your Apps 9 or 10 update level.

Optional. The tool and every export work without this. No spam.

Was this tool useful?

How to use it

Enter the API package (for example Customer_Order_API), its base view, and up to three attributes. Block 1 calls New__ with the action PREPARE, which returns the default values the client would show on a blank record, and prints them one per line. Block 2 starts from those defaults, appends your values with Client_SYS.Add_To_Attr and calls New__ with CHECK or DO. Block 3 fetches OBJID and OBJVERSION from the view for one record and calls Modify__. Keep the action on CHECK until the block runs clean: CHECK runs the validations without writing, DO validates and writes. COMMIT is commented out on purpose so you can roll back while testing.

  • Run block 1 first to see which attributes the LU fills by default
  • Use CHECK, read info_, then switch to DO
  • Uncomment COMMIT only in a test instance you are allowed to change

The method: attr_ strings and the five-parameter signature

In IFS Applications every logical unit exposes New__ (info_, objid_, objversion_, attr_, action_) and Modify__ (info_, objid_, objversion_, attr_, action_). The attr_ string is a list of name and value pairs: CHR(31) separates a name from its value and CHR(30) ends each pair. Client_SYS.Clear_Attr empties it and Client_SYS.Add_To_Attr appends a pair, with overloads for text, numbers and dates, so a DATE goes in without string conversion. On return attr_ carries values the server set, such as a generated ORDER_NO. Modify__ needs the row's OBJID and current OBJVERSION; if someone changed the record after you read it, the call fails with a 'modified by another user' error instead of overwriting their change.

Worked example: customer order header

With the defaults, block 2 prepares a Customer_Order_API record, adds CONTRACT = 1, CUSTOMER_NO = CUST100 and WANTED_DELIVERY_DATE = 2026-11-30, and runs CHECK. If info_ comes back empty and no error is raised, the header would be valid. Switching to DO creates it and the printed attr_ shows the new ORDER_NO. Block 3 then moves the wanted delivery date on order C12345 by changing only that one attribute: Modify__ ignores attributes you do not send. Real order headers often need more, for example an order type or coordinator, depending on site defaults, which block 1 reveals.

Gotchas in Apps 9 and 10

Do not write to CUSTOMER_ORDER_TAB or any *_TAB table: you would skip the business logic, history and events. Enumeration attributes accept client values, which can be translated; the _DB variants (for example a STATE_DB style attribute where the LU offers it) are language independent. When you cannot work out an attribute name, turn on debug in the client while saving the record manually and read the attr_ that the client sends. Custom fields on an LU travel in a separate CF$_ structure through the custom fields API, not in the base attr_. On Apps 10 with Aurena the server logic is the same, so these blocks still apply.

Frequently Asked Questions

What is IFS Applications 10?

IFS Applications 10 is the on-premises ERP release from IFS that preceded IFS Cloud. It runs on an Oracle database with PL/SQL business logic organised in logical units, each with an _API package, and offers the Enterprise Explorer client and, from later updates, the Aurena web client. Code built on New__ and Modify__ works the same way in Apps 9 and 10.

What does PREPARE do in an IFS New__ call?

PREPARE asks the logical unit to fill attr_ with the default values for a new record, the same defaults the client shows when you press New. It does not insert anything. Use it to discover which attributes the LU fills automatically, then add your own values and call New__ again with CHECK or DO.

Why does my New__ call fail with a mandatory field error?

The LU validates every mandatory attribute during CHECK and DO. If you built attr_ from scratch with Clear_Attr you may be missing values the client normally defaults. Start from PREPARE as block 2 does, read the error text in the raised message, and add the missing attribute. Site and company settings can change which fields are required.

Can I use these blocks in a custom event action?

Yes, the same API calls work in an event action of type Execute Online SQL, but be careful: the action runs inside the triggering transaction, so do not COMMIT there, and avoid modifying the same LU that fired the event or you can loop. Test with CHECK first and keep the logic small.

If your team wants to ask IFS Applications questions in plain English on your own servers, with any write going through these APIs only after a person approves it, we can set that up.

ArchRay builder
Design the on-prem AI stack for IFS Applications: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring

Free tools

ERP fixes and how-tos

AI on your ERP

Integrations

Software