Skip to Content
Jun 27, 2020 at 07:56 AM

ByD KUT field query parameter but no retriction


Hello all,

We implemented in CustomerQuote BO a KUT field for "Original_Quote" for migration from legacy to keep old customer "contract" number. This field has been made available for search (in quote object generic search - enterprise search)

In CustomerContract BO (service contract), the field is also available, but contract are loaded without reference to quote : a second specific field is availlable to put the quote refeence, which is the Bydesign quote number.

To overcome the situation, we tried to implement a small ABSL script in customerContrat extension to search from the filled OriginalQuote field the internal CustomerQuote ID.

CustomerQuote is declared as "Reference to Customer-Specific Fields". we can declare a variable for CustomerQuote, and initiate a query on it. Field Original_Quote is available to be added as a query restriction.

We even have it twice (I suspect an other extension referencing same field (OriginalQuote_2FKX8V4V3X861I2KI0F4H6SII and OriginalQuote_2W9H20UMMUKXCCV9SP3YRM4PO) but same result on both fields :

the query with the restriction returns all records from the DB!

Do you know why the query is not considering it or if something else is required ?

Here is an extract of the coding in event after-modify on contract root object extension.

var lquote : CustomerQuote;
var lquery = lquote.QueryByElements;
var lqueryParams = lquery.CreateSelectionParams();

if (this.QuoteReference == "")
	if (this.OriginalQuote != "")
		lqueryParams.Add(lquery.OriginalQuote_2FKX8V4V3X861I2KI0F4H6SII, "I", "EQ", this.OriginalQuote);
		var lqueryResults = lquery.Execute(lqueryParams);
		if (lqueryResults.Count() > 0)
			this.QuoteReference = lqueryResults.GetLast().ID.content.TrimLeft("0");