Announcements
Hello,
I hope someone will help me with my quest.
I created a plugin for quotes in CRM to retrieve the parent guide when the quote is revised. when I retrieve the parent execution context, I get the new quote id that was created.
I registered this plugin on the pre-operation create of the quote table.
In the screenshot below I used context.ParentContext to get the parent of the record created, but the parent guide is returning the new GUID created and not the parent one.
I tried to use the context.ParentContext.ParentContext (grandparent method) but the GUID is returning all 0s.
Can someone assist me to get the GUID of the revised quote?
Thank you in advance!
Right.
Hello Pradeep Rai ,
\In the case you shared, you are assuming that the last product is always being revised. In that way, it will work, but I mean if the revised quote is not the last one. Getting quote no. and decrementing the revision by one is not the solution, in this case, that's why I want to get the GUID of the revised quote.
Thank you
Hi,
let's consider below example.
Suppose, You are Revising the Quote B
Then logic will on Create of Quote
1. Get Quote Number of Quote
2. Get Quote Revision Number
3. Now substract the Revision with 1
4. Now you can search for Quote Record where Quote Number eq "<value found in step 1>" and Revision Number eq "Value found in step 3".
This you will have previous record.
Other way is you can retrieve latest record from "Quote Close" entity based created on.
Hello Naveen Ganeshe ,
I want to get the revised quote not closed.
For example, I have 4 closed quotes (1,2,3,4) but I want to revise the 2nd quote and get its child records to the new quote.
The problem is I'm not able to get the GUID from the Parent context and I cannot filter on last number revised neither on last modified.
The best practice is to catch the GUID of the parent record, but this approach is not working.
Thank you
I agreed with Naveen.
Hi,
Looks like you have quote no. in the plugin for the previous quote. You can search the quote by quote no. where the status is closed. This way you can get the quoteId.
Hello Pradeep Rai ,
Thank you for the fast reply. I tried to use context.ParentContext.ParentContext.InputParameters.InputParameters("QuoteId") but it is throwing a syntax error in visual studio
Hi,
I would suggest you can retrieve the quote record using the QUOTEID and Status as Closed.
because when we revise the quote then New Quote Created and Old Quote Status Changes to Revised.
Also, try below code:
context.ParentContext.ParentContext.InputParameters.InputParameters("QuoteId")
Found in below discussion:
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156