robowen Posted April 6, 2006 Posted April 6, 2006 Hi all, Each one of my Records has a Contract layout but not every record has a contract. When I come to draw up a new contract I would like to find the last contract number in the field using a button on the Contract layout. Any ideas?
Søren Dyhr Posted April 6, 2006 Posted April 6, 2006 A reverse sort order for the relation comes to mind! --sd
robowen Posted April 6, 2006 Author Posted April 6, 2006 Can I just sort by the contract field and then copy and paste that number in my new record?
Raybaudi Posted April 6, 2006 Posted April 6, 2006 Hi how about a calculated field (LastContractNumber) and calc: Max(rel::contractNumber) ?
Søren Dyhr Posted April 7, 2006 Posted April 7, 2006 I do hardly suggest anyone to utilize copy/paste, and in particular now when GeNthRecord( esists. I know I was a little snotty in my previous reply, because what if not relations exists. What you can do is to make a valuelist based upon the contractnumber, the issue you probably here raises, is that autoentering isn't strictly fitting into your business model which could be "Give the emperor what is the emperor's and give God-what is God's." kind of bookkeeping Set Field [ Untitled::contractNumber; GetAsNumber ( RightWords ( ValueListItems ( Get ( FileName ) ; "theNumbers" ) ; 1 ) )+1 ] What it does is to sort the numbers prefereably with leading zeros via a valuelist, causing the latest entry to latest in the valuelist, convert the list which is in textformat back into numerical and add one to it. --sd
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now