Question

Print Manager error message An item with the same key has already been added.


Userlevel 5
Badge +10

I’m getting an error in Print Manager, (An item with the same key has already been added) but the report is still printing. What would cause this? If i print through ‘Order Report’ I don’t get the error. I ger the error if I print using  RMB sql action or when I print using an event trigger sql action. It happens now on two different reports with different views. Has anybody else seen this error when printing?

Thank you,


11 replies

Userlevel 7
Badge +17

Hi @arebbeadle,

I believe you are using a custom menu to order the report? Could you please attach a screenshot of how you are trying to print the report when you receive the error? Also, please let us know your application version and the update version as well.

 

Userlevel 5
Badge +10

We are using IFSAPPS 10 Update 11,

This is the menu SQL

 

DECLARE 
result_key_ Number; 
pr_attr_ varchar2(2000); 
attr_ varchar2(2000);
report_id_ varchar2(2000);
job_id_ number; 
par_attr_ varchar2(2000);
XSO varchar(12):= &ORDER_NO;
XREL varchar(4):= &RELEASE_NO;
XSEQ varchar(4):= &SEQUENCE_NO;
site_ varchar2(5):= &CONTRACT;
BEGIN 
report_id_ := 'ARE_PART_ORDER_INFO_TAG_REP';
Client_SYS.Add_To_Attr('PRINTER_ID', 'DD1REARDOOR',pr_attr_);
Client_SYS.Add_To_Attr('EXPIRE_DATE',sysdate+30,pr_attr_);
Print_Job_API.New(job_id_,pr_attr_);
Client_SYS.Add_To_Attr('REPORT_ID',report_id_,pr_attr_);
Client_SYS.Add_To_Attr('LAYOUT_NAME', 'DD1_RearDoorLabel_2022.rpt', pr_attr_);
Client_SYS.Clear_Attr(par_attr_);
Client_SYS.Add_To_Attr('CONTRACT', site_,par_attr_);
Client_SYS.Add_To_Attr('ORDER_NO', XSO,par_attr_);
Client_SYS.Add_To_Attr('REL_NO', XREL,par_attr_);
Client_SYS.Add_To_Attr('LINE_NO', XSEQ, par_attr_);
Archive_API.New_Instance(result_key_,pr_attr_,par_attr_);
Client_SYS.Clear_Attr(attr_);
Client_SYS.Add_To_Attr('PRINT_JOB_ID', job_id_, attr_);
Client_SYS.Add_To_Attr('RESULT_KEY', result_key_, attr_);
Print_Job_Contents_API.New_Instance(attr_);
Print_Job_API.Print(job_id_);
commit;
END;

Userlevel 7
Badge +17

Hi @arebbeadle,

Could you please try the following and see if that resolves the issue?

 

a. Close all opened IFS applications.
b. Open a command prompt and execute the below command.
c. rundll32 dfshim CleanOnlineAppCache
d. Restart the user’s PC

 

Userlevel 5
Badge +10

Hi Himasha,

The command line process did not resolve the issue.

 

Userlevel 7
Badge +17

Hi @arebbeadle,

Could you please run the sql in the attached document to see what the outcome is?

 

Userlevel 5
Badge +10

Himasha,

Thank you but I don’t see how this script will help. It states- Purpose:    This script lists custom menus with action type 'Create Window with Transfer' where 'Source Key Name' of Key Translations are duplicated.

 

My custom menu is creating a Print job executing a SQL script not a 'Create Window with Transfer'. Will it still help to run the script?

 

Userlevel 7
Badge +17

Hi @arebbeadle,

 

Since you are getting the error ‘An item with the same key has already been added.’, the script will help you in identifying the duplicated source key names. Please ignore the action type stated there as this is something we reuse and the outcome is not filtered with the action type. 

 

Userlevel 5
Badge +10

Ok, I will run the script and post results if possible.

Userlevel 5
Badge +10

 

I attached the log but it has errors. We are running APPS10 UPD 11.

 

      FROM custom_menu_key_trans_tab t,custom_menu_tab m
                                       *
ERROR at line 4:
ORA-06550: line 4, column 40: 
PL/SQL: ORA-00942: table or view does not exist 
ORA-06550: line 3, column 7: 
PL/SQL: SQL Statement ignored 
ORA-06550: line 18, column 42: 
PLS-00364: loop index variable 'REC' use is invalid 
ORA-06550: line 18, column 7: 
PL/SQL: Statement ignored 
 

Userlevel 7
Badge +17

Hi @arebbeadle,

 

I have extracted the SQL query below from the attached script. Please run it and let us know the outcome.

SELECT t.menu_id,m.window,t.source_key_name, count(t.source_key_name)
FROM custom_menu_key_trans_tab t,custom_menu_tab m
WHERE t.menu_id = m.menu_id
GROUP BY t.menu_id,m.window,t.source_key_name
HAVING COUNT (t.source_key_name) > 1;


 

 

Userlevel 5
Badge +10

No results returned,

 

Reply