Skip to Content
avatar image
Former Member

Changing Email subject dynamically after adding Sales Document

Hi,

I just want to change email subject as 'Sales Quotation (Document number) (Customer Name)' whenever I add the sales quotation.

I write query into SBO_SP_TransactionNotification,it only affects the Email subject in Per document as shown in

But when I add Sales Quotation and click on mail option it doesn't reflect in Subject

Please help me to out this

Regards,

Sapna

per-document.jpg (65.2 kB)
on-mail.jpg (33.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 06 at 11:52 AM

    Hi,

    Try to assign below query in Email subject by using User Defined values,

    SELECT T0.Emailsbj FROM ADP1 T0 WHERE t0.objtype = 23

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Nagarajan,

      Where were I write this query..in Query generator or SBO_SP_TransactionNotification?

      I already wrote following code in SBO_SP_TransactionNotification

      Declare @emailSubject nvarchar(150)
      
      If @transaction_type IN ('A') AND (@Object_type = '23')
      Begin
      If Exists(select * from OQUT T0 WHERE T0.[DocEntry] = @list_of_cols_val_tab_del and (CONVERT(VARCHAR,
      T0.CREATEDATE,103) = CONVERT(VARCHAR,GETDATE(), 103)))
      Begin
      set @emailSubject='Sales Quaotation '+(select top 1 (convert(nvarchar(50),DocNum)) +' '+ CardName from OQUT order by DocEntry desc)
      
      update ADP1
      set ADP1.EmailSbj=@emailSubject 
      where ADP1.ObjType=23 
      
      END
      END