Link to home
Start Free TrialLog in
Avatar of apollo7
apollo7Flag for United States of America

asked on

CRM 2011 How to Create a Quote with same QuoteID and QuoteNumber

We have a highly customized CRM 2011 system that has two quotes with the same quote id and the same quote number in FILTEREDQUOTECLOSE table on our Production system.

We are trying to replicate this in our TEST environment to determine how it occurred

Thanks
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Hi,

Please use below query on your test environment.QuoteId, QuoteNumber are the column names from your table FILTEREDQUOTECLOSE. If they are incorrect replace them with the actual ones.

--
SELECT * FROM
(
   SELECT * , COUNT(*) OVER (PARTITION BY QuoteId, QuoteNumber) cnts FROM FILTEREDQUOTECLOSE
)k
WHERE cnts > 1
--

Open in new window


Note- The above query will give the duplicate Quote ID and Quote Number with the other columns. If you want only duplicate QuoteId then remove column QuoteNumber from the PartitionBy Clause.

Hope it helps!
Avatar of apollo7

ASKER

This looks promising, I will try it out and get back today

Thanks
Avatar of apollo7

ASKER

Thanks for the query, can you provide a way to update Quoteid and Quotenumber in FilteredQuoteClose to the same value?
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial