Dear All,
Can anyone provide me solution regarding how to create transaction notification for documents which are in draft mode.I have GRPO and Purchase Request for which I have to put validation for selection of project,Cost centers and vendor reference number and regarding to quantity also.Transaction notification is to be set in draft mode as user has to fill data before it goes to approval.
There was something I was trying but it is not working
As below:
For Purchase Request project selection
IF @object_type = '112' and (@transaction_type='A' or @transaction_type='U') -- Purchase Requisition
BEGIN
IF EXISTS ( SELECT * FROM ODRF T0 JOIN DRF1 T1 On T0.DocEntry = T1.DocEntry
And T0.ObjType = '1470000113'
AND (isnull(T1.Project,'')) = '' AND T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
SET @error = -2
SET @error_message ='Please select the project for this entry'
END
end
For GRPO where item class is Service (selection of three cost centers is mandatory)
IF @object_type = '112' -- Select Cost center for Service GRPO
BEGIN
IF EXISTS ( SELECT * FROM ODRF T0 JOIN DRF1 T1 On T0.DocEntry = T1.DocEntry
inner join OITM T2 on T1.ItemCode=T2.ItemCode
AND T2.ItemClass='1' AND (isnull(T1.Ocrcode,'')= '' OR isnull(T1.Ocrcode2,'') = '' OR isnull(T1.Ocrcode3,'') = '')
AND
T1.BaseType <> '22' and T0.ObjType='20' AND T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
SET @error = -4
SET @error_message ='Please select the cost center for this entry..'
end
END
I also want to create one transaction notification for GRPO where project selection will be mandatory.
Please reply if one can help
Regards,
Neha