0

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

  • in classic, you can override the New button and supply your own VF page that omits the field – cropredy Nov 27 '18 at 22:50
1

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.

  • Hmm yes I had seen the option to use a custom page but yes the worry with that was the maintenance as fields are added etc. and record types on cases is something we are trying to avoid as want to keep a single page layout. Do you know if you can replace the Standard New Button (say at the top of the recently viewed listview) with a flow? or is a VF page / Lightning Component the only option for that? – user3456401 Nov 28 '18 at 0:02
  • RecordTypes are not the devil. I would always follow the simplest of solutions. A flow embedded on a VF page, launched by a button is not simple. Why are RTs not a good solution? Do you have too many Layouts already? – Sebastian Kessel Nov 28 '18 at 1:40
1

Because by using standard page layout you cannot hide a field during creation vs. edit as the same page layout is used for both operations.

However, you can simplify this by just putting a Validation Rule on the field where you can throw an error whenever a User attempts to provide a value during create operation. Or provide a help text which lets the User know that the value will be overwritten during create operation.

I personally will not recommend to customize your overall flow for only one field but address it using aforementioned approaches or User training.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.