• ECorona
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 30
    Replies
Hello!

I have this VFP and i would like to add checkboxes for every row and create and opportunity but, i can't figure out how to do it... any ideas?

I'll really appreciate your help!

<apex:page standardController="Account" extensions="OrderSummaryAccount" >
    <apex:form >
        <apex:pageBlock title="Summary of products and services">
            <apex:pageBlockTable value="{!os.accountServicesSummaries}" var="item">
              <apex:column headerValue="Service ID">{!item.ServiceId}</apex:column>
                <apex:column headerValue="Service Name">{!item.serviceName}</apex:column>
                <apex:column headerValue="Quantity">{!item.quantity}</apex:column>
                <apex:column headerValue="Price">  <apex:outputText value="{0,number,$#,###,###.00}"><apex:param value="{!item.price}" /></apex:outputText></apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

And this extension

public with sharing class OrderSummaryAccount {
    public OrderSummary os {get;set;}    
    
    public OrderSummaryAccount(ApexPages.StandardController stdController) {
        Account a = (Account) stdController.getRecord();
        os = OrderSummary.getOrderSummary(a.id);
    }
}

And this class


public class OrderSummary {

    public String accountId {get;set;}
    public List<AccountServicesSummaries> accountServicesSummaries {get;set;}
  public List<AccountNonBillablesSummaries> accountNonBillablesSummaries {get;set;}
  public List<AccountServiceLocationsSummaries> accountServiceLocationsSummaries {get;set;}   
    
    public OrderSummary(){
        accountId = '';
        accountServicesSummaries = new List<AccountServicesSummaries>();
        accountNonBillablesSummaries = new List<AccountNonBillablesSummaries>();
        accountServiceLocationsSummaries = new List<AccountServiceLocationsSummaries>();
    }
    
  public class AccountNonBillablesSummaries {
    public String id {get;set;}
    public String eqpId {get;set;}
    public String eqpName {get;set;}
  }

  public class AccountServicesSummaries {
    public String id {get;set;}
    public String serviceId {get;set;}
    public String serviceName {get;set;}
    public Double quantity {get;set;}
    public Double price {get;set;}
  }

  public class AccountServiceLocationsSummaries {
    public String id {get;set;}
    public String locationName {get;set;}
  }
  
  public static OrderSummary parse(String json) {
    return (OrderSummary) System.JSON.deserialize(json, OrderSummary.class);
  }
    
    public static OrderSummary getOrderSummary(String accountId){
        
        OrderSummary r = new OrderSummary();
        
        Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://provision-gateway.develop.embrix.org/getOrderSummaryByAccountId');
    request.setMethod('POST');
        // Set the body as a JSON object
        request.setHeader('Content-Type', 'application/json;charset=UTF-8');
        request.setBody('{"accountId":"'+accountId+'"}');
    HttpResponse response = http.send(request);
    // If the request is successful, parse the JSON response.
        if (response.getStatusCode() == 200) {
            // Deserialize the JSON string into collections of primitive data types.
            r = parse(response.getBody());
            // Cast the values in the 'animals' key as a list            
    }

        return r;
    }
}
Hello all!

I have a question, i have a field on my opp products for the "Life of the contract" call (Vigencia) it's a number field, what i need is to put that value on opp field called Vigencia_MAX, but i have two conditions for that:
1) Put the Vigencia on Opp from the product with the highest price or if
2) the price are the same, put the Highest Vigencia on pp.

So for that i have this

trigger VigenciaOpp on OpportunityLineItem (after insert, after update, after delete) {

list<id> oppids=new list<id>();
list<opportunity> oppnames=new list<opportunity>();
for(OpportunityLineItem c:trigger.new){
oppids.add(c.opportunityId);
}
system.debug('>>>>'+oppids);
List<opportunity> opps=new List<opportunity>([select id, (select id,Vigencia_N_mero__c,TotalPrice from OpportunityLineItems Where Califica_a_Comision__c=True Order by Vigencia_N_mero__c DESC ,Vigencia_N_mero__c DESC Limit 1 ) from opportunity where Opportunity.Id in:oppids]);
Decimal myDecimal = 0.00;
Integer n=myDecimal.intValue();
for(opportunity o:opps){
for(OpportunityLineItem o1:o.OpportunityLineItems){
Decimal myDecimal2 =o1.Vigencia_N_mero__c;
n=myDecimal2.intValue();
}
o.Vigencia_Comision__c=n;
oppnames.add(o);
}
update oppnames;
}

