+ Start a Discussion
roysmith601.3493067652527424E1roysmith601.3493067652527424E1 

trigger help on custom object

I create custom object ="opptyProduct" on opportunity object .I create five (5) fields on custom object = optty Product and the fileds description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is received, complete )
field # 3: Closing Stage Owner ((which is lookup(user)field)

Field # 4: Application Received (which is date field)
Field # 5: Processing  (which is date field)


I have the following requirments :

 

Requirments #1:
If “Application Received By” not null
then
condition # 1 : set Closing Stage = recieved
and 

condition # 2 : set Closing Stage Owner = Application Received By

 

Requirments #2:
If processing  not null
then
condition # 1 : set Closing Stage = complete
and 

condition # 2 : set Closing Stage Owner = blank



Examples:

Example # 1:

When prcoess = 10/19/12 then Closing Stage = closing and Closing Stage Owner = blank (null).

 

Example # 2:

When user edit the same record from example # 1.

When Application Received by = steve then Application Received = 10/19/12, Closing Stage = recieved and Closing Stage Owner = steve.

 

Example # 3:

When user edit the  same record  from example # 2 .

When prcoess = 10/20/12 then Closing Stage = closing and Closing Stage Owner = blank (null) and no change to

Application Received by = steve then Application Received = 10/19/12 record.

 

Example # :4

 When user edit the same record  from example # 3.

When prcoess = blank (null) then desire result; Closing Stage = recieved ;Application Received by = steve then  Application Received = 10/19/12 record.

 

I am nre to salesforce and I don’t know that how to write trigger.

Please help me.

Thanks