function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Glock9Glock9 

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)-(0000The sequence in the code will be the next transaction from the last one created in another Opportunity
Ispita_NavatarIspita_Navatar

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.