FavoriteMahi Tangnoo (iLink Digital) posted in Admin 201 Study Group 2021 (Originally asked by Mahi Tangnoo)May 12, 2023, 9:18 AMMahi TangnooHow to lock fields on before update and before insert and show error using triggerScenario is: On" before update" and 'before insert" of opportunityLineitem, a custom field should not get inserted and updated after saving the product details and throw an error saying that " You are not allowed to update this field ". i tried doing null check on this field and show the error in my trigger but its showing error - "sobject row does not allow errors " so i checked the field level security and it has read and write access but still this is coming So if any one could suggest any other alternative approach to achieve this use case using triggers only would be highly appreciated. Thanks,MahiShow MoreAdd a commentWrite a comment...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Mahi TangnooHow to lock fields on before update and before insert and show error using triggerScenario is: On" before update" and 'before insert" of opportunityLineitem, a custom field should not get inserted and updated after saving the product details and throw an error saying that " You are not allowed to update this field ". i tried doing null check on this field and show the error in my trigger but its showing error - "sobject row does not allow errors " so i checked the field level security and it has read and write access but still this is coming So if any one could suggest any other alternative approach to achieve this use case using triggers only would be highly appreciated. Thanks,MahiShow More