You need to sign in to do that
Don't have an account?
Remedios
How to swap values of two or more fields?
We have three fields for email addresses. When we send email campaigns or do email sync only the default email address field is used. My users would like to have the option with a click of a button to swap the swap the address in the default email address field with the one from the alternative email address field. What would be the best way to achieve that?
Thank you!
If it needs to be done at the click of a button, one way would be to tie that button to a visualforce page that contains a page action attribute. This will cause an action method to be executed prior to the page being rendered. This method can swap the values, update the record via DML and then return the pagereference to view the updated record.
Thank you for your prompt response. Is it difficult to set up this? I am new to visualforce. Do I need to create a field where to keep the values during the exchange? If you can help me with more specific steps will be very gratefull - or refer me a training source?
It should be fairly straightforward. Assuming your sobject is of type 'MyObject__c' and the two fields to swap are strings named 'MyField1__c' and 'MyField2__c', then you'd have a page something like:
and a controller something like:
You should then be able to create a record detail button with a target of the visualforce page.
Hi Remedios
I am Writting a Program of Swap two or more fields please check it
Please mark it as best answer if it helps you to fix the issue.
Thank you!
Regards,
Suraj Tripathi