multiple function calls

Discussions about the LSPS expression language.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
eric.graham
 
Posts: 58
Joined: Tue May 13, 2014 12:20 pm

multiple function calls

Thu May 22, 2014 7:37 pm

I am working with two text boxes, one Integer for ID, and one String for Order Number. I am wanting to show the value (either ID searched for in one text box, or Order Number searched for in the other text box) in a Table. - In the Data: Table, I can only get one of following to work:
Code: Select all
{index, size -> getTickets(id)}
OR
Code: Select all
{index, size -> getTicketsbyOrderNumber(ordernumber)}
but not both. (Meaning I would like to look for ticket.id if the ID text box passes an Integer, OR look for a order number if the text box passes a String.) - Is there a way to call one function (UP DATED: sorry, the calls were to query s) or the other inside of the expression?

Byron Glueck
 
Posts: 85
Joined: Thu Apr 26, 2012 8:17 pm

Re: multiple function calls

Thu May 22, 2014 8:54 pm

You may wish to consider passing multiple parameters to your query. Then you can handle null values in your query condition.

For example:
getTickets(ticketId, orderNumber)
Iterator: ticket
Condition: ((ticketId = null or ticketId = ticket.id) and (orderNumber = null or orderNumber = ticket.orderNumber))

eric.graham
 
Posts: 58
Joined: Tue May 13, 2014 12:20 pm

Re: multiple function calls

Thu May 22, 2014 9:04 pm

Thanks for the speedy response glueck! That worked like a charm. I did something similar in an earlier try, but did not catch the condition quite as you suggested. Thanks again :D

Return to Expression language

Who is online

Users browsing this forum: No registered users and 0 guests