Skip to main content
Solved

block typing in lookup field


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+5
  • Sidekick (Employee)
  • 23 replies

On mobile, is it possible to stop typing in the lookup field and perhaps stop typing in a field for reading the qrcode? If it is possible via script, can you give an example?

Best answer by IniNimesK

@WilsonX, As mentioned in above comments, it is not possible to validate the user inputs inside the lookup screen.

 

But you can restrict the inputs which are being entered directly to the actual field using a script like below.

As QR/Barcode scanner in latest FSM update returns the scanned text all at once you can differentiate the user input by checking the text size in ValueChanged action on the field (given that there are no barcodes which return only one character).

 

var curVal = getControlValue("c_acme_shipping","place_id");

//Get Current Length
var curInputLength = curVal.length;

if(curInputLength == 1) {
	//Replace the current field value with a empty value
	setControlValue("c_acme_shipping","place_id", null);
	alert("Not Editable from User Input");
}

 

As a workaround (if the requirement is critical to the business) you can build a custom search screen using scripting/list screen and utilizing the cache functions in the client scripts. And trigger it once the user scanned the barcode to a field (or via a button). 

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

4 replies

shalikakk
Hero (Employee)
Forum|alt.badge.img+7
  • Hero (Employee)
  • 33 replies
  • June 13, 2024

Hi @WilsonX 

You can’t use only qr scanner as a input of text field.

This requirements can do from customisation.

 

Thanks


Chethana
Sidekick (Employee)
Forum|alt.badge.img+5
  • Sidekick (Employee)
  • 55 replies
  • June 13, 2024

Hi @WilsonX ,

Your requirement cannot be done using configurations. There are no specific fields dedicated to QR scanning or barcode scanning. This feature is available for all input fields in FSM Mobile. You can enable or disable this feature using the ENABLE_BARCODE_SCANNING app param.


Forum|alt.badge.img+6
  • Do Gooder (Partner)
  • 36 replies
  • Answer
  • June 20, 2024

@WilsonX, As mentioned in above comments, it is not possible to validate the user inputs inside the lookup screen.

 

But you can restrict the inputs which are being entered directly to the actual field using a script like below.

As QR/Barcode scanner in latest FSM update returns the scanned text all at once you can differentiate the user input by checking the text size in ValueChanged action on the field (given that there are no barcodes which return only one character).

 

var curVal = getControlValue("c_acme_shipping","place_id");

//Get Current Length
var curInputLength = curVal.length;

if(curInputLength == 1) {
	//Replace the current field value with a empty value
	setControlValue("c_acme_shipping","place_id", null);
	alert("Not Editable from User Input");
}

 

As a workaround (if the requirement is critical to the business) you can build a custom search screen using scripting/list screen and utilizing the cache functions in the client scripts. And trigger it once the user scanned the barcode to a field (or via a button). 


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+5
  • Author
  • Sidekick (Employee)
  • 23 replies
  • June 20, 2024


Thank you all. I had already created something along the lines that @IniNimesK  suggested. adding the script in changed value in all the fields that I deemed necessary

var screenName = getCurrentScreenName();

var tabela = "";
var campo = "";
var getValida ="";

////Retorna campo de qrcode na tela de overview
if (screenName == "DebriefOverview"){	tabela = "task";	campo = "user_def21";}

////Retorna campo de qrcode na tela de overview
if (screenName == "c_DebriefPartUsage"){	tabela = "part_usage";	campo = "user_def10";}

////Retorna campo de modelo de encerramento na tela cadastro de novo produto
if (screenName == "Cadastro Novo Produto"){	tabela = "product";	campo = "model_id";}

//Retorna campo de peça de encerramento na tela de peças usadas
if (screenName == "DebriefPartNeeds"){	tabela = "part_need";	campo = "part_id";}

//Retorna campo de classificação de encerramento na tela de revisão do cliente
if (screenName == "DebriefCustomerReview"){	tabela = "task";	campo = "user_def22";}

//Pegar digitação atual do campo	
 getValida = getControlValue(tabela, campo);

 //Apagar caracter campo

    if (getValida.length == 1) {
        setControlValue(tabela, campo,"");
        if (screenName == "DebriefOverview"){ 
        	alert("Pressione o campo e selecione a opção de digitalização de cód. de Barras");
        } 
        	else {
				alert("Toque na lupa ao lado para realizar a pesquisa");
        	}
    }
    if (getValida.length == 1) {
        setControlValue(tabela, campo,"");
        alert("Toque na lupa ao lado para realizar a pesquisa");
    }

 


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