Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

progression 7.7.200 sql2000 need to record username in mode=add

Status
Not open for further replies.

rollover

IS-IT--Management
Nov 6, 2007
9
US
we need to record the username of the clerk when an order is entered in OE0101 and display the info but protect it from change. I have Flexibility and was going to display the info with a variable label and store it in user_def_field_5. The problem it I can only select "Add Push Button" (others are greyed out) from the special menu in developer.
the environment is as follows:
Macola Progression 7.7.200
MS SQL server 2000 latest SP
Flex 7.7

So the question has three parts...
1. am I on the right track using a label to display the data so that it can't be touched?
2. is there an easier way to do this that I'm missing?
3. what would prevent me from adding an obvect that isn't a push button?

thanks in advance,
John
 
Why do you feel the need to add a push button as opposed to just saving the user name in the user defined field?

Also the user name is already saved in the audit trail tables. What are you trying to accomplish?

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Dgillz,
Thanks for the reply. I was going to use a label to display the info and store it in user_def_fld_5 so that it couldn't be changed. I need to add the order originator to the ack and picking forms, since the audit table info isn't available to the forms it is useless in this context. I think I've devoloped a workable solution. Here's the code if you'de like to see what I did:

If macForm.mode = Add Then
User_def_fld_5.Text = macForm.UserName
If CustNo.Text = "" Then CustNo.SetFocus Else BILLNAME.SetFocus
Else
If CustNo.Text = "" Then CustNo.SetFocus Else BILLNAME.SetFocus
End If

So basically I'm protecting the field by shifting focus elsewhere to prevent it from being edited.
-John
 
Please answer my question: Why do you feel the need to add a push button as opposed to just saving the user name in the user defined field when the order is saved?

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Re-read the initial post.
"... and was going to display the info with a variable label ... The problem (is) I can only select 'Add Push Button' (others are greyed out)" "3. what would prevent me from adding an object that isn't a push button?"
I never planned on using the push button for this, I just wanted to make the information untouchable to the user. I now know that this is because the cobol program can only handle 120 fields and the OE0101 screen is maxxed out.
 
You do not need to add a push button to save this info to the user defined field. Nor do you need to expose the user defined field on the screen, protect it, or for that matter, even modify the screen.

Capture the macuser and on the appropriate event, update the user defined field with a SQL statement. No fields are necessary.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Good point. This is my first flex project and I'm trying to get a handle on what all is possible. Management wants the information to be exposed on the form but not editable for "psychological reasons" (quoted from the owner). If you were asked to code this which trigger would you use and how would you protect the field?
 
Sorry for the delay. I am not sure this is possible. In order to change a fields value for display purposes, the field must have focus. If the field is disables (display only) it will never have focus.

If management can live with the value saving in the field when you save the order, all the people who subsequently go into that order will see the user, but the initial user who added the new order will not see this.

In terms of how to do this, it goes a bit beyond the scope of this forum, but you would need to capture the user with an environment variable, and on the form save even run the SQL statement to update the OEORDHDR.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Don,
Thanks for your help. I got it working well enough to pass mgmt review. Here is the code I used:
Code:
Sub CSR_GotFocus()
Dim macUID As String
macUID = macForm.UserName
If macForm.mode = Add Then
    CSR.Text = macUID
    If CustNo.Text = "" Then CustNo.SetFocus Else BILLNAME.SetFocus
Else
    If CustNo.Text = "" Then CustNo.SetFocus Else BILLNAME.SetFocus
End If

End Sub

The "CSR" field is actually "user_def_fld_5", renamed in designer. The "SetFocus" directives keep the user from grabbing the field long enough to change it.

Thanks again,
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top