Community
Showing results for 
Search instead for 
Do you mean 
Reply

Adding rows to custom table - VB.net

Accepted Solution Solved
New Member
Posts: 2
Country: United_Kingdom
Accepted Solution

Adding rows to custom table - VB.net

Hello,

 

I was wondering if anyone has sample code in VB.net for adding records to a custom table using the SDK?

 

Thanks

 

 


Accepted Solutions
Solution
Accepted by topic author pmcg
‎03-03-2016 06:00 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Adding rows to custom table - VB.net

[ Edited ]

' SUDO CODE

 

' Get the Entity Descriptor

Dim childEntityDescriptor As CustomEntityDescriptor = Nothing

childEntityDescriptor = HostFramework.CustomEntities.GetCustomEntityDescriptor("MyChildEntityName")

 

' From the Entity Descriptor now you can get et the Child Entity Manager

Dim ChildEntityManager As CustomSubEntityManager(Of Act.Framework.CustomEntities.CustomSubEntity) = Nothing

ChildEntityManager = HostFramework.CustomEntities.GetSubEntityManager(Of Act.Framework.CustomEntities.CustomSubEntity)(childEntityDescriptor)

 

'Now you have the ChildEntityManager you can create a new record/row
Dim ChildSubEntityItem As Act.Framework.CustomEntities.CustomSubEntity= ChildEntityManager.CreateEntity()

 

' You need to set at least one top level entity, here I am attaching a list of Contacts ( YOU need to code this ChildCOntactList)

ChildSubEntityItem.SetContacts(ChildContactList)

 

' Save the changes
ChildSubEntityItem.Update()

 

 

Hope this helps

-- Jim Durkin

View solution in original post


All Replies
Solution
Accepted by topic author pmcg
‎03-03-2016 06:00 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Adding rows to custom table - VB.net

[ Edited ]

' SUDO CODE

 

' Get the Entity Descriptor

Dim childEntityDescriptor As CustomEntityDescriptor = Nothing

childEntityDescriptor = HostFramework.CustomEntities.GetCustomEntityDescriptor("MyChildEntityName")

 

' From the Entity Descriptor now you can get et the Child Entity Manager

Dim ChildEntityManager As CustomSubEntityManager(Of Act.Framework.CustomEntities.CustomSubEntity) = Nothing

ChildEntityManager = HostFramework.CustomEntities.GetSubEntityManager(Of Act.Framework.CustomEntities.CustomSubEntity)(childEntityDescriptor)

 

'Now you have the ChildEntityManager you can create a new record/row
Dim ChildSubEntityItem As Act.Framework.CustomEntities.CustomSubEntity= ChildEntityManager.CreateEntity()

 

' You need to set at least one top level entity, here I am attaching a list of Contacts ( YOU need to code this ChildCOntactList)

ChildSubEntityItem.SetContacts(ChildContactList)

 

' Save the changes
ChildSubEntityItem.Update()

 

 

Hope this helps

-- Jim Durkin

Highlighted
New Member
Posts: 2
Country: United_Kingdom

Re: Adding rows to custom table - VB.net

Thanks Jim, will be a great help working with the Impact Suite custom tables we have created.