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
mallikammallikam 

Questions about standard object

1. If a value is selected from a custom pick list, can we make some other fields in the section mandatory say for example in Accounts object? If so, should I write a workflow for achieving this?

 

2. Can I display an alert message when a value is selected?

 

3. If I want to write java script code for standard object, is that possible?

 

Any answers are appreciated.

mpannmpann
  1. You can add a validation rule that does not allow the second field to remain empty, if a certain picklist value is selected. It won't add the little red bar to the field, though.
  2. Not through standard configuration.You could write a trigger that pops up an alert on save.
  3. Yes, you can write savascript code for standard objects, such as custom buttons, etc. It depends on what exactly you want to do.
mallikammallikam
thanks!! How can I write javascript for one of the custom fields say picklist in a standard object like opportunity?
mpannmpann
I don't understand your question. What do you want to do with javascript?
mallikammallikam

I dont know how to do this, basically I want user to fill up a form when he selects yes from pick list in a new opportunity page.

mpannmpann

I see. Maybe others may have a better idea, but here are my thoughts.

 

You could write an apex trigger, that will check the field when the record is saved and call another page. 

 

If you need the action to happen when the user selects 'yes' RIGHT AWAY (that means, before the page is saved!), then you will most likely have to use Visual Force and AJAX to rebuild the Opportunity Edit screen.

 

To get started with this, I would recommend having a look at these resources:

 

  • http://wiki.developerforce.com/index.php/Visualforce
  • http://wiki.developerforce.com/index.php/Force_Platform_Cookbook 


 Good luck!

 

mallikammallikam

Thanks thats exactly what I have in mind. I need to have the form appear as soon as the user select yes. I posted the question here. (I already have some experience of VF page and AJAX but its just that I have so many fields in opportunity page and I am wondering how I can have an exact replica of the page thru some straightforward function or way in VF with the AJAX functionality)

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=16760

mpannmpann

You can add the entire detail block of a record using

 

<apex:detail/> 

 

the same goes for related lists

<apex:relatedList list="MyChildObjects__r" />

 

You should be able to rebuild the normal page in a few lines.
mallikammallikam

Thanks! But aren't you talking about viewing the saved records when you say <apex:detail/>? I want

the page to look exactly like "new" opportunity page?