You need to sign in to do that
Don't have an account?
SOPORTE TI
Default values before create a NEW register in any object
How can i do this with any object? VFPage? Triggers? ApexClass?
Please, it's a critical problem for my partners!!!
Please, it's a critical problem for my partners!!!
http://writeforce.blogspot.com/2012/12/prepopulating-fields-using-url-hacking.html
if you are using the apex class with visualforce then you can set the default vaule in your function that is going to perform insert or update operation.
you can also use the trigger to do this. Write the trigger on insert and update event and assign the default in the field in which that you want.
The trigger way, is useful to put default values AFTER i press the save button. But mi problem is, make visible default values in the beginning, before i press save.
I try to put default values at the moment to create a new register, but the triggers are always activated after i press the save button.
It's possible resolve this problem making a trigger?
I'm not that sure if it's the right way to resolve this problem.
It works, but i wanna try to see if it's possible to resolve this problem using triggers or Apex Class.
I believe if we used hack URL it's not a "correct" way to resolve this problem. I try to burn all my options before y code this solution.
If it's not possible in other way, i'm gonna write the code in the way you recommend.
Thanks!
As previously mentioned by other posters here, if you have a Visualforce page, they you can pre-populate fields. There are other hacks that you can implement but they all suffer from the same pit falls as they are all hacks.
For instance, you could set up a home page component that uses JQuery and tracks your standard page and changes the dom elements to inject your own values so that it appears as if they are prepopulated. This is no better than the url hack in anyway as this is more complicated than using unpublished SF params to populate values.
Triggers fire after the DML occurs so they do not help you in this case. There is not standard event that fires before showing a page in SF. So your options are limited in this case. You can always go for a VF page, though.
Thanks,
Venkat