I'm new to Salesforce and even newer to apex, so I'm struggling a bit here.
My goal is to lock down an Opportunity once a sales order has been generated on my company's side. My current idea is to have a custom read-only "Locked" field within the Opportunity object. I want to use the SOAP API to update this value and then have an Apex Trigger (after update) set all the fields in the Opportunity to read-only.
Where I am getting slowed down is in writing an Apex trigger to set fields to read-only, currently I only have the boilerplate code
trigger lockOpportunity on Opportunity (after update) {
for (Opportunity myOpp : Trigger.new){
myOpp.setAllMyFieldsToReadOnly;
}
}
I can get as far as setting specific values, along the lines of myOpp.Description = "opp description";
but I don't know how to access field properties to set them to read-only. Or, if there's a way to lock down the entire object in a single call, that would be even better.
Thanks.