Notify user to complete Quote line Items

By | June 29, 2020

Quotes are the important aspect in any business, hence forth Sage CRM provides functionalities to handle them effectively and efficiently as well. One of those many feature is converting or promoting quote to order.

New Stuff: Display Selection field value as an Icon using Client Side API

In Sage CRM there is a button on quote summary screen “Convert” which allows user to promote quotes to orders.

Convert Quote
Convert Quote

If there are no quote line items selected for particular quote and we hit this button, it still converts quote in order. But in business scenario it doesn’t make any sense to create an order without any line item. Hence, in our blog we will see how to add validations on this button to not allow converting quote without an Line item.

We can achieve this using client side scripting and Ajax request/Server side scripting. Follow below step:

Change Convert button URL:

  • Navigate  through below path:
  1. Administration->Customization->Quotes->Screen->QuotesSummary
  2. Add below code on custom content of this screen:
<script>
crm.ready(function()
{
$("#Button_Promote").attr("href","javascript:ValidationOnConvert();");
});
</script>
QuoteSummary Screen
QuoteSummary Screen

Server Side Scripting:

Ajax request are sometime complicated to handle, here we have used Create Script to check if any line item exists for a particular quote. This code is written on quote Status field and values are stored into hidden field so that we can use them in client side coding. To add create script follow below steps:

  1. Navigate through below path:
    Administration->Customization->Quotes->Screen->QuotesSummary
  2. Add below code on custom content of this screen:
QuoteID = new String(Values("Key86"));
if(QuoteID == ""||QuoteID=="undefined"||QuoteID=="null")
{
	QuoteID = new String(Values("Quot_OrderQuoteId"));
	if(QuoteID == ""||QuoteID=="undefined"||QuoteID=="null")QuoteID="";
}

if(QuoteID != "")
{
    var QuoteLineSQL = "select * from QuoteItems where QuIt_Deleted is null and quit_orderquoteid = "+QuoteID;
	var QuoteLineRec=eWare.CreateQueryObj(QuoteLineSQL);
	QuoteLineRec.SelectSQL();

	var QouteLineItem = "";
    if(!QuoteLineRec.eof)
	{
		QouteLineItem = "Y";
	}
	
}
Caption ="Status:"+'<input type="hidden" name="hdnHTML" id="hdnHTML" value="' +QouteLineItem+ '"/>';
Script on Status
Script on Status

Client Side Script:
Now, Lets look at Client side script to be added to Custom Folder. Just add the below function

function ValidationOnConvert()
{
	var QuoteLineItems=$("#hdnHTML").val();
	if(QuoteLineItems == ""||QuoteLineItems=="null"||QuoteLineItems=="undefined")QuoteLineItems="";
	
	if(QuoteLineItems=="")
	{
		alert("Quote Line items are not added for this Quote");
	}
		
}

This will now prompt user an alert message whenever user tries to convert any quote to order without adding any line items to it.

Alert
Alert

Hope this helps!

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.

Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3Sage IntacctSage 100Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like  Greytrix Business ManagerSage CRM Project ManagerSage CRM Resource PlannerSage CRM Contract ManagerSage CRM Event ManagerSage CRM Budget PlannerGmail IntegrationSage CRM Mobile Service SignatureSage CRM CTI Framework.

Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.

For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.