Conditional Name in Ticket Design Elements

Hi all, 

I'm working to set up a conditional name in a ticket design so that orders with SLI recipients will print with recipient names and those without will print with owner names. So far I have a method that works when I execute LP_Ticket_Elements in SSMS, but maybe I'm not understanding what parameters are passed into LP_Ticket_Elements? 

Here's what I'm using so far:

If @ude_no = 1

Begin

If @sli_recipient_no is not null

 Select @ude_value = display_name

              From dbo.FT_CONSTITUENT_DISPLAY_NAME()

              Where customer_no = @sli_recipient_no

else

Select @ude_value = display_name

From dbo.FT_CONSTITUENT_DISPLAY_NAME()

Where customer_no = @customer_no

End

Any insight is greatly appreciated, Thank you!
Parents
  • Hi Jeffrey

    The main parameters are

    @ude_no (Values 1-6 representing Custom element 1-6)
    @design_type -- (T)icket, (H)eader, (R)eceipt, (F)orm

    Those 2 identify the element that your are tring to populate

    To help get you value 

    @li_seq_no
    @cur_sli_no
    @payment_no
    @order_no
    @customer_no

    or your query using @cur_sli_no shoudl allow you to check if the cureent sli has a recipient and ten return the relevant value

    Hpe that helps

    Mark

Reply
  • Hi Jeffrey

    The main parameters are

    @ude_no (Values 1-6 representing Custom element 1-6)
    @design_type -- (T)icket, (H)eader, (R)eceipt, (F)orm

    Those 2 identify the element that your are tring to populate

    To help get you value 

    @li_seq_no
    @cur_sli_no
    @payment_no
    @order_no
    @customer_no

    or your query using @cur_sli_no shoudl allow you to check if the cureent sli has a recipient and ten return the relevant value

    Hpe that helps

    Mark

Children
  • Thanks, Mark. I think this is going to help, but can you clarify for me?

    Do I  understand then that GET_TICKET_ORDER_ELEMENTS doesn't pass each SLI to LP_Ticket_Elements independently? Meaning that my query will have to check not just for the presence of SLI_Recipient_NO, but the SLI_Recipient_NO Where the sli_id = @cur_sli_no

    Thanks again.

  • It does pass each Ticket in independently, it just passes through limited fields, so @cur_sli_no is the sli_no of the current Ticket being processed so yes you would use that to lookup the recipient_no, and other details, associated with that SLI to return data for the ticket.

    So, yes, you will need to add

    select @SLI_Recipient_NO= recipient_no from t_sub_lineitem Where the sli_no = @cur_sli_no

    before your code

    Mark 

  • Thanks again, Mark. I'll give that a try.

  • Hi Mark, just wanted to say thanks for your help. We got this put together and implemented on our ticket designs and its working like a charm!

    For anyone else who might be looking for this type of function here's the query we're using in LP_Ticket_Elements:

    If @ude_no = 1

           select @SLI_Recipient_NO= recipient_no

           from t_sub_lineitem

           Where sli_no = @cur_sli_no

                  Begin

                  If @sli_recipient_no is not null

                         Select @ude_value = display_name

                         From dbo.FT_CONSTITUENT_DISPLAY_NAME()

                         Where customer_no = @sli_recipient_no

                  else  

                         Select @ude_value = display_name

                         From dbo.FT_CONSTITUENT_DISPLAY_NAME()

                         Where customer_no = @customer_no

                  End

     

    GO



    [edited by: Jeffrey Gallo at 12:08 PM (GMT -6) on 24 Jan 2017]
  • Did you have to add anything different to your ticket header, or are you still just using Constituent Display Name?


    [edited by: Sydney Peloquin at 10:05 AM (GMT -6) on 31 Jan 2017]
  • Hi I am looking into this with Sydney here at the ATA. LP_TICKET_ELEMENTS gets called from TP_GET_TICKET_ORD_ELEMENTS in several places but it only seems to pass @ude_no a value of one when @t_ele_no = 224. It seems @t_ele_no equals the ele_no column from the TX_DESIGN_ELEMENT table. We don't have a single row in this table where ele_no = 224. But after a little research in the stored procedures we have discovered that 224 is a user defined element 1 and thus created one on the ticket. I can now see a row in TX_DESIGN_ELEMENT where ele_no = 224. But we are still not getting any joy with the recipient name on the ticket. Any thoughts? Thank you
  • OK I think I got to the bottom of our issue with this. We don't put the customer name on the ticket. We have a header ticket with the customer's name address etc. LP_TICKET_ELEMENTS has the potential of 10+ parameters being passed to it from TP_GET_HEADER_ELEMENTS and from TP_GET_TICKET_ORD_ELEMENTS. Unfortunately the key parameter that is needed to make this script work on a Header ticket is not being passed to the LP_TICKET_ELEMENTS from TP_GET_HEADER_ELEMENTS
  • Plus we only need one header for each recipient - not a header for each ticket. This will require a think.......