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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create multi-key with autonumber

Status
Not open for further replies.

exelent

Programmer
Feb 20, 2008
3
0
0
BA
I'm very new to clarion. Beginner.
I need to know is it possible to create key (index file)
with two or more then two fields and last field is control to make autonumber.
Example.
Key: GRUPA_SIF+ART_SIF
Data:
1. 001+0001
2. 001+0002
(Here I need 001,0003)
3. 002+0001
4. 003+0001
5. 003+0002
6. 003+0003
Next, When I choose GRUPA_SIF field when I Insert new record and choose (001) and how to get 0003 number next
number into that group of articles.
 
Hi!

Are you using ABC or Legacy templates?

Regards
 
I think this is ABC.
On the Template TAB with my APP, I see
"Class ABC - Application Builder Class Templates"

And then is my application on the tree
 
Hi,

ABC is easier. Since you have a multiple-column key with auto-numbering, you need to ideally generate the next key value after all the initial columns of the key have been populated. So, on the EVENT:Accepted embed of the GRUPA_SIF column, you execute the following code :

IF GRUPA_SIF AND SELF.Request = InsertRecord
IF Access:<TableName>.GetAutoIncDone()
Access:<TableName>.CancelAutoInc()
END
Access:<TableName>.PrimeAutoInc()
END

Is the Browse calling this Form range-limited by GRUPA_SIF i.e. is GRUPA_SIF automatically populated on opening the Form?

Regards
 
This function work fine with some problems.

GetAutoIncDone()
!Syntax Error: Field Not found: GETAUTOINCDONE
Unknown function label

And this function not exist into help file
Exist AutoIncDone but same, dont work.
If I remove IF statement,function work and
I get new number. This look like this into embed.

IF ?ART:GRUPA_SIF AND SELF.Request = InsertRecord
!IF Access:ARTIKLI.GetAutoIncDone()
! Access:ARTIKLI.CancelAutoInc()
!END
Access:ARTIKLI.CancelAutoInc()
Access:ARTIKLI.PrimeAutoInc()
END

Is there any problem if I continue to use this function
without GetAutoIncDone().
You help me much and I thank you for your fast respond.

Best Regards !
 
Hi!

What version of Clarion are you using?

Yes, you can just use :

Access:ARTIKLI.PrimeAutoInc()

and if that does not work :

Access:ARTIKLI.CancelAutoInc()
Access:ARTIKLI.PrimeAutoInc()

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top