Question

I have a custom table that I'm basically modeling after the CustGroup table.

The table has two fields, one extends the SysGroup and the other is a Name type. I added an index with AllowDuplicates = No and the one SysGroup field.

And on the table, I set the PrimaryIndex equal to my SysGroup field.

I delete the axapd.aoi file and restarted the AOS. I also ran the cross reference update and SysFlushAOD::main(null);.

When I run the following code, the first line returns 0 and the second 1, meaning it was able to find a primary key.

info(strfmt("MyCustGroup: %1", new SysDictTable(40390).primaryKeyField())); // Returns 0
info(strfmt("CustGroup: %1", new SysDictTable(57).primaryKeyField())); // Returns 1

Any idea what I'm doing wrong?

Was it helpful?

Solution

Your primary key should extend you own extended data type (EDT) extending SysGroup. In the relations node of the EDT have a normal relation to your table and key field. Then change your key field to extend from your EDT.

Set the TableGroup property of your table to Group. Then make sure the table succeeds completely the Best Practice check.

If that does not solve your problem, export, delete and import your table.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top