It work, but no in the way that I need, i'll really appreciate your help!
I'm on the Create a Satisfaction Survey trailhead but i get this error, I'll really appreciate your help!
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FWMEIALZ
  • September 26, 2018
  • Like
  • 0
Hi! I'm looking how i can writte a trigger to do this:

In my accounts, i have a lookup field to object B, this field is not master-detail.
When i schedule a meeting in my account, i want to update a datetime field in object B.

I'll really appreciate your ideas!
 
Hello! Is there a way to show Approvers (for Opportunities Classic or Lightning) in the same order that we defined on the Approval Process???

Thank you so much!!!
Hello, we have two objects A and B, in A we have a lookup field that, when it changes, update a text field in B, at this point we are working ok, but when the lookup field on A change, the record on B is not updated to edit the information on the text field, do you have any idea on how to do this???

I'll really appreciate your help.
Please your help!
we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now
Please help! we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now
Please Help!!!
The last week we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now???

I'll really appreciate your help
Hello i have this trigger and works ok, the problem is that date field (not datetime) returns me the date in yyyy/mm/dd 00:00:00 format and i would like to get the date in DD/MM/YYYY format. This is the Date field Fecha_de_Vencimiento_de_Contrato__c

I will really appreciate your help

 List<Id> conIds = new List<Id>();
   
    if(trigger.isDelete){
        for(Proveedores__c c : Trigger.old){
            conIds.add(c.Cuenta__c);
        }
    }else{
        for(Proveedores__c c : Trigger.new){
        conIds.add(c.Cuenta__c);
        }
    }
    
    List<Account> ProveedoresAccount = [Select id, name, Proveedores_Resumen__c, (Select tipo_de_proveedor__c, Proveedores__c, 
                                        Fecha_de_Vencimiento_de_Contrato__c   from Proveedores__r) from Account where id in : conIds];   
    
    for(Account a: ProveedoresAccount){
        String Proveedores='';
        for(Proveedores__c pro : a.Proveedores__r){
            Proveedores=Proveedores+': '+pro.tipo_de_proveedor__c+': '+pro.Proveedores__c+': '+pro.Fecha_de_Vencimiento_de_Contrato__c +'/' ;       
        }
        a.Proveedores_Resumen__c= Proveedores;
        update(a);
    }
Hello I will really appreciate your help, i have this trigger, the coverage is 100% , but i get an error, System.LimitException: Too many SOQL queries: 101, Line 12 "List<Proveedores__c > media = [select id,name, Tipo_de_Proveedor__c,Fecha_de_Vencimiento_de_Contrato__c ,Proveedores__c, cuenta__c from Proveedores__c where cuenta__c in : conIds];" i don't know what else i can do. Thank you!


trigger ResumenProveedores on Account (before insert, before update) {



List<Id> conIds = new List<Id>();
String Proveedores='';

for(Account c : Trigger.new){
conIds.add(c.Id);
}

  List<Proveedores__c > media = [select id,name, Tipo_de_Proveedor__c,Fecha_de_Vencimiento_de_Contrato__c ,Proveedores__c, cuenta__c from Proveedores__c where cuenta__c in : conIds];

 for(Account c : trigger.new){
//      conIds.add(c.Id);
    
        
        for(Proveedores__c pro: media){
            Proveedores=Proveedores+': '+pro.tipo_de_proveedor__c+': '+pro.Proveedores__c+': '+pro.Fecha_de_Vencimiento_de_Contrato__c +'/' ;
            }
            c.Proveedores_Resumen__c= Proveedores;
     } 
}
Greetings
I have a custom object that is related with Account, i need to select name and contract date  from every child record and put them into a field on account but i get a loop error
I'll really appreciate if someone could help me with a pseudocode
Greetings we have a task to query activies but sometime we are getting this error, so i really appreciate you help! Thank you.

Error al realizar la consulta en salesforce. UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1172594993-1078047 (-369530101) SQL: SELECT What.Name, What.Id, Type, ActivityDate, Account.Name, Subject FROM Task WHERE ActivityDate = THIS_MONTH AND What.Name != Null AND Owner.Userrole.Name LIKE '%EV-Network%' AND WhatId in (SELECT id FROM Opportunity) AND Status = 'Completada' ORDER BY ActivityDate ASC
 
Greetings

