You need to sign in to do that
Don't have an account?
Apex Help Needed for New Record
Thank you in advance for any assistance! Within a specific quote record type, we "look up" to an existing custom object record and when the quote is closed "won", a new custom object record is created. Let me paint the picture. I create a new 'conversion" opportunity and then a "conversion" quote where I'm able to look up to machine number "1234". The machine number field is an auto number that issues in sequence. When I close a new conversion quote as won, a few things happen. First, the existing machine (in this example "1234" switches to a "Converted" record type with matching page layout that locks down all fields and shows the converted date. Second, the new machine record is created with updated specs from the quote. The machine number is whatever is next in the sequence is and this is where I'm struggling.
I need for the new record to reflect the old machine "1234" and then to show "C-1" for conversion 1. If the old machine was "1234 C-1" then new one should be "1234 C-2". I hope that this makes sense and that someone can point me in the right direction.
Thanks again,
Jessica
Unfortunately this is not possible with an auto-number field. Best way forward IMHO is to have an extra field on the Machine custom object called (for example) 'conversion number' that defaults to 0 and another formula field called (for example again) 'complete machine number' containing <auto-number of the old machine> + " C-" + <conversion number>. Now you create a lightning process that triggers on conversion of the quote. It then creates a new machine record and in the create action you set the machine number of the 'old' machine and the conversion number. You also set the conversion number on the new machine record to 1 via a formula. Good luck!
I'm not sure if I need a new page layout/record type for the machine object beyond the old machine/converted one I've done. Thank you again for your input...it might be what I end up going if I can't find another way.