01-14-2008 01:30 PM
by aweekes1 on 11-26-2007 3:29 AM
Hi,
As the post title suggests, this is probably a very simple problem but I'm quite new to Act! so I'm struggling a little!
I want to set the parent company based on a custom field, it's simple enough logically to search the relevant field, pull back the company and supply it to the setparent command but I just can;t seem to get my head around how to build a ifiltercriteria in VB.Net.
Has anyone got some sample code laying around that does this?
Appologies for this not being an interesting web plugin question but it would really help me out.
Cheers,
Adam.
01-14-2008 01:31 PM
by ACTwiz on 11-27-2007 7:52 PM
Im not 100% sure, but I think there is some basic filter code in the SDK documentaion, look thru all of the code stuff, it takes a while to understand where they put stuff. Let me know if that doesn't help.
03-11-2008 10:58 AM
03-25-2008 01:47 PM
03-28-2008 01:39 PM
03-28-2008 01:46 PM
03-24-2009 11:51 AM
I am trying to filter my data before retrieving it to a local list.
rscherrer wrote:
HiFor building a company/contact/group -list you could use the Lookup functionality
->Act.Framework.Lookups.LookupManager
How does that work? The SDK documentation is not clear on this point? And what is the difference between a filter and a LookupManager? They both require you to understand the table schemas (LookupManager requires CriteriaColumn/late binding to a column name, Filter requires GroupFieldDescriptor/late binding to a column name). What is the difference? Why would you say one is better than the other?
I am also having trouble with filters - due to this late binding issue. Where does one find the name of the tables and columns? Where is the documentation?
This next comment is more to the Act SDK developers - what is the wisdom of this late binding architecture? Why did you mix database fields and objects together? It makes for a frustrating blend of the worst of both worlds - not quite as good as a database/none of the intellisense of an object. Am I the only one to notice this?
03-25-2009 12:48 AM
Hi
Lookup:
Below you will find a sample for the Lookup functionality
Table/column names:
Even in the SDK (2005) was a file ACT! 2005 SDK Sample Code which contains a list of tables and the related columns I get this list out of ACT by using code.
All managers (ContactManager, CompanyManager, ....) do have a member GetFieldDescriptors() which returns an array of DBFieldDescriptor. You can use this as the Datasource property of a a DataGrid(--View). This will display all fields of the current DB (including custom fields and the table holding them-> spillover table)
Private Function LookupSample() As Act.Framework.Contacts.ContactList
Dim FWK As Act.Framework.ActFramework = ACT_SQL.ACTFramework
Dim SearchCriteria() As Act.Framework.Lookups.Criteria
Dim SortCriteria() As Act.Shared.Collections.SortCriteria
SortCriteria = New Act.Shared.Collections.SortCriteria() { _
New Act.Shared.Collections.SortCriteria( _FWK.Contacts.GetContactFieldDescriptor("TBL_CONTACT.LASTNAME", True), _
System.ComponentModel.ListSortDirection.Ascending) _
}
Dim colDepartment As Act.Framework.Lookups.CriteriaColumn = _FWK.Lookups.GetCriteriaColumn("TBL_CONTACT.DEPARTMSearchCriteria = New Act.Framework.Lookups.Criteria() { _ENT", True) New Act.Framework.Lookups.Criteria(Act.Framework.Lookups.LogicalOperator.End, 0, 0, colDepartment, _
Act.Framework.Lookups.OperatorEnum.ContainsData, _
Act.Framework.Lookups.ValueEnum.Nothing) _
}
Dim lkContacts As Act.Framework.Lookups.ContactLookup = _FWK.Lookups.LookupContactsReplace(SearchCriteria, True, False)Dim cList As Act.Framework.Contacts.ContactList = lkContacts.GetContacts(SortCriteria)
Return cList
End Function
03-31-2009 12:31 PM - edited 03-31-2009 12:51 PM
Thanks rscherrer - I'll give it a try.
Does anyone have any less verbose way to write a filter? The example here seems more than a little extreme in terms of the lines of code.
The original example (that uses iFilter) just doesn't work for me. I keep getting a SQL error, so I might be stuck with the example below.
04-01-2009 02:18 PM
I'm sorry, I thougt you were familiar with getting an ActFramework instance, so I decided to leave that part as I use it in my framework for ACT.
ACT_SQL.ACTFramework is the way I get an instance of ActFramework.
If you intend to use the code in a application out of ACT you can get it by
.......
Dim FWK as New ActFramework
FWK.login(.....)
........
or if running in a plugin you can get it from the Act.UI.ActApplication parmeter in the OnLoad event whithout the need for login:
Overridable Sub OnLoad(ByVal APP As Act.UI.ActApplication) Implements Act.UI.IPlugin.OnLoad
Dim FWK as ActFramework = APP.ActFramework
......
......
End Sub
I am sure you will find samples in the SDK which explains that point.
IFilter
I do not know if my IFilter-code still works for the current versions of ACT, since I used it in ACT 8/2006. But I will try it again and keep you informed as soon I know more.