05-24-2015 09:45 AM
Is ther a way to get custom entities for a contact record. Lets call the contact:Nick Davies. this contact has an ID:"as4324324asda".
I have a custom table called Novels. Is there a way to get all the novels for contact Nick Davies?
05-26-2015 09:09 AM
05-26-2015 04:22 PM
Thanks , that did work!
07-29-2015 08:52 PM
08-03-2015 01:45 AM - edited 08-04-2015 05:34 AM
@venkatinfy wrote:
Hi Jim,
Can explain the code bit more, I have see the class Entity Manager has no method as the GetCustomSubEntities and also what do you refer for the Me in the code
Me.EntityList = Me.EntityManager.GetCustomSubEntities(Me.ACTApplication.ApplicationState.CurrentContact, Me.EntitySortCriteria, Me.FilterCriteriaACT)
Hi venkatinfy,
This is how I get custom sub-entities for a Contact (C#).
I have taken this out of an older project of mine so I haven't re-tested it, but it certainly worked at the time and might prove useful to you.
You should have your SubEntity defined somewhere in your project. Yours may look a little different, but mine looks like this (SubEntity.cs):
public sealed class MyCustomEntity : CustomSubEntity { public MyCustomEntity(CustomSubEntityInitializationState state) : base(state) { } }
Then I retrieve the entity like this (Main.cs):
Contact MyContact = ... // However you get your Contact goes here CustomEntityDescriptor MyEntityDescriptor = actApp.ActFramework.CustomEntities.GetCustomEntityDescriptor("MyCustomEntity"); CustomSubEntityManager<MyCustomEntity> MyEntityManager = actApp.ActFramework.CustomEntities.GetSubEntityManager<MyCustomEntity>(MyEntityDescriptor); CustomEntityList<MyCustomEntity> MyCustomEntityList = MyEntityManager.GetCustomSubEntities(MyContact, null);
There's a good sub entity sample that you can look at if you haven't already.
It's in C# and for desktop, but shows you how to store and retrieve custom entities.
http://community.act.com/t5/Act-Developer-Downloads/Custom-Sub-Entity-Sample/td-p/307
I unfortunately don't have any Act! for Web samples to share with you.
Hope this helps!
Sam.
08-18-2015 01:41 PM