E9.2 Headerless Detail - allow user to only ADD a grid line row but not update any existing rows

JohnDanter2

JohnDanter2

VIP Member
HI folks

I've been asked if it's all possible that when a user is in P3111 W3111A (Work Order Parts List) that they cannot update any existing parts lines but they can ADD one at the end of the grid.

I'm not sure how to code this without a fair bit of fiddling, but is there a form mode or security setting that allows this to occur on headerless detail forms at all?
If I untick this Update on Grid Business View and leave this unticked No Adds on Update Grid, would that do it?

Can these attributes be set programatically at all?

Thanks

John
 
Last edited:
Not sure if there is a security setting to accomplish this. As far as ER code goes you could simply disable all fields in the Grid Row in the [Write Grid Line-After] event.

Code:
Disable Grid(FC Grid, <Currently Selected Row>, <All Columns>)

BTW, the properties you are talking about will not accomplish what you want and cannot be set programmatically.
Update on Grid Business View simply specifies whether or not the data bound grid will update the underlying recordset represented by the business view when records in the grid are inserted/updated/deleted.
No Adds on Update Grid will remove the blank line at the end of the grid and not allow a user to add new lines, only edit existing ones - the opposite of what it sounds like you want.
 
Thanks

I was going to use Update on Grid Business View OFF to prevent the updates and leave No Adds on Update Grid unticked so I do get the last line.

Shame this stuff can't be altered with code as you want on the fly
 
Thanks

I was going to use Update on Grid Business View OFF to prevent the updates and leave No Adds on Update Grid unticked so I do get the last line.

Shame this stuff can't be altered with code as you want on the fly
Sorry, yes, the No Adds thing is the setting you want.

I wouldn't do the [Update on Grid Business View] thing though because it would indicate to the user that they can change the record when they can't. Additionally not sure how this app works but a lot of apps don't actually update the data using the data bound grid but actually go off the grid record changed event(s) and programatically disable the updating the DB record from the grid (or they key of this event to do there updates and still disable the DB update). Depending on how this app is constructed, this could also effect the No Adds property as well. If this was originally checked (enabled) in the app there may be a reason for this... it may not be possible to simply uncheck this property and have everything "work" to insert records if the insertion of records is not a straight forward single table insert. For example, this would not work for sales order entry to simply insert records into F4211, since direct F4211 table I/O is not the proper way to create new sales order detail records. Again, I have no direct knowledge of this specific app or how it was constructed. If it is a very simple app with a data bound grid and uses the grid to update the underlying table then it could be as simple as unchecking the [No Adds] property and doing the ER code thing to disable existing lines. But if all updates go through some type of MBF or other BSFN or other process then inserting new lines may be a little more complicated (the ER code to disable existing lines should still be pretty straight forward though - user can't change what they can't edit...).
 
And if you disable the grid only if it has value? When you enter the screen and search and bring some value in the line, it disables these grid lines.
 
We fixed it with a mix of F00950 security SETY = 1 and a specfic role using N Y N on A CHNG DLT
I then wrote a BSFN called in P3111 W3111A Write Grid Line after and it checks F00950 for the user the object and N Y N and comes back with a flag = Y or N
If the flag is Y in P3111 I disbale the the grid in the code

Bit of a mess, but they are happy. As other users need the ability to both amend and add. It's just certain users are only allowed to add
 
Back
Top