Que tal compañeros,

Tengo inconveniente en los puestos cuando consulto las relaciones internas y externas del puesto cuando no tiene lleno el campo de Unidad e institución respectivamente.

Me lanza el siguiente inconveniente cuando uso la vista Details:

System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ASP.areas_estructura_views_relacioninterna_listadodetails_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:inetpubwwwrootEvolutionBIAreasEstructuraViewsRelacionInternaListadoDetails.ascx:line 49 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext) at StackExchange.Profiling.Mvc.WrappedView.Render(ViewContext viewContext, TextWriter writer) in d:FilesGitHubminiprofilerdotnetStackExchange.Profiling.MvcWrappedView.cs:line 56 at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)

asked 07 Aug '19, 10:30

Josue%20Mancilla's gravatar image

Josue Mancilla
(suspended)
accept rate: 42%

edited 07 Aug '19, 16:08


Una workaround para el error es modificar los siguientes archivos:

\Evolution\Areas\Estructura\Views\RelacionInterna\ListadoDetails.ascx en la línea 49 y \Evolution\Areas\Estructura\Views\RelacionInterna\Index.ascx en la línea 97 y reemplazar el texto:

<%= Html.Encode(item.Unidad.Descripcion) %>

Por el siguiente:

<%= Html.Encode(item.Unidad != null ? item.Unidad.Descripcion : "-----") %>

\Evolution\Areas\Estructura\Views\RelacionExterna\Index.ascx en la línea 51 y \Evolution\Areas\Estructura\Views\RelacionExterna\ListadoDetails.ascx en la linea 33 y reemplazar el texto:

<%= Html.Encode(item.Institucion.Is() ? item.Institucion.Length > 20 ? item.Institucion.Substring(0, 20)+"..." : item.Institucion: string.Empty) %>

Por el siguiente:

<%= Html.Encode(item.Institucion != null ? item.Institucion.Length > 20 ? item.Institucion.Substring(0, 20)+"..." : item.Institucion : "-----") %>

No es necesario crear custom view ya que cuando se aplique el hotfix, sobrescribirá el cambio con una modificación correcta, pero si existe uno, realizar el cambio en dicho custom view

link

answered 08 Aug '19, 10:00

glemus's gravatar image

glemus
(suspended)
accept rate: 51%

edited 08 Aug '19, 12:16

sbarahona's gravatar image

sbarahona ♦♦
(suspended)

A pesar que las unidades y las relaciones no son obligatorias, no tiene mucho sentido crear una relación interna sin definir la unidad (o una relación externa sin definir la institución) Sin embargo se ha creado un issue EVO-4203 para que la solución se incluya en el próximo hotfix.

Como medida correctiva se puede crear un SP antes de guardar para las entidades "RelacionesInternas" y RelacionesExternas" (validad la sección de información avanzada en la entidad)

create PROCEDURE eor.ejecuta_antes_guardar_ri
    @codigo varchar(20),
    @entitysetname varchar(100),
    @accion varchar(10),
    @mensaje_validacion varchar(4000) output
AS
    declare @coduni int

    select @coduni = rin_coduni
    from eor.rin_relaciones_internas
    where rin_codigo = cast(@codigo as int)

        if @coduni IS NULL
            SET @mensaje_validacion = 'Favor definir una unidad'

RETURN 0

alt text

link

answered 08 Aug '19, 09:11

sbarahona's gravatar image

sbarahona ♦♦
(suspended)
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Evolution en BitBucket

En este sitio puede acceder al código fuente, centro de descargas y reportar bugs, propuestas y mejoras para Evolution.

Evolution en JIRA

En este sitio puedes sugerir nueva funcionalidad para Evolution, o puedes votar por la funcionalidad ya propuesta por otros usuarios.

Tags:

×5
×4

Asked: 07 Aug '19, 10:30

Seen: 403 times

Last updated: 08 Aug '19, 12:16

[Acerca de] [Preguntas Frecuentes] [Privacidad] [Soporte] [Contacto]
Copyright 2013-2018. Asesores en Informática