Community
Showing results for 
Search instead for 
Do you mean 
Reply

how to Add values to CustomSubEntity

New Member
Posts: 8
Country: USA

how to Add values to CustomSubEntity

I created a new CustomSubEntity using the above mentioned code and it's working good.(I checked by attaching the database and found the new table with column names)

CustomEntityDescriptor descriptor = actFrmWrk.CustomEntities.CreateCustomSubEntity("CUSTOM_CONTACT_TABLE", "AllCustomContactFields", (ParentEntity)1, true);

 FieldDescriptor fieldDescriptor = newFieldDescriptor("MyUniqueID", descriptor, FieldDataType.Character);

 FieldDescriptor fieldDescriptor1 = newFieldDescriptor("AnotherColumn1", descriptor, FieldDataType.Character);

 FieldDescriptor fieldDescriptor2 = newFieldDescriptor("AnotherColumn2", descriptor, FieldDataType.Character);

 actFrmWrk.Fields.Save(fieldDescriptor);

actFrmWrk.Fields.Save(fieldDescriptor1);

actFrmWrk.Fields.Save(fieldDescriptor2);

Now the issue is that I dont know how to assign values(the data) to the above mentioned custom data using .net Code.

 

Employee
Posts: 1,163
Country: USA

Re: how to Add values to CustomSubEntity

You can set field values for custom entity fields similar to how you would for other fields. The pseudo could would look something like:

 

CustomEntityFieldDescriptor myCustomField = MyCustomSubEntityManager.GetCustomSubEntityFieldDescriptor("TBL_MYTBL.MYCOLUMN");

myCustomField.SetValue(object, value);

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 8
Country: USA

Re: how to Add values to CustomSubEntity

Thanks Mathew

but issue I faced with this is I don't know what the object should be in the myCustomField.SetValue(object,value).

 

In some of the threads I saw it should be SuEntity.But I am not able to find how to get subentity out of fielddescriptor.