How to create a very simple SQL override in a custom grid.
My grid is based off the customer table
I thought I could look at the current examples on the standard screens as a guide. This is what I tried at first:
(CASE WHEN viewCustomer.Contact IS NULL OR viewCustomer.Contact=''
THEN ''
ELSE + viewCustomer.Contact END)
+ (CASE WHEN viewCustomer.Email IS NULL OR viewCustomer.Email=''
THEN ''
ELSE '<br /><a href=''mailto:' + viewCustomer.Email + ''' target=''new''>' + viewCustomer.Email + '</a>' END)
I tried using Entity instead of Customer. I tried including an + symbol at the beginning.
None of those things worked.
I tried going really simple with this:
SELECT contact FROM customer.
That gave me an error saying the customer table didn't exist. (huh?)
I tried this:
contact + email
...and it worked!
So I dumbed my original effort down to this and got what I wanted:
(CASE WHEN Contact IS NULL OR Contact=''
THEN ''
ELSE + Contact END)
+ (CASE WHEN Email IS NULL OR Email=''
THEN ''
ELSE '<br /><a href=''mailto:' + Email + ''' target=''new''>' + Email + '</a>' END)
The problem is there is no way to trouble shoot. I had no idea what I was doing wrong. The only feedback I got was a message where the grid results are suppose to be after I publish the screen. It just says, "Error Generating Grid..." or go refresh the customer table to re-create it.
I hope this helps somebody because it sure was taxing to figure it out. I can't believe I couldn't find a post on this anywhere.