I need some help, i need to query select all the emails sent related to an opportunity, i need to do that using the task object (if yes, where i can get the for: to: subject field) or i need to use the emailmessage object (if is correct why i don't get records, the object is empty)

I'll really appreciate your help
Hi ! I have this query
 
SELECT Id, Name, (SELECT Proveedores__c FROM Proveedores__r), (select name from opportunities where createddate =this_year and stagename='Ganada') FROM Account 
where id in (SELECT Cuenta__c FROM Proveedores__c)
and id in (select accountid from opportunity where createddate =this_year and stagename='Ganada')    

But now i'm stuck in how i can show all the Account Name, the Proveedores__c columns and the Opportunity name in a visualforce page

I'll really appreciate your help!!!
 
Hi ! I have this query
 
SELECT Id, Name, (SELECT Proveedores__c FROM Proveedores__r), (select name from opportunities where createddate =this_year and stagename='Ganada') FROM Account
where id in (SELECT Cuenta__c FROM Proveedores__c)
and id in (select accountid from opportunity where createddate =this_year and stagename='Ganada')    

But now i'm stuck in how i can show all the Account Name, the Proveedores__c columns and the Opportunity name in a visualforce page

I'll really appreciate your help!!!
We are trying to execute a VB Script in salesforce but we only get an email from salesforce with the message:
An unexpected error occurred. Please include this ErrorId if you contact support: 1112784119-827309 (313661600)

We are trying to select activities from account and related to costum object
We are trying to execute a VB Script in salesforce but we only get an email from salesforce with the message:
An unexpected error occurred. Please include this ErrorId if you contact support: 1112784119-827309 (313661600)

We are trying to select activities from account and related to costum object

I'll appreciate you help.

Greetings!

 

I hope you can help me !

 

 

I have one custom object "B" where i have two fields one for date and one for a product name, what i'm looking is to add into the account field "products" all the products from  with the same date from B, i was trying to use a workflow but i only get one name.

 

Is there another way to do that? i'll really appreciate your help.

 

Thank you.

Greetings!

 

I'm trying to use this code:

 

for(Event r: trigger.new){
     if (r.WhatID CONTAINS '%006%'){
          Opportunity opp = [select id,name,StageName from Opportunity where id =: r.whatID limit 1];

        
         r.Stage__c = opp.StageName;
          }

 

What i'm trying to get, is when the r begins with 006 i paste the stagename on the filed, if not then r must be some text like "Empyt"

 

This is for the Event object.

 

Thank you!!!!

Hello all!

I have a question, i have a field on my opp products for the "Life of the contract" call (Vigencia) it's a number field, what i need is to put that value on opp field called Vigencia_MAX, but i have two conditions for that:
1) Put the Vigencia on Opp from the product with the highest price or if
2) the price are the same, put the Highest Vigencia on pp.

So for that i have this

trigger VigenciaOpp on OpportunityLineItem (after insert, after update, after delete) {

list<id> oppids=new list<id>();
list<opportunity> oppnames=new list<opportunity>();
for(OpportunityLineItem c:trigger.new){
oppids.add(c.opportunityId);
}
system.debug('>>>>'+oppids);
List<opportunity> opps=new List<opportunity>([select id, (select id,Vigencia_N_mero__c,TotalPrice from OpportunityLineItems Where Califica_a_Comision__c=True Order by Vigencia_N_mero__c DESC ,Vigencia_N_mero__c DESC Limit 1 ) from opportunity where Opportunity.Id in:oppids]);
Decimal myDecimal = 0.00;
Integer n=myDecimal.intValue();
for(opportunity o:opps){
for(OpportunityLineItem o1:o.OpportunityLineItems){
Decimal myDecimal2 =o1.Vigencia_N_mero__c;
n=myDecimal2.intValue();
}
o.Vigencia_Comision__c=n;
oppnames.add(o);
}
update oppnames;
}

It work, but no in the way that I need, i'll really appreciate your help!
I'm on the Create a Satisfaction Survey trailhead but i get this error, I'll really appreciate your help!
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FWMEIALZ
  • September 26, 2018
  • Like
  • 0
Hi! I'm looking how i can writte a trigger to do this:

In my accounts, i have a lookup field to object B, this field is not master-detail.
When i schedule a meeting in my account, i want to update a datetime field in object B.

I'll really appreciate your ideas!
 
Hello, we have two objects A and B, in A we have a lookup field that, when it changes, update a text field in B, at this point we are working ok, but when the lookup field on A change, the record on B is not updated to edit the information on the text field, do you have any idea on how to do this???

I'll really appreciate your help.
Please your help!
we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now
Please help! we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now
Please Help!!!
The last week we change from customized forecast to collaborative forecast, and all is working ok, the problem is... that we have 1 apex class and 2 schedules that query revenueforecast and when we try to delete them, we get an error Invalid type: RevenueForecast & line -1, column -1: Dependent class is invalid and needs recompilation, how can we delete them now???

