| Vinayak Tadas[MSFT] 2004-09-23, 9:18 am |
| You can do a search using the CatalogManager.Search method
(
http://msdn.microsoft.com/library/d...-us/csvr2002/ht
m/cs_rp_catalogmanager_net_jjar.asp).
Set the strSQLClause to "ProductId=N'YourProductId'"
If the returned recordset does not contain any records then the product
does not exist
Alternatively you can do something like
Dim oCatalogManager
Set oCatalogManager =CreateObject("Commerce.CatalogManager")
oCatalogManager.Initialize siteName, false
Set oProductCatalog = oCatalogManager.GetCatalog("catalogname")
Set oProduct = oProductCatalog.GetProduct("ProductId")
Dim oProductProperties
if oProduct IS Nothing
listPrice = 3.0
Set oProductProperties =
oProductCatalog.CreateProduct("Definitionname", "produductid", listPrice)
Else
Set oProductProperties = oProduct.GetProductProperties()
End if
' Update properties in the oProductProperties recordset and if you want to
save the properties call
oProduct.SetProductProperties()
--------------------
Thread-Topic: CommerceServer Product Creation.
thread-index: AcSfKMyPdjbYwCpFQwC8S1J7PXSPDA==
X-WBNR-Posting-Host: 194.128.184.5
From: =?Utf-8?B?VmlzaGFs?= <Vishal@discussions.microsoft.com>
Subject: CommerceServer Product Creation.
Date: Mon, 20 Sep 2004 08:45:05 -0700
Lines: 9
Message-ID: <7BEDC347-EBEC-4A71-8F33-BE78121F3713@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.catalog
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.catalog:4956
X-Tomcat-NG: microsoft.public.commerceserver.catalog
Hello All,
Is their any method or property which returns True/False... if the Product
exists in the catalog.
I get an Product ID from an external system and I have to search it in the
Database before creating or updating it.
Kindly let me know.. ASAP
Vishal
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only. Thanks
|