You need to sign in to do that
Don't have an account?
Question: Is it possible to update field when viewing record using VF?
On the Opportunity Line item view page, I've a custom List_Price__c field. I want to set up a VF page that does the following:
1. If List_Price__c is null then populate with Pricebook ListPrice
2. If List_Price__c is not null, then check if Opportunity contains the word "Closed". If it does, then leave it alone. If not, update it with the Pricebook ListPrice.
I've setup a workflow that will do this, but only if the record is edited or created. Since we have existing records that existed before the workflow, List_Price__c could be null. I could export all the Opportunity Line Item IDs and mass populate this field, but I would like to know how to do this with a VF page.
I've tried with a formula, but a formula cannot refer to itself.
Also, can I update the List_Price__c directly using VF, or do I need to write the corresponding Apex code? Or do I have to actually simulate a quick save which then triggers the workflow rule?
Thanks.