BPM - Order Header Salesperson

In the condition expression field … can you put null || string.Empty to test for both? or do you need a second condition?

:person_shrugging:

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.

1 Like

Or a scalar function (if that’s different)

image

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.

3 Likes

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).

2 Likes

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.

4 Likes

Thanks David, that has worked and thanks everyone for your help on this.

1 Like