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.
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.
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;