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

  • 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.

Reply Children
No Data