I have a field that is filled by file import, so I need to check if this field was fill by hand or imported. Is there any way to implement a validation rule with a condition that verifies whether or not the input of a sObject field was given by the keyboard?

  • 2
    I don't think that's possible. If you looked at who was responsible for the imports (CreatedById) you could somehow filter by that. Visualforce & Lighting support onKeyUp & onKeyDown but I don't think that the standard platform functionality allows you to see whether the text entry is by keyboard or not. – akarnid Jun 5 '19 at 14:10

No, a validation rule cannot determine if the source of a DML operation was from the UI or API. It is theoretically possible to determine some contexts, but you would need to write a trigger to get that level of detail.

| improve this answer | |

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.