Hello all,
I have come across a situation where users of my application need to be notified of changes made by other users of that same application.
I have come up with a solution but it doesnt work to the desired effect:
Situtaion: When the supervisor logs in and makes changes to the form the values he enters in the fields will turn to red and bold color. So that when the other user (clerk) opens the same record in a form those values are differentiated with the bold red color.
Solution that did not work: I semi-accomplished this by writing code for the onchange event for each field on the form that goes like this:
-----------------
if user_groups()="Manager_Supervisors" then
this.font.color = "red"
this.font.bold = .t.
topparent.refresh_layout()
t1 = table.current()
t1.Updatedby = user_name()
end if
-----------------
Then I used the field properties of each field to construct color and font properties such that the font and color would be bold for the field if the following expression would be true: GARDENING->Updatedby""
However, my problem lies in the latter part of the method. When this method is applied to all fields on the form and any one field is changed by the supervisor, then when the clerk opens the same record in the form all fields become red and bold. I know exactly why this is happening: because even if one field is changed then a value is being entered into updatedby field for that record and the field properties of that record checks the "updatedby" field to make the judgement to bold and color the field.
HOw can I overcome this such that the application would know if the supervisor made changes to a field on the form and then make that fields font bold and red if the clerk opens to view that same record?
Please help me. Any ideas would be appreciated. Thank you
I have come across a situation where users of my application need to be notified of changes made by other users of that same application.
I have come up with a solution but it doesnt work to the desired effect:
Situtaion: When the supervisor logs in and makes changes to the form the values he enters in the fields will turn to red and bold color. So that when the other user (clerk) opens the same record in a form those values are differentiated with the bold red color.
Solution that did not work: I semi-accomplished this by writing code for the onchange event for each field on the form that goes like this:
-----------------
if user_groups()="Manager_Supervisors" then
this.font.color = "red"
this.font.bold = .t.
topparent.refresh_layout()
t1 = table.current()
t1.Updatedby = user_name()
end if
-----------------
Then I used the field properties of each field to construct color and font properties such that the font and color would be bold for the field if the following expression would be true: GARDENING->Updatedby""
However, my problem lies in the latter part of the method. When this method is applied to all fields on the form and any one field is changed by the supervisor, then when the clerk opens the same record in the form all fields become red and bold. I know exactly why this is happening: because even if one field is changed then a value is being entered into updatedby field for that record and the field properties of that record checks the "updatedby" field to make the judgement to bold and color the field.
HOw can I overcome this such that the application would know if the supervisor made changes to a field on the form and then make that fields font bold and red if the clerk opens to view that same record?
Please help me. Any ideas would be appreciated. Thank you
Comment