web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Restrict opportunity have only single quote record

(0) ShareShare
ReportReport
Posted on by

Hi there,

                   I have situation -when I am going to close quote corresponding opportunity must be close.this causes problem when I have multiple quote records for an opportunity.

so I try to solve this  using  following way-

when user create quote for opportunity .restrict user if there is already quote for that opportunity.but I dont have idea how to achieve this.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    Hi Tarun,

    You can implement this using plugin, you can write plugin on quote create where you can get OpportunityId from the quote and check if there is existing quote records then throw error message.

  • Suggested answer
    Surmeet Singh Profile Picture
    3,075 on at

    Hi Tarun,

    You can register plugin on PreOnCreate of Quote to restrict to single quote per opportunity. There is a opportunity lookup on Quote, query to find the quotes having the same value for opportunity ID. If Count >0 then throw exception.

  • Community Member Profile Picture
    on at

    Hi,

       I created PreOperation Plugin on Quote entity.

    now when I click on (+) sign of quote subgrid of opportunity form ,no quote form opening,and no business error shown.

    there is error on bottom of form

    'ISV code aborted the operation'

    there is no error log file generated that's why I cant debug the plugin using profiler.

  • Royal King Profile Picture
    27,686 on at

    Rather than restricting creation of quote you could close all the quote when you user  closes the opportunity using real time workflow

  • Suggested answer
    Surmeet Singh Profile Picture
    3,075 on at

    that sounds strange... try moving it post update although it should work on pre-create but lets check .

  • Suggested answer
    MilindP Profile Picture
    1,019 on at

    You can customize the "New" buttons on Form, Grid and Home page  and write custom JavaScript function to check the count of quote associated with parent opportunity, if its greater than 1, give an message to user other wise run the native function to create a quote

    e.g.

    i.e. from Home New button: run a function Mscrm.RibbonActions.openNewRecord("quote", SelectedControl)

    from Form New: Mscrm.RibbonActions.openNewRecord("quote")

    Associated view AddNew or "+" button

    Mscrm.GridRibbonActions.addNewFromSubGridStandard(SelectedEntityTypeCode, PrimaryEntityTypeCode, FirstPrimaryItemId, PrimaryContrl, SelectedControl)

    Note: When you are attaching your custom JavaScript function, pass the required parameter (i.e. SelectedEntityTypeCode, PrimaryEntityTypeCode, FirstPrimaryItemId, PrimaryContrl, SelectedControl) to the function which can be passed to native function after your validation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans