Community
Showing results for 
Search instead for 
Do you mean 
Reply

how to create new table ?

Avid Listener
Posts: 83
Country: Malaysia

how to create new table ?

hi all,

 

how i can create new table in ACT db ?

 

Thanks.

Copper Super Contributor
Posts: 59
Country: USA

Re: how to create new table ?

The custom tables are kind of hard to go over it here, but the initial method you want to look at is:

 

Dim customJO As Act.Framework.CustomEntities.CustomEntityDescriptor = ActFramework.CustomEntities.CreateCustomSubEntity(........custom table parameters.....)

 

Dim field As New FieldDescriptor(fieldName, fieldName, customEntity, dataType)

 

ActFramework.Fields.Save(field) 

 

I still advise you to go through the SDK documentation on this. Cause then there's the whole issue of retrieving the table you just created. 

 

 

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Avid Listener
Posts: 83
Country: Malaysia

Re: how to create new table ?

Hi Hugovale ,

 

Thanks for the sample code.

Will try the code and revert.

 

I need create a new table due to i had sales history table from foxpro that need to import into ACT table.

 

Thanks,

Jeff.

Avid Listener
Posts: 83
Country: Malaysia

Re: how to create new table ?

Hi HugoVale,

 

I`m tried convert it into c# but encountered errors.

 

Act.Framework.CustomEntities.CustomEntityDescriptor customJO = ActFramework.CustomEntities.CreateCustomSubEntity();

 

FieldDescriptor field = new FieldDescriptor(fieldName, fieldName, customEntity, dataType);

 

ActFramework.Fields.Save(field);

 

Error 14 An object reference is required for the non-static field, method, or property 'Act.Framework.ActFramework.CustomEntities.get' C:\Users\Jeff Ng\Documents\ACT\Framework 5.0 Gold 2008\UbsaccConnector\Form3.cs 307 81 UbsaccConnector

Thanks,

Jeff.

Avid Listener
Posts: 83
Country: Malaysia

Re: how to create new table ?

Hi HugoVale,

 

I`m had changed my code to this.

 

customSH = ActFwk.CustomEntities.CreateCustomSubEntity("Sales_History","Sales_History",(ParentEntity)1,true);

 

field =
new FieldDescriptor(ref_no, customSH, eFieldType);

ActFwk.Fields.Save(field);

 

i tried to access the field and insert records into it.

 

Thanks,

Jeff.