Notifications
Announcements
No record found.
I am using the new AutoNumber field type in the CDS environment to create 2 new fields. However, I don't want both fields to populate unless another field contains a certain criteria. So I am wondering, is there a way to prevent the field from populating via plugin or code when the record is created? And after the field isn't populated, having it populate later when the other field that matches it's criteria? I know it's a new type of field that's why I'm trying to figure out if this is possible.
Hello Tom,
Seem that you need some kind of conditional population of the field. You can't do that directly but there is a workaround and you can do it codeless. Check the following article from Jonas Rapp - jonasr.app/.../
Andrew,
This is a really great article but I don't know if it answers my question completely. With the AutoNumber fields, they populate as soon as the record is saved and I don't want them changed from the formatting that is setup with these AutoNumber fields.
I have one field that stores the Job/Opportunity Number on the opportunity and another field that stores if the Opportunity is a service type opportunity and assigns it a separate number.
With these 2 fields I then have another field that sets what type of Opportunity it is, i.e. Job or Service. So what I want to do from this point is if the Opportunity Type is set to Job, I want the Job Number AutoNumber field to populate and the Service Number not to. And vise versa.
Tom,
You should not repeat exactly the same approach in order to implement your requirement but use the main idea:
1. Create a custom autoincrement entity for the "Job" type with its own autoincrement field.
2. Repeat the same for "Service".
3. Create the workflow that handles opportunity's create or update events. Depending on the "Type" either create correspond "Custom Autoincrement Entity" record and copy the value from autoincrement field to the corresponding field on the opportunity.
Again thank you so much for this info. I guess the part I am missing is that the fields are auto incrementing in the background no matter what. And I don't want it to do that. If I remove or hide them from the screen, it is still incrementing and I want that prevented. This way the number is not going up unless the Opportunity is set based on the criteria I specify. I was wondering how do I stop that field from incrementing or populating.
I believe you're missing the point and approach described in the post that I provided earlier. The real autoincrement field is located on the separated entity that won't be created unless opportunity satisfies the criteria provided. So if the opportunity doesn't satisfy the criteria - autoincrement entity is not created and the field is not updated. I don't know how to explain the concept in a better way...
I apologize, I completely understand where you are going from here and I misinterpreted the information. This is exactly what I am looking for. Thank you very much for your help!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 70 Super User 2025 Season 2
Gerardo RenterÃa Ga... 33 Most Valuable Professional
Daniyal Khaleel 32 Most Valuable Professional