$block $idEntry $nameEntry #$callForm $searchTrigger $dataSource $nameField $idField {$uniqed++} print "trigger de busqueda de nombres" $block.firstRecord() for index in range($block.getRecordCount()): if str($block.$idEntry) != "": '_TypeResultBlock_'.$uniqed.processRollback() '_TypeResultBlock_'.$uniqed.initQuery() '_TypeResultBlock_'.$uniqed.idEntry= str($block.$idEntry) '_TypeResultBlock_'.$uniqed.processQuery() $block.$nameEntry= str('_TypeResultBlock_'.$uniqed.nameEntry) $block.nextRecord() try: # gnue version lt 0.4 from gnue.forms.GFEvent import GFEvent except ImportError: # gnue version gt 0.5 from gnue.common.events.Event import Event as GFEvent # busy clock form._object.dispatchEvent(GFEvent('beginWAIT')) setStatusText('buscando...') def setAddressType (recNo): if recNo>=0: '_TypeResultBlock_'.$uniqed.jumpRecord (recNo) $block.$idEntry= str('_TypeResultBlock_'.$uniqed.idEntry) $block.$nameEntry= str('_TypeResultBlock_'.$uniqed.nameEntry) # look for the name... '_TypeResultBlock_'.$uniqed.processRollback () '_TypeResultBlock_'.$uniqed.initQuery () '_TypeResultBlock_'.$uniqed.nameEntry= str($block.addressTypeNameEntry)+'%' '_TypeResultBlock_'.$uniqed.processQuery () # are there too much results? resultCount= '_TypeResultBlock_'.$uniqed.getRecordCount () if resultCount>1: # do the select-man runForm ('nameSelect.gfd', { 'data':'_TypeResultBlock_'.$uniqed, 'callback': setAddressType }) elif resultCount==1: setAddressType (0) setStatusText('Aceptar') form._object.dispatchEvent(GFEvent('endWAIT'))