The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Validation error on order submit...
Posted: 17 May 07 10:29 AM
|
fiogf49gjkf0d We are using the CSC salesorder module and I am adding some functionality...btw, we are using 5.2.4.
I assign a sqlstring = "Select count(UserName) As CountUser from sysdba.userinfo where department like '%Name%' and UserID = '" & CurrentUserID & "'".
I have validation statements to verify that certain data at the account and contact levels are there before allowing the order to be submitted. What happens is that because of the As CountUser above, it throws this as a field requiring data in the validation statements and won't ignore it. Can someone think of a better way of handling this, or has it been seen before? Any help will be greatly appreciated.
Thanks in advance...
ChrisD |
|
|
|
Re: Validation error on order submit...
Posted: 18 May 07 4:22 AM
|
fiogf49gjkf0d I suspect that your problem is actually your SQL statement erroring and not being picked up. This might be causing your validation to fail. Drop the word AS from your statement.
Try:
Select count(UserName) CountUser from userinfo where department like '%Name%' and UserID = '" & CurrentUserID & "'"
Also - I dropped the sysdba reference as it is redundent.
Hope that helps!
ws
|
|
|
|
Re: Validation error on order submit...
Posted: 18 May 07 4:56 PM
|
fiogf49gjkf0d Also, it's pointless to have both conditions in your query for department *and* userid. If you're filtering on a specific userid, makes no sense to also use department (since using a specific userid will get you a single record match) |
|
|
|
Re: Validation error on order submit...
Posted: 24 May 07 10:20 AM
|
Maybe you need more information.
The reason for both conditions is that I am trying to apply some code to particular users without actually putting their userid's in the code. Thought it would be easier to add an identifier to the department field and apply the code via that method. Also, I am doing a count to determine if there is more than 1 and that is my trigger for the code, just in case there is more than one person that this needs to apply to.
After trying what Walter mentioned, I am still getting a SalesLogix.exe error. There is nothing being captured in my error capturing. Not sure what may be causing this. The results of the query are returning correctly so that seems to be working, it just isn't doing what I want it to.
Maybe I just need to present my challenge and see if I can get some help. I am trying to create a new saleorder status which when an order is submitted only allows those identified above to actually submit. Anyone else who submits an order with a particular payment term will have it go into this new status and when one of the other users identified by the query tries to submit, it will actually go into the real status that will take it over into our MAS500 db...
Hope that makes some sense...
Thanks in advance...
cd |
|
|
|
Re: Validation error on order submit...
Posted: 25 May 07 4:58 AM
|
This sounds like your code should be more along these lines
Select department from userinfo where UserID = '" & CurrentUserID & "'" If department <> "authorized department" then msgbox "sorry, you are not authorized to do this" exit sub end if
ws |
|
|
|