May I customize 'edit custom object records' page layout on SalesForce?

后端 未结 1 1970
刺人心
刺人心 2021-01-26 18:59

For example, to create or edit an object, when I want to add or change some value to one specific field, I need to refer another website to retrieve some info.In this way, may I

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-26 19:20

    Custom buttons and links don't display on new/edit page layouts so even if you'd make one, it will be visible only on detail view.

    1. Not too invasive option would be to create a URL or text fied, set it's default value to your link, make sure it's displayed on the page but readonly. Haven't tried it but should work (you'll have to test it as somebody other than System Administrator because you'll bypass the readonly property of the page layout).
    2. More invasive option would be to override the new and edit page layouts with Visualforce. More work but somewhat clean solution.
    3. Really crazy option would be to embed a piece of Javascript into section header on the standard page layout or even into sidebar. It's an ugly hack but it works, I've used it for example to disable editing of Name field.

    To use method #3:

    1. create new section header, add something to the section (blank space is fine, you need something otherwise headers for blank sections aren't rendered), mark the section as visible on edit pages only.
    2. Section name has limit of 80 characters but can contain code like . You need longer script though to somehow create an URL at runtime and append it somewhere on the page near your "special" field.
    3. Upload a static resource with your script, then use this as the section header:

    I'm not too proud of this hack and if you can - go with custom Visualforce new & edit page. It's quick & dirty, probably should be used only when you're not allowed to override pages.. but it works.

    0 讨论(0)
提交回复
热议问题