I'll really appreciate your help
Hello i have this trigger and works ok, the problem is that date field (not datetime) returns me the date in yyyy/mm/dd 00:00:00 format and i would like to get the date in DD/MM/YYYY format. This is the Date field Fecha_de_Vencimiento_de_Contrato__c

I will really appreciate your help

 List<Id> conIds = new List<Id>();
   
    if(trigger.isDelete){
        for(Proveedores__c c : Trigger.old){
            conIds.add(c.Cuenta__c);
        }
    }else{
        for(Proveedores__c c : Trigger.new){
        conIds.add(c.Cuenta__c);
        }
    }
    
    List<Account> ProveedoresAccount = [Select id, name, Proveedores_Resumen__c, (Select tipo_de_proveedor__c, Proveedores__c, 
                                        Fecha_de_Vencimiento_de_Contrato__c   from Proveedores__r) from Account where id in : conIds];   
    
    for(Account a: ProveedoresAccount){
        String Proveedores='';
        for(Proveedores__c pro : a.Proveedores__r){
            Proveedores=Proveedores+': '+pro.tipo_de_proveedor__c+': '+pro.Proveedores__c+': '+pro.Fecha_de_Vencimiento_de_Contrato__c +'/' ;       
        }
        a.Proveedores_Resumen__c= Proveedores;
        update(a);
    }
Hello I will really appreciate your help, i have this trigger, the coverage is 100% , but i get an error, System.LimitException: Too many SOQL queries: 101, Line 12 "List<Proveedores__c > media = [select id,name, Tipo_de_Proveedor__c,Fecha_de_Vencimiento_de_Contrato__c ,Proveedores__c, cuenta__c from Proveedores__c where cuenta__c in : conIds];" i don't know what else i can do. Thank you!


trigger ResumenProveedores on Account (before insert, before update) {



List<Id> conIds = new List<Id>();
String Proveedores='';

for(Account c : Trigger.new){
conIds.add(c.Id);
}

  List<Proveedores__c > media = [select id,name, Tipo_de_Proveedor__c,Fecha_de_Vencimiento_de_Contrato__c ,Proveedores__c, cuenta__c from Proveedores__c where cuenta__c in : conIds];

 for(Account c : trigger.new){
//      conIds.add(c.Id);
    
        
        for(Proveedores__c pro: media){
            Proveedores=Proveedores+': '+pro.tipo_de_proveedor__c+': '+pro.Proveedores__c+': '+pro.Fecha_de_Vencimiento_de_Contrato__c +'/' ;
            }
            c.Proveedores_Resumen__c= Proveedores;
     } 
}
Greetings we have a task to query activies but sometime we are getting this error, so i really appreciate you help! Thank you.

Error al realizar la consulta en salesforce. UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1172594993-1078047 (-369530101) SQL: SELECT What.Name, What.Id, Type, ActivityDate, Account.Name, Subject FROM Task WHERE ActivityDate = THIS_MONTH AND What.Name != Null AND Owner.Userrole.Name LIKE '%EV-Network%' AND WhatId in (SELECT id FROM Opportunity) AND Status = 'Completada' ORDER BY ActivityDate ASC
 
Hi ! I have this query
 
SELECT Id, Name, (SELECT Proveedores__c FROM Proveedores__r), (select name from opportunities where createddate =this_year and stagename='Ganada') FROM Account 
where id in (SELECT Cuenta__c FROM Proveedores__c)
and id in (select accountid from opportunity where createddate =this_year and stagename='Ganada')    

But now i'm stuck in how i can show all the Account Name, the Proveedores__c columns and the Opportunity name in a visualforce page

I'll really appreciate your help!!!
 
Hi ! I have this query
 
SELECT Id, Name, (SELECT Proveedores__c FROM Proveedores__r), (select name from opportunities where createddate =this_year and stagename='Ganada') FROM Account
where id in (SELECT Cuenta__c FROM Proveedores__c)
and id in (select accountid from opportunity where createddate =this_year and stagename='Ganada')    

But now i'm stuck in how i can show all the Account Name, the Proveedores__c columns and the Opportunity name in a visualforce page

I'll really appreciate your help!!!
Hi All,

I have created a summary report named "Cases by Status" and included Case Owner and Account Name fields as columns. But still I am getting an error saying...
Challenge not yet complete... here's what's wrong:  The 'Cases by Status' report does not include the Owner and Account Name columns. Where am I going wrong?
We are trying to execute a VB Script in salesforce but we only get an email from salesforce with the message:
An unexpected error occurred. Please include this ErrorId if you contact support: 1112784119-827309 (313661600)

We are trying to select activities from account and related to costum object