Has anyone written, or know someone who has written something to create a user defined ticket element that would pull a recipient if there was one, and just the owner if there wasn't? And if they do, would they be willing to share?
We really don't have room to have both recipient and owner info on the tickets, and also feel that for the ones that do have a recipient, printing both on the ticket would be confusing to some.
Hi Brandi,
Below is the code I have in the local procedure LP_TICKET_ELEMENTS. Note that it only works at the individual ticket level and NOT a ticket header. It returns the recipient name if such has been attached to a Sub Lineitem, otherwise it returns the name of the owner of the order. This deals well where multiple recipients are associated with sub lineitems in the same order.
Let me know if you need more!
Martin
-- Return the value of the recipient name if specified at the SLI level, otherwise the name of the owner of the order for user defined element 6If @ude_no = 6 and @design_type = 'T' Select @ude_value = coalesce(cr.display_name, co.display_name) From T_ORDER o join T_SUB_LINEITEM sl on sl.order_no = o.order_no join dbo.FT_CONSTITUENT_DISPLAY_NAME() co on co.customer_no = o.customer_no left outer join dbo.FT_CONSTITUENT_DISPLAY_NAME() cr on cr.customer_no = sl.recipient_no Where sli_no = @cur_sli_no
It worked! Thank you for sharing! :) You've made our Development team very happy.
Not a problem - glad it does the trick for you!