Problem with INNER JOIN un a GRID (Spanish)

Buenas noches,

He estado trabajando en una aplicacion algo grande y mi cliente me pide que ordene mi grid en orden alfabetico por clientes, los nombres de los cliente estan en una segunda tabla llamada clientes, por lo que si ordeno mi grid por id_cliente se ordenaria por el numerito identificador de mi cliente de la segunda tabla, ya se imaginaran a que me refiero.

Mi tabla anterior era …

SELECT
id,
id_cliente,
fecha,
id_materia,
id_tipo,
folio,
id_responsable,
problematica_ases,
reuniones_ases,
atencion_ases,
conclusion_ases,
fecha_ases,
resumen_ases,
problematica_tram,
fecha_inicio_tram,
activacion_tram,
conclusion_tram,
fecha_tram,
actor_cont,
demandado_cont,
exp_cont,
postura_cont,
tribunal_cont,
accion_cont,
via_cont,
sp_cont,
fk_id_actuacion_cont,
fk_id_procedimiento_cont,
conclusion_cont
FROM
asuntos
WHERE
id_tipo = 2 and estatus = 1
ORDER by
id_cliente, id_cons_cli

La cual modifique por el siguiente que me soluciona el problema …

SELECT
asuntos.id,
asuntos.id_cliente,
asuntos.id_cons_cli,
asuntos.fecha,
asuntos.id_materia,
asuntos.id_tipo,
asuntos.folio,
asuntos.id_responsable,
asuntos.id_responsable2,
asuntos.problematica_ases,
asuntos.reuniones_ases,
asuntos.atencion_ases,
asuntos.conclusion_ases,
asuntos.fecha_ases,
asuntos.resumen_ases,
asuntos.problematica_tram,
asuntos.fecha_inicio_tram,
asuntos.activacion_tram,
asuntos.conclusion_tram,
asuntos.fecha_tram,
asuntos.fecha_fin_cont,
asuntos.actor_cont,
asuntos.demandado_cont,
asuntos.exp_cont,
asuntos.postura_cont,
asuntos.tribunales_cont,
asuntos.accion_cont,
asuntos.via_cont,
asuntos.sp_cont,
asuntos.fk_id_actuacion_cont,
asuntos.fk_id_procedimiento_cont,
asuntos.conclusion_cont,
clientes.id,
clientes.nombre_com
FROM
asuntos INNER JOIN clientes ON asuntos.id_cliente = clientes.id
WHERE
(asuntos.id_tipo = ‘2’) AND
(asuntos.estatus = ‘1’)
ORDER BY
clientes.nombre_com

En el DB Builder funciona a la perfeccion, pero cuando lo copie y lo pegue en GRID de SQL de la app me aparece el siguiente problema que no he podido quitar.

Par?metro para aplicaci?n de enlace inexistente(id).

Este mensaje no me deja trabajar, y peor aun, si quiero regresar a mi consulta anterior tampoco me deja, me aparece el mismo error, no se si a alguno de ustedes ya le paso y me pueda decir como corregirlo, yo he intentado muchas cosas pero no logro corregirlo, agradeceria mucho su ayuda.

Gracias,

Eduardo Cazares

Re: Problem with INNER JOIN un a GRID (Spanish)

Your SQL seems fine at first glance. I suspect SC is having problems parsing the code. Try creating a VIEW and then just reference the view in your grid SQL.

Regards,
Scott.

Re: Problem with INNER JOIN un a GRID (Spanish)

Hola.
Al parecer el error no es del Select, ya que el mensaje de error es “Par?metro para aplicaci?n de enlace inexistente(id).”. ?Tu viajas desde ese Grid a otra ventana (aplicaci?n)? si es asi entonces puede que hayas creado un enlace para eso y cuando lo creaste la relaci?n se hizo al campo ID solamente, como ahora tienes una nueva tabla y ya usas Alias en el Select, entonces es posible que se haya perdido la conexi?n del enlace.

Saludos
JG

Re: Problem with INNER JOIN un a GRID (Spanish)

En efecto, esa Grid tiene elementos GROUPBY los cuales permiten abrir un FORM (formulario) para la edici?n del elemento.

Pero alguien me podria decir como regresarlo a la normalidad?

Saludos, Gracias.

Eduardo Cazares.

Re: Problem with INNER JOIN un a GRID (Spanish)

Hi Scott, please tell me how to make the view, and how can I reference the view with my grid?

Thanks ind advance,

Eduardo Cazares

Re: Problem with INNER JOIN un a GRID (Spanish)

Using your DB manager:


-- myview is the name of your view, call it what you want.
DROP VIEW IF EXISTS myview;
CREATE VIEW myview AS 
-- below is your SQL statement
SELECT .....
FROM ...
JOIN ...

To use the view, simply reference ‘myview’ in your SQL in the grid, or where you want it.

Regards,
Scott

Re: Problem with INNER JOIN un a GRID (Spanish)

Sorry Scott,

Is not working, the problem is if I change the old SELECT script, doesn?t work too. Then the grid is corrupted? Then I need to repeat all the grid?

Can I download the grid files of the server and replace the development files to fix the problem?

Regards,

Eduardo Cazares.

Re: Problem with INNER JOIN un a GRID (Spanish)

When you change your grid SQL, you will lose your grid settings at times. I consider this a bug of SC.
Since you are referencing a new table, SC most likely dump your old setup.

Can I download the grid files of the server and replace the development files to fix the problem?

I do not believe this is possible as SC stores the info in the DB for regenerate and the files you download are the generated files.

Do you not have a backup of your project? SC is infamous for dumping grid field definitions. I would get in the habit of performing incremental backups.

Regards,
Scott.