You need to sign in to do that
Don't have an account?
Daniel Muir
quote line number trigger
Hi all,
We are wanting to use a trigger that will number each quote line item, for each quote.
The current auto-number system is not of use as the numbers do not reset, and as far as i have read, a trigger is the only option (flows were the other option, but they create severe inconvinence when adding individual lines).
I have tried the code provided in the below link, but it did not seem to work for us.
https://developer.salesforce.com/forums/?id=9060G000000BhAkQAK
We are wanting to use a trigger that will number each quote line item, for each quote.
The current auto-number system is not of use as the numbers do not reset, and as far as i have read, a trigger is the only option (flows were the other option, but they create severe inconvinence when adding individual lines).
I have tried the code provided in the below link, but it did not seem to work for us.
https://developer.salesforce.com/forums/?id=9060G000000BhAkQAK
Can you please try this and let me know. (Just written for insert use case)
The following error appears: Error: Compile Error: unexpected token: 'WHERE' at line 24 column 40
Hey my Bad, query syntax was wrong before :(
The trigger returns the following error: Error: Compile Error: unexpected token: for at line 1 column 0
Not sure why you are getting that error. I have added debugs in the code. Can you please post debug log after running the trigger. I will be able understand what's the cause.
It has saved now. Something copied in with the code was all.
Just need to test it now.
The codes work in my sandbox.
They number each product line in the order in which the products are selected.
The only issues is when the items are sorted. Then you may get lines 1, 4, 5, 3, 2 (example).
Its much more useful than what already exists though! :)
I have not understood this part. Can you please share screen shot on what it means exactly?
Glad that it helped to some extent. Please mark the answer as best if you feel it is worth.
Another issue i have noticed that has popped up is that all products have to be entered at the same time. If you were to want to add an extra product later you need to create an entire new quote. I've posted the error underneath the image files.