I’m trying to create a custom event when the wanted_delivery_date attribute is changed. I’ve set the following event details
Logical Unit: CustomerOrder Table: CUSTOMER_ORDER_TAB Fire When: Objects Are Changed Only when these attributes are changed: WANTED_DELIVERY_DATE Fire before or after object is changed: After
Attributes: Wanted_Delivery_Date New Value & Old Value, Order_ID Old Value.
When trying that code in the back end it works fine, however when doing it through IFS I get the following…
ORA-01861: literal does not match format string ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2070 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2070 ORA-06512: at line 9 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2066 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2075 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 1934 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 1954 ORA-06512: at "IFSAPP.EVENT_SYS", line 199 ORA-06512: at "IFSAPP.EVENT_SYS", line 199 ORA-06512: at "IFSAPP.S3_WNTD_DELIV_DATE_CHNG_EVU", line 14 ORA-04088: error during execution of trigger 'IFSAPP.S3_WNTD_DELIV_DATE_CHNG_EVU' ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16131 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16264 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16716 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 4472 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 4479 ORA-06512: at line 22 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2066 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_AP;
How do I resolve this?
Thanks & Kind Regards.
Page 1 / 1
Hi There,
I’m trying to create a custom event when the wanted_delivery_date attribute is changed. I’ve set the following event details
Logical Unit: CustomerOrder Table: CUSTOMER_ORDER_TAB Fire When: Objects Are Changed Only when these attributes are changed: WANTED_DELIVERY_DATE Fire before or after object is changed: After
Attributes: Wanted_Delivery_Date New Value & Old Value, Order_ID Old Value.
When trying that code in the back end it works fine, however when doing it through IFS I get the following…
ORA-01861: literal does not match format string ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2070 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2070 ORA-06512: at line 9 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2066 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2075 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 1934 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 1954 ORA-06512: at "IFSAPP.EVENT_SYS", line 199 ORA-06512: at "IFSAPP.EVENT_SYS", line 199 ORA-06512: at "IFSAPP.S3_WNTD_DELIV_DATE_CHNG_EVU", line 14 ORA-04088: error during execution of trigger 'IFSAPP.S3_WNTD_DELIV_DATE_CHNG_EVU' ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16131 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16264 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 16716 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 4472 ORA-06512: at "IFSAPP.CUSTOMER_ORDER_API", line 4479 ORA-06512: at line 22 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_API", line 2066 ORA-06512: at "IFSAPP.FND_EVENT_ACTION_AP;
How do I resolve this?
Thanks & Kind Regards.
@mjr86 Seems like the data format you are passing not comply with the data format which IFS required, can you pass the Date format (DD/MM/YYYY) to new wanted delivery date and check? seems like you are passing varchar2 into date use TO_DATE(p_new_wanted_delivery_date, ‘DD/MM/YYYY’)
BEGIN -- Get the current user making the change v_user_name := ifsapp.fnd_session_api.get_oracle_user;
-- Retrieve the latest row count for the given order number and increment by 1 to capture number of changes made to order SELECT NVL(MAX(CF$_CHANGE_ID), 0) + 1 INTO v_rowcount_ FROM IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLT WHERE CF$_ORDER_NUMBER = p_order_no;
-- Retrieve the most recent new wanted delivery date or set it to the original if none exists SELECT NVL(MAX(CF$_NEW_WNT_DELIV_DATE), p_old_wanted_delivery_date) INTO v_last_new_wnt_delivery_date FROM IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLT WHERE CF$_ORDER_NUMBER = p_order_no;
-- Calculate difference between old wanted delivery date and new wanted delivery date entered v_difference := p_new_wanted_delivery_date - v_last_new_wnt_delivery_date;
-- Proceed if the wanted delivery date has changed IF p_new_wanted_delivery_date != v_last_new_wnt_delivery_date THEN
-- New API IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLP.New__ ( info_, objkey_, objversion_, attr_cf_, action_ );
-- Commit the changes if the action is 'DO' IF action_ = 'DO' THEN COMMIT; END IF;
-- Below reads what's inserted above to figure out difference in dates
-- Capture the very first old wanted delivery date SELECT CF$_OLD_WNTD_DELIV_DATE INTO v_first_old_date FROM IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLT WHERE CF$_ORDER_NUMBER = p_order_no AND CF$_CHANGE_ID = 1;
-- Capture the most recent new wanted delivery date to work out original difference SELECT CF$_NEW_WNT_DELIV_DATE INTO v_new_date FROM IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLT WHERE CF$_ORDER_NUMBER = p_order_no AND CF$_CHANGE_ID = ( SELECT MAX(CF$_CHANGE_ID) FROM IFSAPP.S3_WANTED_DELIV_DATE_CHNG_CLT WHERE CF$_ORDER_NUMBER = p_order_no );
-- Original difference is the difference in days between first old wanted date and newest wanted delivery date required v_original_difference := v_new_date - v_first_old_date;
-- Populate CF$_ORGINAL_DIFFERENCE with above value of v_original_difference client_sys.add_to_attr ('CF$_ORGINAL_DIFFERENCE', v_original_difference, attr_cf_);
-- Commit the changes if the action is 'DO' IF action_ = 'DO' THEN COMMIT; END IF;
ELSE DBMS_OUTPUT.PUT_LINE('No change detected in wanted delivery date, no row inserted.'); END IF;
END wanted_del_date_change;
The Dates in Events are often (always) parsed as string literals, not dates, and they’re not passed with “DD/MM/YYYY” mask.
Just try to raise an error message in the event action showing what the date looks like; high likelihood it will be something like “18-FEB-24”, and not 18/02/2024.
Change the variables to varchar2 type, assign them the old & new values, then add error_sys.record_general( p_old_wanted_delivery_date, p_new_wanted_delivery_date); after you assign the value to the variable.
Depending on the result, you’ll be able to then work on the string literal and converting it to a date with the right mask.
Best practice is also not to do any explicit commit in your package code, because you risk commiting partial transactions if something else fails AFTER your trigger.
First thing to check is what data type you have on the WANTED_DELIVERY_DATE attribute in the event. You probably have “DATE” which is the default one:
If so the default date format for event actions is: YYYY-MM-DD
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
I’m not sure if it’s to do with the fact that on the Customer Order screen the wanted delivery date shows as “18/10/2024 00:00:00”, but when I check the debug console it’s shows as “2024-10-18-00.00.00”.
Then when I select * from customer_order_line_cfv where order_no = “my order”, the WANTED_DELIVERY_DATE is down as “18/10/2024”
Try to change the orange marked _ signs to : instead: