Community
Showing results for 
Search instead for 
Do you mean 
Reply

Opportunity Product Type

Accepted Solution Solved
Copper Contributor
Posts: 70
Country: USA
Accepted Solution

Opportunity Product Type

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


Accepted Solutions
Solution
Accepted by topic author kritguy
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

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

 

 

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Opportunity Product Type

[ Edited ]

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();

 

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

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

Employee
Posts: 1,163
Country: USA

Re: Opportunity Product Type

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. 

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

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

Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

I might look into them. Cheers for the idea :-)
Employee
Posts: 1,163
Country: USA

Re: Opportunity Product Type

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.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

Yes, I noticed that too.

 

Interesting. Innit?

 

:-)

 

Still haven't cracked your code yet though.

 

Cheers
Kevin

Employee
Posts: 1,163
Country: USA

Re: Opportunity Product Type

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.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 70
Country: USA

Re: Opportunity Product Type

Thanks Matthew!

 

Cheers,
Kevin