
4 件の回答
Those workflow rules are correct, it seems (although you might as well set them to "Only when an object is created" for the sake of clarity). Did you activate your workflow rules?
Before I go into the below discussion: do you expect that there will be exactly one (or zero) Plan Details object for every account? If this is the case, then why not just put all these fields on Account, and change the Account's record type according to the plan to show the appropriate fields? This would be vastly simpler. In general, 1-to-1 custom objects aren't such a good idea. Custom objects really like to be 1-to-many.
Now, having said that:
Perhaps you were expecting them to change all your existing Plan Details' record types, or that if you changed the Plan on the Account that the Account's underling Plan Details would change? These workflow rules won't do that -- they will only ensure that a new Plan Details' record type will match the Plan of its account.
If you expect that customers are going to change their Plan after they have a Plan Details object, then you need an Apex trigger. If this is the case, then you're going to have to write some code anyway. If this is true and you also have a bunch of existing Plan Details to change, then you can use mostly the same code to do both. You'll need an after update trigger on Account that iterates through Plan Details under it and changes the record type; but if you also need to change a bunch in batch, then you can put that "record type changing" code into a class and reuse it to change all existing plan details. Maybe you could trigger that batch one with a custom button.
If you just need to change all your existing Plan Details' record types, another way is to export them all with Data Loader (along with their account's Plan, perhaps that you've got in the Plan Details record itself using a formula field like Account__r.Plan) and use Excel to change their record types conditionally, then reimport them.