function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
joefoldsfivejoefoldsfive 

Cannot do two things at once!

 

If anyone can help me it would be most appreciated.

 

I need to do two things at once....

 

 

1. Click a custom button on account page, which launches a visualforce page (opening in Word)  with the accuont details in a formatted style (our new customer form), which our team can then print out.   This bit I can do

 

2. At the same time, update a field on the account page with today's date, to let salesforce know what date they were signed up on.  This could provide valuable data to start analysing.

 

Can anyone help ?

 

It feels like either my visual force page also needs some code to update the account 'closed date' field

 

Or I need the custom button to execute javascript that updates the 'closed date' field and then launches the visualforce page.

 

 

Not sure if possible ?

LVSLVS

Not sure what you mean by the first requirement. However, if you want to perform some DML operation just before a VF page is loaded, use the pageAction attribute on <apex:page /> - I think this is what you want?

 

~LVS

JitendraJitendra

Hi,

For second task, you will need to execute the javascript on Account page but javascript will change the value on UI you also have to execute Ajax, JavaScript Remoting or on the Action method of New page to change the value of Account (DML operation).