Dear Experts,
I would like to set up a control in budget scenario where user can only create one budget scenario for one financial period. It means if there's an existing budget created for current period, user will only able to update existing but no creation of new budget scenario. I tried to use SBO Transaction Notification but unfortunately it's not working (the script can be found below). Please advise.
IF @transaction_type in ('A','U') AND @Object_type = '91'
BEGIN
DECLARE @FinPriod DATETIME
select @FinPriod=FinancYear from OBGS A
inner join OFPR C ON A.FinancYear=C.F_RefDate
WHERE C.AbsEntry=@list_of_cols_val_tab_del
if exists (select count(FinancYear) from OBGS A
inner join OFPR C ON A.FinancYear=C.F_RefDate
Where A.FinancYear=@FinPriod
group by C.AbsEntry
Having count(A.FinancYear)>1)
SELECT @error = 2, @error_message = 'Budget already defined for existing period : ' + @FinPriod
END
Thanks and Regards,
Lailus Shobah