+ Start a Discussion
sherazsheraz 

hot to create custom controller for vf page

Hi,

I am new to salesforce and i have to create controller for vf page that i will update the multiple field based on user input(custom object).

example:

custom object = product

fields:

app recieve by = text field

app receive to = text field

date field 

owner = text field

here is the scenario: 

if 

app recieve by = john

thne 

update 

owner = john

and 

date = 12/5/12

please guiode me that how to create this kind of controller.

thanks

 

PremanathPremanath

As per your Requirement You need to update Fields Right?

 

So better to Write trigger here..

 

 

trigger Test1 on product__c (before insert,before update) {
for(product__c ex:Trigger.New){
if(ex.app_recieve_by__c==john){
ex.owner='John';
ex.date='12/5/12';
}
}
}

 

Regards

Prem

sherazsheraz

Thanks for your response. i have to create the trigger that when user put information in field and upon save it will update the other fields.Also, i want to other field to update dynamically not hard coded.how i am going to accomodate this functionality in trigger?

please help 

PremanathPremanath

I am not Getting your requirement clearly

 

here Otherfields means What?

And Where you have to give the input(in record or in VF page)

 

Explain clearly what you want!

 

 

Regards

Prem