Auto Completion

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

I need to check that the number is correct so when someone is typing in I want to check it. I have it done OnChange but sometimes people just waiting to check without living the text box, so I need to check it before. I have written:

Code
&AtClient
Procedure RUCAutoComplete(Item, Text, ChoiceData, Wait, StandardProcessing)
   Length = StrLen(Text);
   If Object.Identificacion = PredefinedValue("Enum.Identificacion.Cedula") And Length = 10  Then
      VerificarRUC(Text);
   ElsIf Object.Identificacion = PredefinedValue("Enum.Identificacion.RUC") And Length = 13 Then
      VerificarRUC(Text);
   EndIf;        
EndProcedure

The problem is when I try to write more that 10 symbols I am clearing the text before. The system select first 10 letters and pressing any key deletes all. How to make it work? I do not need any string modification, just checking when pass 10 and 13 symbols.
VerificarRUC is just a function which shows a sign if it is correct or no.

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

You can use a field with unlimited length and after validation is passed, copy its value to the object attribute.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.