Blank parameters for business objects
* This is part of a form segment for a library
I have a BO setup based off a view. In the view I have code that is something like,
select * from myTable where @myValue = "" or @myValue = TableValue
Basically, if blank return all and if not blank return what matches.
Now I set up a grid to show the values and a textbox (with variable) in order to pass to information to the view via the business object parameters.
My issue is the parameters do not like an empty string "" - and does fine with a " " - but I don't want to have the extra " " character within the textbox before I send. And by not like - I mean if it's empty no results get shown.
Now if I try to put an expression within the parameter (using an if statement) to change the "" to a " " - I deploy the library fine and update the project fine, but when I deploy the project - it gives me an error:
The type arguments for method 'Metastorm.Runtime.Core.Mstm.If(Metastorm.Runtime.Types.Check, T, T)' cannot be inferred from the usage. Try specifying the type arguments explicitly. 660 66
Any thoughts?
Comments
-
By the error you reported at the end, I presume your input parameter has an "if" statement in it to set a value. I hate that message as it give absolutely go guidance as to where the real issue is. (Like most of the errors returned during deployment. Validation is better, but still limited.)
My experience is MBPM doesn't seem to like if conditionals, even if completely valid and return valid results, as direct input parameters in many cases (perhaps not all, but many).
A quick search doesn't reveal if I use the empty/value in a BO. I will find one I will repost.
If you have just empty (without the OR clause) does it work? I suspect not, but work checking. Some version of MBPM (don't recall specific ones) had issues if a parameter (@myValue) was used multiples in a query, forcing separate instances of the same variable. That appears to have been subsequently fixed.
0 -
I understood the post until this statement...
My issue is the parameters do not like an empty string "" - and does fine with a " " - but I don't want to have the extra " " character within the textbox before I send. And by not like - I mean if it's empty no results get shown.
You should be able to not pass anything into the parameter - basically leave it blank. Dont put a "" or " "...that should send the param through as a null
The query then may need to be modified to handle null
select * from myTable where @myValue is null or @myValue = "" or @myValue = TableValue
0 -
That is the solution - thanks!
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 151 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories