Skip to main content

In Apps 10

 

Trying to create a custom menu on a business lead that searches for an address. If no address throw an error if an address exists then continue with conversion. Here is the code: 

DECLARE

lead_id_ varchar2(100)    := &LEAD_ID;
found_    number := 0;
   p0_ VARCHAR2(32000) := NULL;
   p1_ VARCHAR2(32000) := &LEAD_ID;
   p2_ VARCHAR2(32000) := &NAME;
   p3_ VARCHAR2(32000) := NULL;
   p4_ VARCHAR2(32000) := 'Prospect';
   p5_ VARCHAR2(32000) := NULL;
   p6_ VARCHAR2(32000) := '10';
   p7_ VARCHAR2(32000) := 'FALSE';
   p8_ VARCHAR2(32000) := 'TRUE';
   p9_ VARCHAR2(32000) := '*';

CURSOR get_add is 
select 1 from &AO.BUSINESS_LEAD_ADDRESS
where lead_id = lead_id_;

BEGIN 

open get_add;
fetch get_add into found_; 
close get_add; 

if found_ = 0 then 
error_sys.record_general('Sales Process' , 'Add an Address');

else

&AO.Business_Lead_API.Convert_Lead__(p0_,p1_,p2_,p3_,p4_,p5_,p6_,p7_ ,p8_,p9_);

end if; 

END;

 

I keep getting the error message

 

Hi lglover241,

First this is to check whether the Package got invalid, if yes may need to recompile it. Also you could try using the methods Error_sys.State_General and Error_sys.system_general, let us know the results.

 

Regards,

Kasun


Got the same error message only now says  Error_sys.system_general must be declared


Have you checked whether the Package Business_Lead_API got invalid? Better you do a recompile again and check the function.


If this doesn’t fix do you have any other suggestions? Is there a way to call the native menu using a custom menu? Appreciate the help


 

Like you do, using the PLSQL Block in custom menu is the option I see here.

Apart from Business_Lead_API, recompile the ERROR_SYS package as well and the let us know your results.

 

 

 

 


@Avindu Hendawitharana Please check whether you can add more here. Thanks


Hi  @lglover241,

Normally, PLS-00201: identifier XXX must be declared error is raised when the referenced package (Error_sys)does not exist, does not have execute permission or invalid as @Kasun Manuranga mentioned

To resolve this issue, first you need to check whether Error_sys package is invalid or not. If it is invalid, you need to recompile the package using SQL developer, PLSQL developer or by running below SQL queries.

ALTER PACKAGE <schema_name>.<package_name> COMPILE PACKAGE;
ALTER PACKAGE <schema_name>.<package_name COMPILE BODY;

If the package is not invalid, this should be a permission issue. Please check the database permissions to the Error_sys package and add them to the user you are using.

Thanks and Regards,
Avindu


added the &AO prefix to the statement and it works! Must’ve been a permissions issue. Thanks for the help!!! 


If you don’t have the &AO or the appowner in front it, oracle will look for the package in the users name space.

There are a few places in IFS that it assumes the appowner, but it’s generally needed when it’s executing as the user.


Any thoughts on how to get the original message to popup after running the script? The original menu 

But I don’t see anywhere in the code where this is written. 


My guess is that the customer number is coming back in the one of the parameters and then the UI is creating the message box.

 

 


Luke,

 

You’re other option would be to create a custom event based on a record being added or modified and then throwing an error if the address doesn’t exist. You would need to look at the code in the routine that does the conversion to figure out the best place to add the event.

 

-Lane