Read Only Code for specific field instance, not all

Good Afternoon,
I’ve found quite a few topics on setting a field to Read Only using the Extended Properties, which is great, but I needed to add a read only view of the InvoiceComment to batch main screen for easy visibility. Using Extended properties, it makes InvoiceComment read only in the header tab also, but it needs to be edited there. Can someone help me out with what I need to add to make this work? Tried using the wizards, but doesn’t spell it out enough for me.

Thanks in advance,
Eric

So you want a custom control to be bound to the same data source as the built-in control. And the custom one to be read only, while the original built-in field remains editable?

You can set the custom control’s Enabled = FALSE, and it will still be visible (though light gray), and users won’t be able to edit it. But they still can edit it on the Comments -> Invoice sheet.

The custom control on the Summary sheet:

image

The original control:

image

Correct. I’m adding the visual read only so they can see it along side of the batch list, but the field on the header still needs to be editable. Doesn’t make much sense to me, but that’s how they want it.

Do you mean the Read Only = T/F drop down? That doesn’t do it because it’s bound to the APInvHed.InvoiceComment field. From all the other topics I’ve gone through, says it needs code to do a specific textbox. I know it’s basic, but I just need to be pointed in the right direction.

There are slight differences between the native controls and user added. Most people have problems trying to make a native control be R/O. That requires using the Extended Properties. But that will apply to the data, not the control. So any control bound to that data field, would be R/O.

The Enabled property of a control applies to the control and not the driving data.

See my post with the picts. I added a textbox to the summary sheet, bound it to OrderHed.InvoiceComment, and set the control’s Enabled property to FALSE.

Sorry, was replying from my phone, so I didn’t see the images originally. I did try the Enabled property, but the comment was bigger than the box I created so I couldn’t scroll through the comment. I’m all set now, they are okay with editing the comment in the batch list view, so this was all for nothing. Thanks!!

1 Like

Just to close any last holes… The custom text box you’d add would also need the Multiline and ScrollBars properties changed too.