Skip to main content
Solved

Change default value for Create Quote dropdown in Opportunities screen

  • December 9, 2024
  • 5 replies
  • 68 views

Forum|alt.badge.img

Hi,

In the Opportunities Screen, after the Create Quote button is clicked, the pop-up below appears with the option to create a Sales Quote displaying by default. The client would prefer for this to show Project Quote by default since the majority of their quotes are project ones, and some of their staff have mistakenly created Sales Quotes instead of Project Quotes as they forgot to change the dropdown value in the image below.

Is it possible to change the default value that appears in this pop-up screen? Or should they just double-check this value before proceeding with the quote creation?

Kind regards,

Andrew

 

Best answer by Nilkanth Dipak

Hi ​@AndrewA,

You can change the default option of Project Quote instead of an Sales Quote by using Low-Code - No Code Customization.
 

Hope this help!

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+1
  • Jr Varsity I
  • 62 replies
  • December 9, 2024

Hi ​@AndrewA ,
Modify you DAC field on screen level .
 

Key changes made:

  1. Replaced PXUnboundDefault with PXDefault which has stronger precedence
  2. Added PersistingCheck = PXPersistingCheck.Nothing to ensure no validation errors
     

namespace PX.Objects.CR
{
  public class OpportunityMaint_Extension : PXGraphExtension<PX.Objects.CR.OpportunityMaint>
  {
    #region Event Handlers
    
    
    [PXString(1, IsFixed = true)]
                [PXUIField(DisplayName = "Quote Type")]
                [CRQuoteType()]
              [PXDefault(CRQuoteTypeAttribute.Project, PersistingCheck = PXPersistingCheck.Nothing)]
    protected virtual void CreateQuotesFilter_QuoteType_CacheAttached(PXCache cache)
    {
    
    }
    Option 2:
If this still doesn't work, we could try an alternative approach using the RowSelected event:

   namespace PX.Objects.CR
{
    public class OpportunityMaint_Extension : PXGraphExtension<PX.Objects.CR.OpportunityMaint>
    {
        protected virtual void CreateQuotesFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row is CreateQuotesFilter row && string.IsNullOrEmpty(row.QuoteType))
            {
                row.QuoteType = CRQuoteTypeAttribute.Project;
                cache.IsDirty = false;
            }
        }
    }
}
Hope it will work.


Nilkanth Dipak
Varsity II
Forum|alt.badge.img+10
  • Varsity II
  • 392 replies
  • Answer
  • December 9, 2024

Hi ​@AndrewA,

You can change the default option of Project Quote instead of an Sales Quote by using Low-Code - No Code Customization.
 

Hope this help!


Forum|alt.badge.img

Hi ​

@AndrewA ,

You can try this in Graph

 

protected void _(Events.RowSelected<CreateQuotesFilter> e)

{

    CreateQuotesFilter quote = e.Row as CreateQuotesFilter;

    if (quote == null) return;

    quote.QuoteType = CRQuoteTypeAttribute.Project;

}
 

Hope this code is helps for you 🤔


darylbowman
Captain II
Forum|alt.badge.img+13

Yes, this is possible and would be easy for a developer.

Here’s how I would do it:

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXCustomizeBaseAttribute(typeof(PXUnboundDefaultAttribute), null, CRQuoteTypeAttribute.Project)]
protected virtual void _(Events.CacheAttached<CreateQuotesFilter.quoteType> e) { }

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 81 replies
  • December 9, 2024

Thanks everyone for your responses. I went with ​@Dipak Nilkanth 's answer, which worked perfectly. I haven't used this fields section much, so it was great to see it in action, and will be handy to use for similar issues in the future.

Kind regards,

Andrew


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings