11-01-2011 04:23 AM
Hi All,
Does anyone know how to CHANGE the Product.Type Field?
Preferably in vb.net for Sage ACT! 2011
This is rather urgent.
Please - anyone?
Much obliged,
Kevin
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.
Cheers,
Kevin
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[0]).ToString();
11-01-2011 06:29 AM
Hey Matthew,
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.
Cheers,
Kevin
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.
Thanks again,
Kevin
11-01-2011 06:34 AM
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:15 AM
Yes, I noticed that too.
Interesting. Innit?
:-)
Still haven't cracked your code yet though.
Cheers
Kevin
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.
11-01-2011 07:32 AM
Thanks Matthew!
Cheers,
Kevin