11-02-2011 10:18 AM
Problem resolved with some help from Tom Davis in the UK.
The code has been implemented in MiddlewareSDK for Sage ACT! and is accessible to Visual Basic 6 as a plugin.
Thanks for your generous help anyway Matthew.
11-01-2011 06:25 AM - edited 11-01-2011 07:25 AM
The real name for the product type field is TBL_PRODUCTSERVICE.ITEMTYPE.
Unfortunately, nothing I have is in VB, but I do have an snippet that gets the value for a custom product field, hopefully it's helpful.
Opportunity o = _ActApp.ApplicationState.CurrentOpportunity; CustomEntityList<OpportunityProduct> OppProds = o.GetProducts(null); CustomEntityFieldDescriptor fdlDesc = _ActApp.ActFramework.Products.OpportunityProductManager.GetCustomEntityFieldDescriptor("TBL_PRODUCT.NAME", true); string s = fdlDesc.GetValue(OppProds).ToString();
11-01-2011 06:29 AM
Thank you sooooo much. I was almost ready to resort to banging it in at SQL Level with the SA Password...
...I really appreciate your kindly coming up with the code, albeit in C Sharp.
I am Sir, much obliged.
11-01-2011 06:31 AM
It's my pleasure, there are some very good translators out there to swap between c# and vb.net, it'll miss some of the act specific methods but it saves you from having to do all the work.
11-01-2011 06:33 AM
Do you know if it will work with "Product.Type" ??
When browsing the data at SQL Level, it seems that the table is PRODUCTSERVICE and not PRODUCTS...
...OK, I will hack away and see what happens.
11-01-2011 07:10 AM
I poked around a bit in SQL and the ProductService.Type is the one that you want, I made some changes to existing products and the type remained null for Product.Type but was changed for ProductService.Type.
11-01-2011 07:29 AM
Here's what the translator @ http://www.developerfusion.com/tools/convert/csharp-to-vb/ spit out:
Dim o As Opportunity = _ActApp.ApplicationState.CurrentOpportunity Dim OppProds As CustomEntityList(Of OpportunityProduct) = o.GetProducts(Nothing) Dim fdlDesc As CustomEntityFieldDescriptor = _ActApp.ActFramework.Products.OpportunityProductManager.GetCustomEntityFieldDescriptor("TBL_PRODUCTSERVICE.ITEMTYPE", True) Dim s As String = fdlDesc.GetValue(OppProds(0)).ToString()
I'd be surprised if it worked as is, but it ought to get you very close.