Question

Custom Event Project to Project Totals tab - Access denied

  • 16 June 2022
  • 4 replies
  • 156 views

Userlevel 3
Badge +6

Hey everyone, 

I am creating a custom event on the Project screen that will make the Project Totals tab ‘Manual POC’ field an automatic zero is a Project is in a certain Project Group. This is dictated by a custom field checkbox. 

I have debugged the ‘DO’ action of the Manual POC field and it requires (info_, objid_,objversion_,attr_,’DO’) 

In attr it requires Company, Project_id, Ledger_id(That is always ‘*’), Manual_POC(That will always be ‘0’ when this action runs). 

I have created the action to run after the Accounting_Project table gets a new Project_id, Company, and Project_group data. Once that fires off the action does the below:

 

DECLARE

company_ VARCHAR2(32000) := '&NEW:COMPANY';
project_group_ VARCHAR2(32000) := '&NEW:PROJECT_GROUP';
project_id_ VARCHAR2(32000) := '&NEW:PROJECT_ID';
cf$_manual_poc_ VARCHAR2(32000);
ledger_id_ VARCHAR(32000) := '*';
attr_ VARCHAR2(32000);

CURSOR c_get_cf$_manual_poc IS
SELECT CF$_MANUAL_POC
FROM PROJECT_GROUP_TAB LEFT JOIN PROJECT_GROUP_CFT
ON PROJECT_GROUP_TAB.ROWKEY = PROJECT_GROUP_CFT.ROWKEY
WHERE COMPANY = company_
AND PROJECT_GROUP = project_group_;


BEGIN


--ERROR_SYS.Record_General('EPT-Custom' || CHR(13), 'Company: ' || company_ || 'Project Group: ' || project_group_ || 'Project Id: ' || project_id_); --Displayed

OPEN c_get_cf$_manual_poc;
FETCH c_get_cf$_manual_poc INTO cf$_manual_poc_;
CLOSE c_get_cf$_manual_poc;



--ERROR_SYS.Record_General('EPT-Custom' || CHR(13), 'Manual POC: ' || cf$_manual_poc_); --Displayed

IF cf$_manual_poc_ IS NOT NULL AND cf$_manual_poc_ = 'TRUE' THEN

-- ERROR_SYS.Record_General('EPT-Custom' || CHR(13), '0 will be entered into Manual POC% field.' || attr_); --Displayed
Client_SYS.Clear_Attr(attr_);
Client_SYS.Add_To_Attr('COMPANY_', company_, attr_);
Client_SYS.Add_To_Attr('PROJECT_ID_', project_id_, attr_);
Client_SYS.Add_To_Attr('LEDGER_ID_', ledger_id_, attr_);

TRANSACTION_SYS.Deferred_Call('EPT_EC_UTILITY_API.Update_Prj_Totals_Man_POC_To_0', attr_, 'Insert 0 into Manual POC% field for Project ' || project_id_);

END IF;

END;

Then the background job kicks off and does this:

 

PROCEDURE Update_Prj_Totals_Man_POC_To_0 (
attr_in_ IN VARCHAR2
)

IS

company_ VARCHAR2(32000) := Client_SYS.Get_Item_value('COMPANY_', attr_in_);
project_id_ VARCHAR2(32000) := Client_SYS.Get_Item_value('PROJECT_ID_', attr_in_);
ledger_id_ VARCHAR2(32000) := Client_SYS.Get_Item_value('LEDGER_ID_', attr_in_);
info_ VARCHAR2(32000);
objid_ VARCHAR2(32000);
objversion_ VARCHAR2(32000);
attr_ VARCHAR2(32000);
action_ VARCHAR2(3):='DO';

--CURSOR c_get_prj_totals IS
--SELECT OBJID, OBJVERSION
--FROM project_totals
--WHERE PROJECT_ID = project_id_
--AND COMPANY = company_;



BEGIN

--OPEN c_get_prj_totals;
--FETCH c_get_prj_totals INTO objid_, objversion_;
--CLOSE c_get_prj_totals;



Client_SYS.clear_attr(attr_);
Client_SYS.add_to_attr('MANUAL_POC', 0, attr_);
--ERROR_SYS.Record_General('EPT-Custom' || CHR(13), '0 will be entered into Manual POC% field.' || attr_); --Displayed
IFSAPP.project_totals_api.New__(info_, objid_, objversion_, attr_, 'DO');
COMMIT;

END Update_Prj_Totals_Man_POC_To_0;

When I debug this it shows all of my information IFS is requesting in the attr_, however I am getting this error when I am using the Project_Totals.New__ api. 

Access denied! User IFSAPP is not connected to Company                    

ORA-20111: UserFinance.RECNOTEXIST

 

Does anyone know what this error means or any ideas what I can try to get around this? I have also tried the Project_Totals.Modify__, however since there is no data in that table until we add something in the table I cannot do a modify. 

I read a couple of posts on here about this error showing up while users were trying to do IFS functions that resulted in bug fixes so I am curious if that may also be what’s happening here. 

Any help is always appreciated. 


4 replies

Userlevel 5
Badge +15

Hi

 

The background job can not be run under IFSAPP user because there is no specific financial configuration in application. Try to start/schedule background job under named end user with particular finacial access done.

Userlevel 3
Badge +6

Hi @knepiosko

 

Thanks for the quick response. 

 

Do you know if there is a way to specify financial configuration for IFSAPP? Would IFSAPP have to be an employee(which I know we can’t do)?  For testing purposes I can schedule the background job under another user but for production purposes I would need to use some sort of IFS admin account. As it would not be good practice to use a random user and we are so low on licenses I can’t see my company letting me create a user just to run a script. 

 

Thanks,

Eli

Userlevel 5
Badge +15

Hi @Eli_Williams 

 

I am only technician. Wait for someone else response familiar with financial area. I am sorry.

Userlevel 3
Badge +6

@knepiosko No worries! Thanks for the help so far!

Reply