Hi Expert,
I have created UDF under A/P Invoice. I want to make SPTN validation if user not attached his posting PDF document with A/P Invoice then next Invoice he can't add new document
Example
user01 posted Invoice No.-5 dtd 28/08/15 but he forget to attach document under UDF U_APATTC, know he want to post new document that time I want to block He can't add without attaching previous document.
I Have done SPTN but same user wise notification need to changes.
IF @transaction_type IN ('U') AND @Object_type = '18'
Begin
if Exists (select t0.DocEntry from OPCH t0 where t0.DocEntry =@list_of_cols_val_tab_del and t0.canceled='N' and ( t0.U_APInvAttc is null
or
SUBSTRING(ISNULL(CONVERT(NVarchar(100), t0.U_APInvAttc), ''), LEN(CONVERT(NVarchar(100), t0.U_APInvAttc)) - CHARINDEX('\',REVERSE(CONVERT(NVarchar(100), t0.U_APInvAttc)))+2, 14) + LOWER(RIGHT(ISNULL(CONVERT(NVarchar(100), t0.U_APInvAttc), ''), 4)) <> 'PCHINV' + CONVERT(NVarchar(50), DocNum) + '.pdf')
)
begin
select @error=1, @error_message='SBO: AP030 - AP: You have selected wrong document for Supplier Invoice attachment'
end
end
Please correct my SPTN.
Regards,
Mukesh Singh