Solved

Warning Message - Business Opportunity Apps 9

  • 19 August 2021
  • 3 replies
  • 232 views

Userlevel 4
Badge +7

Hi,

I’m trying to create a warning message for the Business Opportunity screen.

As, the company auto-fills depending upon a user’s default company. I would like to show an error message if a certain company isn’t selected. Is there a way of doing this in Apps9?

 

icon

Best answer by Tomas Ruderfelt 19 August 2021, 12:56

View original

This topic has been closed for comments

3 replies

Userlevel 7
Badge +18

If you want to stop users from creating BO’s in other companies than their default you can create a custom event on BUSINESS_OPPORTUNITY_TAB. Tick the checkbox for “New Value” in the field COMPANY to make it a parameter.

 

The event action could look like this:

BEGIN
IF '&NEW:COMPANY' != User_Finance_API.Get_Default_Company_Func THEN
Error_SYS.Record_General('Event', 'EVENT_WRONGCOMPANY: You may only create business opportunity with company :P1', User_Finance_API.Get_Default_Company_Func);
END IF;
END;

 

Observe! This event affects all users. You can limit that by other conditions if necessary.

Userlevel 4
Badge +7

If you want to stop users from creating BO’s in other companies than their default you can create a custom event on BUSINESS_OPPORTUNITY_TAB. Tick the checkbox for “New Value” in the field COMPANY to make it a parameter.

 

The event action could look like this:

BEGIN
IF '&NEW:COMPANY' != User_Finance_API.Get_Default_Company_Func THEN
Error_SYS.Record_General('Event', 'EVENT_WRONGCOMPANY: You may only create business opportunity with company :P1', User_Finance_API.Get_Default_Company_Func);
END IF;
END;

 

Observe! This event affects all users. You can limit that by other conditions if necessary.

Thanks for your response, this will definitely cover the error message. Is there a way to create a warning message instead, as a prompt is needed more so than an error. As there may be cases in which an error message doesn’t need displayed.

Userlevel 7
Badge +18

Warning message with an option to choose if you want to save or not can’t be done by an event. An information message, which shows the message but with only one option to continue, might be possible.

If you want an information message this might be working. But only if you create business opportunity by pressing New in the Business Opportunity window and save, and also if the client has support for it. So you have to test and see if it works or not.

BEGIN
IF '&NEW:COMPANY' != User_Finance_API.Get_Default_Company_Func THEN
Client_SYS.Add_Info('Event', 'EVENT_WRONGCOMPANY: You may only create business opportunity with company :P1', User_Finance_API.Get_Default_Company_Func);
END IF;
END;