Like the rest of you, I do tend to favor the minimalist approach. But in this case, I don’t think that changing the editable property on the form control for “Bill-to Customer No.” is the best approach.
The first issue that I see is that it will take more time to implement than you might think. If you’re making the change on the Sales Order form, you’d probably also want to make the change on Sales Quote, Sales Invoice and Sales Cr. Memo. You’d also need to find any forms in the custom range that might need to be updated. And, from now on, you’ll have to remember to make this mod on any new forms that involve the Sales Header.
The second possible problem would be that, aside from the forms you’ve modified, there are too many ways to change the “Bill-to Customer No.” value without applying the new rule. The client could add new or modify existing forms, dataports, reports, codeunits etc. that may inadvertently bypass this new rule. I’m not saying that this will certainly happen, nor that the user would do something like this intentionally. But, it’s possible. And as much as I like concise solutions, I dislike vulnerable solutions even more.
And finally, this approach denies that there might ever be a legitimate reason for having the “Bill-to Customer No.” value be different than the “Sell-to Customer No.” value.
To increase the certainty that the rule would be applied consistently, I would put one line of code either very early (maybe even as the first line) in the OnRun trigger of codeunit 80 Sales-Post, or in the OnInsert and OnModify triggers of table 36 Sales Header. That line would be:
TESTFIELD(“Bill-to Customer No.”, “Sell-to Customer No.”);
Of course, if you did need to allow for the possibility that the values might legitimately be different, then you’d need to add more code at that point.
You could argue that this is just a question of style, but, in my opinion, putting the new code in either the table or the posting codeunit would be a one-time change that probably would not come back to cause me problems in the future. I don’t think the same could be said for putting the new code in the Sales Order form.