i need to update some columns on the screen “Incoming Customer Order”.
And I use this API: EXTERNAL_CUST_ORDER_LINE_API.MODIFY__(info_ , objid_, objversion_, attr_, action_)
How can I set the parameters “info” and “objid”?
What values does it expect here?
I can’t find them in the table “EXTERNAL_CUST_ORDER_LINE_TAB”
Page 1 / 2
The info_ parameter is only an OUT parameter meaning that it only returns a value so it should not have any value when you call it, make it 2000 characters long.
The objid_ parameter is the ROWID from the table, the unique identifier of the record you want to modify.
Hi @Tomas Ruderfelt
that means info_ can be NULL?
But why doesn’t the column ROWID in the table “EXTERNAL_CUST_ORDER_LINE_TAB” exist?
Thank you.
Yes, you do not need to initialize the variable info_, just declare it like: info_ VARCHAR2(2000);
All tables have a ROWID pseudocolumn which is not shown when you describe it, try to do a query like this:
SELECT rowid
FROM external_cust_order_line_tab
More info from Oracle SQL documentation about ROWID:
Be carreful, as metionned in my previous post as a comment,
Client_SYS.Clear_Attr(attr_);
is here to erase the content of attr_, so it’s same as if you do
attr_ := ‘’ ;
Hi @Link
To modify a record. You must know the objid and the obversion of the record. You can get this information from view. After that, fill the attr with columns and values. You can see an example below.
DECLARE info_ VARCHAR2(32000); objid_ VARCHAR2(32000); objversion_ VARCHAR2(32000); attr_ VARCHAR2(32000); BEGIN
SELECT t.objid, t.objversion INTO objid_, objversion_ FROM fnd_user t WHERE t.identity = 'DUMMY_USER';
Just once at the beginning is going to be enough. If you clear again, you will lose the info before. However, If you change multiple records. You need the clear the attr.
Hi @hhy38
it is a nice example.
client_sys.add_to_attr('ACTIVE', 'FALSE', attr_);
For what purpose do I need this method?
What do the first and second parameters mean?
Just once at the beginning is going to be enough. If you clear again, you will lose the info before. However, If you change multiple records. You need the clear the attr.
My goal is to change multiple records. That means I need to clear the attr again.
Many thanks for the valuable information. :-)
@Link
You are welcome
Let me explain simply. Attr is a varchar variable. It is used to send the data to the database. We fill the attr with column values with the add_to_attr procedure. After sending this. The APIs unpack the attr and insert it into tables.
The first parameter is the column in the table that you want to update.
The second parameter is the new value of the column.
If you want to change multiple records. You should use a loop. There is an example below.
DECLARE info_ VARCHAR2(32000); objid_ VARCHAR2(32000); objversion_ VARCHAR2(32000); attr_ VARCHAR2(32000); BEGIN FOR rec_ IN (SELECT t.objid, t.objversion FROM fnd_user t WHERE t.identity IN ('username1','username2','username3')) LOOP client_sys.clear_attr(attr_); client_sys.add_to_attr('ACTIVE', 'FALSE', attr_); fnd_user_api.modify__(info_, rec_.objid, rec_.objversion, attr_, 'DO'); END LOOP; END;
Hi guys,
many thanks for helping. The code works in PLSQL. But in IFS I get the following error message:
My code:
Why is the record locked?
@Link Hi,
Can you the plsql block? Writing from screenshots is hard. :)
how can I send the above code as a background job?
I’ve intergrated the second code in my event. I don’t get any error messages but the values didn’t change.
@Link
I explained everything in my post, you just have to transfer your code into your custom procedure
You already sent it with this code. If there is no change. There should be an error in background jobs. You can search with description. And check the error text.
ifsapp.transaction_sys.deferred_call(job_id_, 'Fnd_Event_Action_API.Action_Executeonlinesql', 'PARAMETER', attr_, 'Geri plan Tanımı');
You already sent it with this code. If there is no change. There should be an error in background jobs. You can search with description. And check the error text.
ifsapp.transaction_sys.deferred_call(job_id_, 'Fnd_Event_Action_API.Action_Executeonlinesql', 'PARAMETER', attr_, 'Geri plan Tanımı');
OK, I got it. But now I have > 100 jobs. Every second. And it calculate the value n times until zero. :-)
@Link
I explained everything in my post, you just have to transfer your code into your custom procedure
Thank you @romsar I will test this process also.
@Link Please disable the Event. After that, check one of them. This is an important point. If there are a lot of jobs in the background. Your system can slow down or even crash.
@Link You should do this in your test environment. Please don't do it in your production environment. :)