You need to sign in to do that
Don't have an account?
Glock9
Second part of my question regarding Date and Time naming Convention
Therefore under this naming convention the following would happen. An Opportunity become a transaction and in the opportunity section someone dates the day it becomes a transaction. I then want saleforce to produce the name in the following manner. T-(YYYY)-(MM)-(0000) The sequence in the code will be the next transaction from the last one created in another Opportunity.
You have to use a trigger for generating this field on creation of Transaction:-
1. It will lookup the parent Opportunity and and get the date for conversion of transaction from there and use the Year and Month portion for generating the transaction id.
2. Next we will extract the sequence from the Transaction Name or have a formula field store that and from there pick the higher number by order by that formula field and having the limit 1. say u get WXYZ
So the final value to be assigned will be :- 'T-('+ substring.(Opp[0].date.toString(),0,4) +')-('+ substring.(Opp[0].date.toString(),6,2)+ ")-("+ Trans[0].FornulaField__c+ ")";
I think this should give you the output you are looking for.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.