www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  DB/Text for Libraries    Validation Lists
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Posted
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
 
Posts: 14 | Registered: Sat January 08 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
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.
 
Posts: 1888 | Location: Woburn, MA, USA | Registered: Thu July 13 2000Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
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
 
Posts: 14 | Registered: Sat January 08 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
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();
}
 
Posts: 1888 | Location: Woburn, MA, USA | Registered: Thu July 13 2000Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
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.
 
Posts: 1888 | Location: Woburn, MA, USA | Registered: Thu July 13 2000Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  DB/Text for Libraries    Validation Lists