• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

How do I prevent a line item from being edited after it is entered?

I have a master-detail form ( a sales form with sales line items ).  After a user completes a line item, I want to prevent that user from editing it.  They can go ahead and click on the delete button and re-enter if they have to.  I am creating an audit trail for the sales form.  I modded the delete button script to insert a record to the audit database when clicked, but I want to "lock" the fields from being modified after the line item is completed.  This is using FM 6, so we are going pretty far back.

Thanks!
0
ITMikeK
Asked:
ITMikeK
  • 3
  • 2
1 Solution
 
Will LovingPresidentCommented:
There are a number of ways to do this in FM 7 and later using script triggers. In FM 6, while you can use a validation calculation, the simplest way to go about it is to make the field a button that runs a script. When the user clicks on the field to enter something, the script runs and checks to see if the field already has a value in it. If it does, it denies entry (Exit Record). If the field is empty, it uses the Go To Field script step to put the user into the field.

I would turn off field access entirely for any of your Sale Line Items so that the user must click on it to enter.

There are other methods using field validations and it's even possible to run scripts similar to an FM7+ script trigger by using the old free ZippScript plugin (or the similar DoScript plugin) and specifying the script by name in the validation calculation. However, running a script on validation means that the user has already entered the field and possibly edited, something you can use a Revert to correct but it might Revert other things at the same time....

http://www.filemakermagazine.com/plugins/zippscript.html
0
 
ITMikeKAuthor Commented:
Checking this solution out now.  Will let you know in 24 hours.
0
 
ITMikeKAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for ITMikeK's comment #a39230996

for the following reason:

Thanks!
0
 
Will LovingPresidentCommented:
A solution was provided that was apparently successful but was not accepted....
0
 
ITMikeKAuthor Commented:
I don't know why it said 0 points.  It was supposed to be 500 points.  Solution provided!  Sorry about any confusion.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now