You need to sign in to do that
Don't have an account?
Octavio Garcia
Propiedad de Standarcontroller desconocida
Hola a todos.
Estoy realizando un PDF con Visualforce pero me marca el siguiente error: Propiedad 'Presupuesto_Lead__cStandardController.Resource' desconocida. ya hice varias modificaciones, incluso revise los que cree con anterioridad y no se que es lo que esta pasando.
Comparto el controlador como el VF.
Controller:
public without sharing class Presupuesto_lead {
public DATE Fecha_de_expiracion {get; set;}
public Presupuesto_lead(ApexPages.StandardController controller) {
Presupuesto_Lead__c[] plead = [Select Name, Cantidad1__c, Cantidad2__c, Cantidad3__c, Cantidad4__c,
Porcentaje_de_Descuento1__c, Porcentaje_de_Descuento2__c, Porcentaje_de_Descuento3__c, Porcentaje_de_Descuento4__c
From Presupuesto_Lead__c
Where Id=:controller.getId()];
Product2[] p = [Select Name
From Product2
Where Id=:controller.getId()];
Familia_de_productos__c[] fp = [Select Name
From Familia_de_productos__c
Where Id=: controller.getId()];
Lead [] lead = [Select Name, lead.Company
From Lead
Where Id=: controller.getId()];
}
}
Página VF:
<apex:page standardController="Presupuesto_Lead__c" extensions="Presupuesto_lead" renderAs="pdf">
<head>
<style>
h2 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h3 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h4 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h5 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h6 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h7 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h8 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h9 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h10 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
td { color: #2e2e65 ; font-size : 15xp ; font-family : Arial; }
* {
box-sizing: border-box;
}
.heading {
font-weight: bold;
}
.heading--main {
font-size: 36px;
}
.heading--sub {
font-size: 21px;
}
.box--full {
float: center;
width: 100%;
}
table {
border: 1;
margin-top: 25px;
width: 100%;
}
th {
background-color: #19d3c5;
font-align: left;
font-size: 14px;
font-weight: bold;
padding: 5px;
}
</style>
<img src="{!Resource.Logonuevo}" width="200" height="150"> </img> <br/><br/>
<br/>
<br/>
</head>
<body>
<center>
<h1>Presupuesto para Lead</h1>
</center>
<table border="1" bordercolor="red"> <br/>
<div align="right">
<h6> Fecha de Vencimiento: {!Day(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}-{!Month(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}-{!Year(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}
</h6>
</div>
<div align="left">
<h2> Nombre de Presupuesto: {!Presupuesto_Lead__c.Name}
</h2>
</div>
<div align="left">
<h4> Prospecto: {!Presupuesto_Lead__c.Prospecto__r.Name}
</h4>
</div>
<div align="left">
<h5> Compañia: {!Presupuesto_Lead__c.Compa_a__r.Name}
</h5>
</div>
</table>
<center>
<h1> Detalles </h1><br/>
</center>
<center>
<table border="2">
<tr>
<th> Producto </th>
<th> Cantidad (TON) </th>
<th> Subtotal de producto (USD) </th>
<th> Total del producto (USD) </th>
</tr>
<apex:repeat value="{!Presupuestaci_n__c}" var="Presupuestaciones">
<tr>
<td>{!Presupuesto_Lead__c.Producto1__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad1__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal1__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total1__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto2__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad2__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal2__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total2__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto3__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad3__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal3__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total3__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto4__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad4__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal4__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total4__c}</i>
</input>
</div></td>
</tr>
<table border="4" bordercolor="blue"><br/>
<div align="right">
<h7> Creado por: {!PPresupuesto_Lead__c.CreatedBy.Name} </h7>
</div>
<div align="right">
<h8> Email de vendedor: {!Presupuesto_Lead__c.CreatedBy.Email} </h8>
</div>
<div align = "right">
<h9> Teléfono de propietario: {!Presupuesto_Lead__c.CreatedBy.Mobile} </h9>
</div>
<div align = "right">
<h10> Cargo: {!Presupuesto_Lead__c.CreatedBy.Title} </h10>
</div>
</table>
</apex:repeat>
</table>
</center>
</body>
</apex:page>
Agradeceria mucho su apoyo
Estoy realizando un PDF con Visualforce pero me marca el siguiente error: Propiedad 'Presupuesto_Lead__cStandardController.Resource' desconocida. ya hice varias modificaciones, incluso revise los que cree con anterioridad y no se que es lo que esta pasando.
Comparto el controlador como el VF.
Controller:
public without sharing class Presupuesto_lead {
public DATE Fecha_de_expiracion {get; set;}
public Presupuesto_lead(ApexPages.StandardController controller) {
Presupuesto_Lead__c[] plead = [Select Name, Cantidad1__c, Cantidad2__c, Cantidad3__c, Cantidad4__c,
Porcentaje_de_Descuento1__c, Porcentaje_de_Descuento2__c, Porcentaje_de_Descuento3__c, Porcentaje_de_Descuento4__c
From Presupuesto_Lead__c
Where Id=:controller.getId()];
Product2[] p = [Select Name
From Product2
Where Id=:controller.getId()];
Familia_de_productos__c[] fp = [Select Name
From Familia_de_productos__c
Where Id=: controller.getId()];
Lead [] lead = [Select Name, lead.Company
From Lead
Where Id=: controller.getId()];
}
}
Página VF:
<apex:page standardController="Presupuesto_Lead__c" extensions="Presupuesto_lead" renderAs="pdf">
<head>
<style>
h2 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h3 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h4 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h5 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h6 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h7 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h8 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h9 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
h10 { color: #2e2e65 ; font-size : 15px ; font-family : Arial; }
td { color: #2e2e65 ; font-size : 15xp ; font-family : Arial; }
* {
box-sizing: border-box;
}
.heading {
font-weight: bold;
}
.heading--main {
font-size: 36px;
}
.heading--sub {
font-size: 21px;
}
.box--full {
float: center;
width: 100%;
}
table {
border: 1;
margin-top: 25px;
width: 100%;
}
th {
background-color: #19d3c5;
font-align: left;
font-size: 14px;
font-weight: bold;
padding: 5px;
}
</style>
<img src="{!Resource.Logonuevo}" width="200" height="150"> </img> <br/><br/>
<br/>
<br/>
</head>
<body>
<center>
<h1>Presupuesto para Lead</h1>
</center>
<table border="1" bordercolor="red"> <br/>
<div align="right">
<h6> Fecha de Vencimiento: {!Day(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}-{!Month(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}-{!Year(Presupuesto_Lead__c.Fecha_de_Expiraci_n__c)}
</h6>
</div>
<div align="left">
<h2> Nombre de Presupuesto: {!Presupuesto_Lead__c.Name}
</h2>
</div>
<div align="left">
<h4> Prospecto: {!Presupuesto_Lead__c.Prospecto__r.Name}
</h4>
</div>
<div align="left">
<h5> Compañia: {!Presupuesto_Lead__c.Compa_a__r.Name}
</h5>
</div>
</table>
<center>
<h1> Detalles </h1><br/>
</center>
<center>
<table border="2">
<tr>
<th> Producto </th>
<th> Cantidad (TON) </th>
<th> Subtotal de producto (USD) </th>
<th> Total del producto (USD) </th>
</tr>
<apex:repeat value="{!Presupuestaci_n__c}" var="Presupuestaciones">
<tr>
<td>{!Presupuesto_Lead__c.Producto1__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad1__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal1__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total1__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto2__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad2__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal2__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total2__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto3__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad3__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal3__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total3__c}</i>
</input>
</div></td>
</tr>
<tr>
<td>{!Presupuesto_Lead__c.Producto4__r.Name}</td>
<td>{!Presupuesto_Lead__c.Cantidad4__c}</td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.SubTotal4__c}</i>
</input>
</div></td>
<td> <div class="input-icon">
<input type="text">
<i>$ {!Presupuesto_Lead__c.Precio_Total4__c}</i>
</input>
</div></td>
</tr>
<table border="4" bordercolor="blue"><br/>
<div align="right">
<h7> Creado por: {!PPresupuesto_Lead__c.CreatedBy.Name} </h7>
</div>
<div align="right">
<h8> Email de vendedor: {!Presupuesto_Lead__c.CreatedBy.Email} </h8>
</div>
<div align = "right">
<h9> Teléfono de propietario: {!Presupuesto_Lead__c.CreatedBy.Mobile} </h9>
</div>
<div align = "right">
<h10> Cargo: {!Presupuesto_Lead__c.CreatedBy.Title} </h10>
</div>
</table>
</apex:repeat>
</table>
</center>
</body>
</apex:page>
Agradeceria mucho su apoyo
Le controller conoce a solo uno id--el id del Presupuesto_Lead__c. No conoce a otros ids en otros sObjects. Usted necessita algo como esto:
si hay "fields" con los nombres Producto1__c, Producto2__c, Producto3__c y Producto4__c en el sObject "Presupuesto_Lead__c".
Si en cambio necessita otros "fields" de Product2, es mejor usar algo como esto:
No hay usualmente "fields" con nombres Producto1__c, Producto2__c, etc. Normalmente hay un sObject llamado Product2, un otro llamado Presupuesto_Lead__c, y un tercero llamado algo como Presupuesto_Lead_Product__c. El tercero hay "Lookup Fields" para Product2 y Presupuesto_Lead__c. Pero si verdad que Presupuesto_Lead__c tiene cuatro "fields" para Product2, espero que este ayude. Discupleme una vez más. Mi español no es bueno. Espero que usted puede entenderme.