You need to sign in to do that
Don't have an account?
Mohan Chaitanya Palaparthi
how to update a custom object field through a apex class
i have an custom object called Drink_order
in that i have flavor,size and price fields
i want to autoupdate price field depending upon the user selecting flavor and size
eg: flavor is apple
and size is large
can anyone please help me.
in that i have flavor,size and price fields
i want to autoupdate price field depending upon the user selecting flavor and size
eg: flavor is apple
and size is large
can anyone please help me.
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Note: You can change the Object name and fields name as per your requirement.
Visualforce:
Apex:
I hope it helps you.
Kindly mark this as solved if the information was helpful. It will help to keep this community clean.
Regards,
Khan Anas
All Answers
Greetings to you!
You can update the price field based on flavor and size using a trigger.
Try this:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
thanks for your answer,but the field will get updated only after we click on save button.What i want is those fields are picklists once the
user selects flavor and size,a value should be display in price before we click on save button.
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Note: You can change the Object name and fields name as per your requirement.
Visualforce:
Apex:
I hope it helps you.
Kindly mark this as solved if the information was helpful. It will help to keep this community clean.
Regards,
Khan Anas