Reputation: 39108
By default, when creating a new account, the composite address control displays three lines for entries (Street_1, Street_2 and Street_3). It looks really inappropriate in our scenario so I'd like to remove one of there. In fact, I'd like to gain a full control of what's shown and what's hidden.
According to this blog, we can resolve this by application of business rules. I don't like it one bit.
We need to rely on a condition from one field to affect the others for the rule to kick in. It feels like giving up to the stupid computer and cheating, without actually gaining control. And lastly - it'll be a huge number of rules bouncing around back and forth in my case. Baaad karma.
How can I control the contents of a composite control?
Upvotes: 0
Views: 671
Reputation: 18895
The article mentions that hiding a field on a form, hides it on the composite address control as well. Not sure if there is some other magic going on behind the scenes, but if there isn't, just add javascript to hide the field.
Here is a little helper function:
setVisible: function (controlName, visibility) {
// Do we need to be here?
if (!controlName) { return; }
if (!Xrm.Page.getControl(controlName)) { return; }
// Set visibility.
Xrm.Page.getControl(controlName).setVisible(visibility);
},
Upvotes: 1