You need to sign in to do that
Don't have an account?
Mony Gueorguiev 11
Visualforce and Custom Button for Record Update - How/Help?!
Hey Guys,
Im tasked with creating a Button that updates the related record on a Case/Ticket quick action area that we have in our instance. This button should provide fields for update on the Proposal (PPS Proposals object name) that is attached to that Ticket. So it's an Update button.
The user needs to have the option to update only a few fields on that record. -
Proposal Status (Picklist)
Core Estimated Hours (Number)
Core Estimated Fees (Currency)
Core Discount (Currency)
One-Time Solution Fee (Currency)
Add-On Estimated Hours (Number)
Add-On Estimated Fees (Currency)
Add-On Discount (Currency)
Type (Picklist)
I have never done this before and could use some (any?) help! Is this even possible?
Mony
Im tasked with creating a Button that updates the related record on a Case/Ticket quick action area that we have in our instance. This button should provide fields for update on the Proposal (PPS Proposals object name) that is attached to that Ticket. So it's an Update button.
The user needs to have the option to update only a few fields on that record. -
Proposal Status (Picklist)
Core Estimated Hours (Number)
Core Estimated Fees (Currency)
Core Discount (Currency)
One-Time Solution Fee (Currency)
Add-On Estimated Hours (Number)
Add-On Estimated Fees (Currency)
Add-On Discount (Currency)
Type (Picklist)
I have never done this before and could use some (any?) help! Is this even possible?
Mony
http://salesforce.stackexchange.com/questions/132832/make-a-button-on-visualforce-update-the-records-in-an-object
https://developer.salesforce.com/forums/?id=906F0000000AjlEIAS
Hope this helps :)
Thanks!
AMit Singh
Thanks for the links. They are helpful and getting me on the right track. I'm not sure how to create a visualforce page that is loaded with JUST those fields above. Those fields are from a our custom object. Those are the only fields that need to be updated by the user once they click on the "button".
What would be the best way to start, or just create, a visual force page that has those fields available? A simple page.
Thank you!! I appreciate any help.
Mony
So that i can make a sample visual force page for you.
The record that the user gets taken to from clicking the button should be the Primary PPS Proposal related to that Opportunity on the Ticket.
The custom object that they exist on, and to which the user should be taken to is, PPS_Proposal__c
Fields are:
Proposal_Status__c
Core_Estimated_Hours__c
Core_Estimated_Fees__c
Core_Discount__c
One_Time_Solution_Fee__c
Add_On_Estimated_Hours__c
Add_On_Estimated_Fees__c
Add_On_Discount__c
Type__c
Make changes accordingly to suit your needs.
To Make it work, you need a Custom Controller.
Thank you. How do I make a Custom Controller and then incorporate it so that the visualforce page is visible?
Mony Gueorguiev
And Use the below formula (Change it accordingly). This one takes your to the visualforcepage from the different object(Oppotunity in this case) as long as that PPS Proposal Id is one of the fields of that object.
So, make sure you have Primary Proposal Id on your opportunity object.
That exists on the Proposal object. The Update Proposal button with the visualforce page needs to be on the Case object. So I am trying to pull the new formula ID field for the Proposal all the way through the Case record, but am unsuccessful so far, since its across objects, its hard to figure out. Once I do find a way, I believe the URL hack you sent will work.
One last thing, is there any way to make the pop up window close after clicking Save?
Mony
For this, we need to overide a standard controller action (save , in this case) using an extension.
As i don't have your metadata in my org, I couldnt check for errors in the code. But in essence This code should point you in the right direction.
Visualforce Page Code (You need to tweak it accordingly)
And The Extension Code Will be like this (You need to tweak it accordingly),
If you find my code helpful, please mark my solution as Best Solution. Hope it works for you.
Thanks so much for that. Thats quite a lot! I will try to go over this and make the necessary changes, it will probably take me a few days/tries in order to get it right.
I will update you! Thank you so much for your help so far, its been awesome!
Your code not working. it will showing like Error: Unsupported attribute extension in <apex:page>
Change to
As i dont have your metadata with me, I didnt do the error checking, Please make the changes accordingly . The code i provided can be used as a template for your referrence.