In the condition expression field … can you put null || string.Empty
to test for both? or do you need a second condition?
Try it. (that’s what I would end up doing to answer your question)
Worst case you can add an or and another condition. Or you can use the condition that expression = true and then use string.isnullorempty(yourString)
There’s lots of ways to skin that cat.
Tried this but I think its more to do with my limited knowledge of coding
Tried what?
Operator ‘||’ cannot be applied to operands of type ‘’ and ‘string’
null then string.Empty in two conditions
That’s a stored procedure!! I never knew that.
Or a scalar function (if that’s different)
I C# land, you can split strings pretty easily though, so it’s not really needed there. It’s annoying how much of a pain it is in SQL though. Hence the function created for it. If you look at what it does, it’s pretty complicated, so I’m glad it’s there.
I just tested this set-up and it worked fine.
I used SalesRepCode2 because Rep1 is always populated by default from our territories. But it should work the same.
Initially tried to save:
Added my second sales rep and saved successfully (not that you can really tell by a screen shot).
Just to verify, I changed it to SalesRepCode1 and just deleted the salesperson off of my test sales order…
Again, seemed to work:
Add a sales person, saves fine. No error.
Thanks David, that has worked and thanks everyone for your help on this.