| Candidates | Employers
SFDC Trigger, how to add values into the current record in after insert

CRM Applications Discussions


Reply SFDC Trigger, how to add values into the current record in after insert From:
GuestUser
SFDC allows adding values in Before Triggers, but if you need to associate a child, you will need the record id. from this new record. So you try to use After Insert, here you will get id of the record.
HOWEVER SFDC has a locking mechanism NOT to Allow to Insert any values in After Insert runniing Trigger. Bummer!
Of course, you may use a the before insert trigger but no IDs :(.
Below is very cool approach to REQUERY this record while you are on that record! It is tested.
Other approach is to create a copy of the record, not tested.
Below is requery option: You use any other Object instead of Account.:)
Example: Inside After Insert

Account myAccount=trigger.new[0]; //Any object
Account updacc=[select id from account where id = :myAccount.id]; //Query
updacc.type='Enterprise Customer'; //Add!
update updacc;

click to view
Replies to this message: 
-None-
CRMJobs Candidate Tools
Search jobs, review companies, manage your resume, and stay connected without digging through old navigation.
Search CRM Jobs Company Profiles Contact Support Site Map
Business Transparency Public business verification and contact details Expand to review CRMJobs.net public verification, billing, privacy, and support contact details.
CRMJobs.net publishes the public business details below so candidates, recruiters, advertisers, and support contacts can verify the site's business identity, where to find official company pages, and where billing or privacy questions should be directed.
Operating / Published Name CRMJOBS.NET
Public Company Profile View CRMJOBS.NET company profile Published company profile on CRMJobs.net.
Business HQ Los Angeles, California 90249, United States Full street line is not published in the current company record.
Established 1998
Support Email support@crmjobs.net
Privacy Contact support@crmjobs.net
Billing And Member Services MemberServices@crmjobs.net
Refund and billing handling: Billing or refund questions should be sent to MemberServices@crmjobs.net. Upgraded membership changes and cancellation requests should be sent to support or Member Services at least 5 business days before the next billing period.
Terms & Privacy | About Us | Partners | Advertise | Search CRM Jobs | Link To Us
© CRMJobs.net. All Rights Reserved.