You need to sign in to do that
Don't have an account?
dmcheng
Web-to-Case and Before Insert trigger: Origin not set?
Hello. It looks like the value of Origin field in a Web-To-Case is not set until after the case is inserted. Is that true? I am writing Before Insert trigger code that should only run for web-to-case, but when I include an if statement for Origin == 'Web', my code doesn't run. It's only when I comment out the if statement that code runs.
If that is case, is there any other standard way to determine a web-to-case? Or do I have to create a custom field and link it to a hidden field on the web form?
Thanks
David
Have you tried printing out the value of the origin to the debug log? That might show what is being returned, exactly, so you can verify whether your == 'Web' is correct. Maybe it's case sensitive, or maybe it's 'website'. I'd first verify that the value of the origin field is exactly what you think it is.
You could also try updating both sides to be in the same case, and making sure you're trimming whitespace.