I have a checkbox in a custom object in an un-managed package. I will set it to editable in the profile, but read only on a page layout. My logic sets it to ‘true’ within the app. Procedurally, the customer/user will need to reset it to false outside of the app.

When it becomes a managed app:

1) Will the user be able to write an apex trigger to reset it to false? 2) Can the user write a workflow on my custom object?

  • Both options are possible. Triggers and flows run in system context – kurunve Jun 28 '17 at 16:06

Yes, subscribers can always create workflow rules, triggers, and flows that access managed package fields and objects.

| improve this answer | |
  • To test the trigger, I'm executing an update in Execute Anonymous. My test works on standard objects (Contact), but it doesn't recognize my custom object (Project). List<Project> projs = [SELECT Id FROM Project Where Project.PT_PIPROJ__PI_Outbound_Msg_Sent__c = True]; for(Project project :projs){ Project.PT_PIPROJ__PI_Outbound_Msg_Sent__c = False; } update projs; – Boots Jun 29 '17 at 19:45
  • @Stan The names use the __ notation, as NS__Object__c or NS__Field__c. – sfdcfox Jun 29 '17 at 20:08
  • Thanks! I've changed the code (below). I now get the error: 'Invalid character in identifier: PI_SFINT__Project__c'. Part of my problem is that I don't know what line 2 is doing. Can you translate it for me? for(PI_SFINT__Project__c PI_SFINT__Project__c :projs){ ? Here's the fully modified code. List<PI_SFINT__Project__c> projs = [SELECT Id FROM PI_SFINT__Project__c Where PI_SFINT__PI_Outbound_Msg_Sent__c = True]; for(PI_SFINT__Project__c PI_SFINT__Project__c :projs){ PI_SFINT__Project__c.PI_SFINT__PI_Outbound_Msg_Sent__c = False; } update projs; – Boots Jun 29 '17 at 20:54
  • @Stan identifiers can't have double underscores in them. PI_SFINT__Project__c project would be better. – sfdcfox Jun 29 '17 at 21:00

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.