function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rupert McArt 8Rupert McArt 8 

Apex Trigger running for one user, but not another

Hi - We have a Custom Button set up on Opportunties that will create an Order for a closed Opportunity.  We also have a trigger that will pulls the Op product line items onto the order.

I have an issue with a user. When they click the custom button, the product line items do not map to the order (but she can still create the order)

I've changed her role and profile to the same as mine, and tried again with the same opportunity.  When I do it - the line items map over, when I log in as her, they do not.  Neither of us have any permission sets on our profiles.  Is there somewhere else I should be checking?

(PS I'm an Admin not a Dev!)


Vijay NagarathinamVijay Nagarathinam
Hey Rupert,

Generally the apex trigger is run in system mode, it will not check the corresponding user permissions and profile permission. If you have used any visualforce page then make sure whether the corresponding user having access or not.

Please let me know if you need any help regarding this.

Rupert McArt 8Rupert McArt 8
Hi - but are the Visualforce page not assigned based on profile? Even if I change the user profile (to the same as mine, which works), the products still do not copy over.


Pankaj PPankaj P
Hi Rupert,
According to me, I think this problem seems to be in the trigger where Product items are getting mapped to the Order being created. The code in trigger might be looking for some criteria to select product items based on the current User and adding/mapping those records only to the Order. It might be a case if the product items are created by you and not other user for whom its not working.

I will recommed you to verify with your developers if there is something in code related to this issue.

Rupert McArt 8Rupert McArt 8
Yup - could well be the issue - unfortunatley we don't have Dev Support - I'll see if SF can help.  Thanks