|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Hi!
I am using InMagic to run a small library. Currently, to sign out items one must enter in a term of loan. We always use the same loan period, and it is the only number in our validation list. I was wondering if there was a way to have the loan-period automatically appear in the term field on the lending screen, without having to type it in each time. Thanks! Matthew Matheson Progress Centre for Early Intervention |
|||
|
Yes, you could do that using either a record skeleton or a form script.
Since the Loan> Lending form already has a script, you could add this function: function onRecordNew() { Form.boxes("boxTerm").content = "7"; } Where 7 represents whatever you want to set your loan term to. |
||||
|
It worked, thank you!
Is there something I can add to the script so that the automatically-generated term is added to the loan date and displayed in the Loan Due Date field? (It will calculate the due date if one puts the cursor in the Term field, but that defeats the purpose of having the number appear automatically) Thanks! Matthew Matheson Progress Centre for Early Intervention |
||||
|
The Loan Due Date is a Computed Number field. If you save, or refresh the window, or tab out of the box for one of the argument fields, the box will be populated.
Change the script to: function onRecordNew() { Form.boxes("boxTerm").content = "7"; Command.refreshWindow(); } |
||||
|
Note that you could also just change the Formula for the Loan Due Date in Edit Textbase Structure to:
'Loan Date' + 7 where 7 represents your loan term. (The Term of Loan field would then become irrelevant.) But then you wouldn't be able to 'renew' the book by editing the Term of Loan field. And it might introduce other unforeseen problems with the complex scripts in DB/Text for Libraries. If it were me, I'd just modify the script as suggested above. |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

