[SalesForce] Hide field on Case Create Page

I have a datetime field on my case object that gets set by a trigger based upon the value selected in another lookup field on my case.

I need this field to display on the case details once the case has been saved and it should be editable from there.

However when the case is being created the user should not be able to edit the value and therefore I want to remove it from the Create New Case screen but have it remain on the Case Details page.

It seems as if the Create New Case fields are controlled by the same page layout that controls the case details. Is there a way I can remove the field from the Create New Case screen but remain in the case details?

Many Thanks

Best Answer

I have two solutions for you, though I am not particularly happy with either of them (but both would do the trick)

  1. Custom page: You could override the "New" button and replace it with a new page (Classic Only, IIRC). The main problem here is that if the layout changes, your VF would need to be modified, making this solution hard to maintain. If you cared about the page layout being respected (if it changed) you would need to code your screen leveraging the UI API to obtain a copy of the layout and then removing the field in question
  2. Record Types: You could create two record types, making only one of those accessible to the user to create. The first record type (the one the users would have access to create) would have a layout without the field in question. After save (via code, WFR, PB, or other tool) you could switch to the 2nd Record Type, which would be associated to another layout, this time with the field in question. This means two layouts to maintain, but not code (or VF).

I am, for the most part, a proponent of teaching the business to ignore a field (if that's all there is) to keep the solution simple. But if your users are adamant, then either of the solutions above gets you there.

Related Topic