|
Home > Archive > Commerce Server Catalog > March 2005 > How to programmatically check for product in CS when not in catalo
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to programmatically check for product in CS when not in catalo
|
|
| Aaron L. Richards 2005-03-04, 5:49 pm |
| I am building a Commerce Server Catalog programmatically. I need to know how
to check for the existence of a product definition (the name, not properties)
when the products aren't in a catalog.
As I understand it I would go:
Microsoft.CommerceServer.Interop.Catalog.ProductCatalog pc =
catContext.GetCatalog(catalogName);
product = pc.GetProduct(productName);
and I could check to see if product was null or not. The problem is that
you need a catalogName. My products aren't in a catalog yet, and catalogName
can't be Type.Missing or String.Empty
What do you do under these circumstances?
Any help is appreciated. Thank you!
| |
| Vinayak Tadas[MSFT] 2005-03-07, 8:46 pm |
| You can do a Search using the CatalogManager object.
--------------------
Thread-Topic: How to programmatically check for product in CS when not in
catalo
thread-index: AcUgzldNEmAKmJLSRbWWJm1tgBOwxg==
X-WBNR-Posting-Host: 24.11.111.215
From: "=?Utf-8?B?QWFyb24gTC4gUmljaGFyZHM=?="
<AaronLRichards@discussions.microsoft.com>
Subject: How to programmatically check for product in CS when not in catalo
Date: Fri, 4 Mar 2005 07:25:05 -0800
Lines: 18
Message-ID: <722EC183-B481-4E7B-80C3-327B68D76370@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: TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.catalog:5292
X-Tomcat-NG: microsoft.public.commerceserver.catalog
I am building a Commerce Server Catalog programmatically. I need to know
how
to check for the existence of a product definition (the name, not
properties)
when the products aren't in a catalog.
As I understand it I would go:
Microsoft.CommerceServer.Interop.Catalog.ProductCatalog pc =
catContext.GetCatalog(catalogName);
product = pc.GetProduct(productName);
and I could check to see if product was null or not. The problem is that
you need a catalogName. My products aren't in a catalog yet, and
catalogName
can't be Type.Missing or String.Empty
What do you do under these circumstances?
Any help is appreciated. Thank you!
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
| |
| Robert Bogue [MVP] 2005-03-09, 5:50 pm |
| You can always create an empty catalog. You can try to create a new product
with a definition and see if it fails...
"Aaron L. Richards" <AaronLRichards@discussions.microsoft.com> wrote in
message news:722EC183-B481-4E7B-80C3-327B68D76370@microsoft.com...
>I am building a Commerce Server Catalog programmatically. I need to know
>how
> to check for the existence of a product definition (the name, not
> properties)
> when the products aren't in a catalog.
>
> As I understand it I would go:
>
> Microsoft.CommerceServer.Interop.Catalog.ProductCatalog pc =
> catContext.GetCatalog(catalogName);
>
> product = pc.GetProduct(productName);
>
> and I could check to see if product was null or not. The problem is that
> you need a catalogName. My products aren't in a catalog yet, and
> catalogName
> can't be Type.Missing or String.Empty
>
> What do you do under these circumstances?
>
> Any help is appreciated. Thank you!
|
|
|
|
|