• Vanessa Barros
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 79
    Replies

Hi there!

Do you know if i can user current logged -in user on Force.com licence user? because i made a dashboard with this feature and when a user with force.com licence try to run this dashboard, he gets insufficient privileges.

The reports and folders they have permission to see and run the reports but the dashboard no.

thanks!

Hi.

Im having trouble with the client certificates. The error that im receiving from the external system is sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

 

So i investigate on SF, and there are two ways: or use the SF certificated (generated on SF) but the customer dont want or import the certificate (but this is to complicated because we dont have access to the certificated company).

there is anyone with an other ideia or solution?

 

tks!

Hi all.

 

I have a question about the partner portal.

I have "public read" on account on OWD and i have a custom profile for an user parter portal based on Gold Partner that i gave acess to "convert lead" and create/edit account/contact/opportunity.

 

when i try to convert the lead to an existing account that is not mine (the owner is not mine), i have an error of permission: "You do not have the required permission. To continue, you must have the 'Edit' permission on accounts "

 

Can you help me please? tks

hi.

i develop a force.com site with 3 pages and in the end i insert a record on the SF updating a field that i show on the second page.

but..without closing the browser, i click on the link to go to the first page, navegate into the second page and the field is not updated..just only when i click refresh to reload the browser.

 

someone can help me?

tks 

hi!

i made the code to import dat from SF to a csv file.

anyone knows how to put a break line to separe in lines?

 

this is the code of the visualforce page

 

<apex:page controller="cobrancasController" cache="true" 
contentType="text/plain/#novosDoadores.csv">

Nome Doador;N contribuinte;Valor;Ref. normalizada BCP; Nib;Id account;N doador\n

<apex:repeat value="{!cs2}" var="doador">

{!doador.Account.name};{!doador.Account.N_Contribuinte__c};{!doador.amount};{!doador.AUX_REF_BCP_PS2__c};{!doador.NIB__c};{!doador.AccountID};{!doador.Account.Numero_novo__c }
</apex:repeat>

</apex:page>



HI!

i know about dataloader or report but i have to create the csv with a specific lines and data.

So.. my ideia is to have a button that on clicking export a csv file.

Anyone has an example of that?

many tks

hi! can you help me?

i have a javascript button that i made to modify the owner id if the Business_unit__c field is not null.

 

Doesnt work.. :(

 

this is the code

{!REQUIRESCRIPT
("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.Case)};
var newRecords = [];

for (var n=0; n<records.length; n++) {
var c = new sforce.SObject("Case");

c.id = records[n];

var efdata = sforce.connection.query("Select  Business_unit__c From case where id = " + "'" +c.id + "'" );


if(efdata == null){
alert("O caso está incompleto! Dados em falta: Business Unit");

}else{
var efdata2 = sforce.connection.query("Select  User_logged__c From case where id = " + "'" +c.id + "'" );
for (var i=0; i<efdata2.length; i++) {
c.ownerId=efdata2[i];
newRecords.push(c);



}
result = sforce.connection.update(newRecords);

window.location.reload();
}


}

Hi.

Someone knows if i have the closed date before update?

 

my trigger is

 

//Situação de Fecho de CASO
If(trigger.IsUpdate){
    If(system.trigger.NewMap.get(c.Id).Status == 'Closed'||system.trigger.NewMap.get(c.Id).Status == 'Closed - 1º call'
    ||system.trigger.NewMap.get(c.Id).Status == 'Closed - rejected' ||system.trigger.NewMap.get(c.Id).Status == 'Information'){
    BusinessHours bh = [select Id, FridayEndTime,MondayEndTime,TuesdayEndTime,WednesdayEndTime,
    ThursdayEndTime from BusinessHours where IsDefault=true];
    system.debug('closed date :' + system.trigger.NewMap.get(c.Id).ClosedDate);
            Long effective_time = BusinessHours.diff(bh.id, c.CreatedDate,system.trigger.NewMap.get(c.Id).ClosedDate );
            c.Effective_Resolution_Time__c =effective_time;
            c.Effective_Resolution_Time_h__c = effective_time/60/60/1000L;
            if(c.Effective_Resolution_Time__c > c.Estimated_time__c){
            c.Exceeded_Time__c =( c.Effective_Resolution_Time__c - c.Estimated_time__c)/60/60/1000L;
           
            }else {
            c.Exceeded_Time__c = 0;
            }
            
            
        
    }}

 

gives me an error that system.trigger.NewMap.get(c.Id).ClosedDate); is null

hi! i had done a mail merge template to the object Account. and i want to put the contacts too..

my question is: In mail merge, there is any code to display the content of the contacts related list ? to repeat all the contacts associated to the specific account?

like the products on the opportunity?

tks.

Hi!

i have an issue on html template email.

when i put a attachment (pdf or a image) on the html template email and do a mass email, the attachment goes on html..

 

This is normal?

Hi! anyone make the connection Salesforce to salesforce with Webservices? i know that Salesforce has this but i cant use this.

cheers

hi!

I have a SSL connection that begins in Salesforce and send information to a web server and the web server send to ues a response.

 

The certificate that is in web server was updated and..puff.. when we send information in salesforce to the server, the error is:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 

I read many things about it but i dont understand how to do the update on SF or if i have to generated a CA..how can i do?

cheers!

Hi.

i have the currency field in opportunity object that when i rend the visualforce page that appear 1500.00.

My ideia is to put like this 1.500,00.

 

I try many ways :(

Can help me? pleasee

I dont understand one thing..

its possible SF gives me an error in a list ? this error in a trigger -> Failure Message: "System.Exception: Too many SOQL queries: 101", Failure Stack Trace: "Trigger.preencherResumoPricing: line 4, column 43"

 

line 4 its a list

List<Pricing_Produto_Final__c> ppfCNCPC = [select produto__c, preco_de_compra__c,valido_de__c, valido_ate__c,
            Centro_de_Carga2__c from Pricing_Produto_Final__c
            where Tr_background__c = 'Pricing PC Prod Final'];

 

Hi.

i had made a class test in sandbox, gives me 81%..then i deploy the class to production to run , gives me an error : Failure Message: "System.QueryException: List has no rows for assignment to SObject", Failure Stack Trace: "Class.myClass.myTest: line 6, column 21 External entry point"

 

this is my class:

line 6 is this: 

Product2 produto3 = [select id from Product2 where name = 'DSL 10ppm CIF NWE AAWZC00'];

Can help me?

 

 

@isTest 
private class myClass {
    static testMethod void myTest() {
//--------------------------------------------------
 
Product2 produto3 = [select id from Product2 where name = 'DSL 10ppm CIF NWE AAWZC00'];
RecordType rtp = [select id from RecordType where name = 'Platts'];
Pricing__c p = new Pricing__c (RecordTypeId = rtp.id, produto__c =produto3.id, valor_inicial__c =1, cambio_usd_ton__c = 1,
valido_de__c =date.today(), valido_ate__c= date.today());
insert p;



Product2 produto4 = [select id from Product2 where name = 'Diesel - PVP'];
RecordType rtpp4 = [select id from RecordType where name = 'Preço de Venda'];
Pricing__c p4 = new Pricing__c (RecordTypeId = rtpp4.id, produto__c = produto4.id, 
valido_de__c =date.today(), valido_ate__c= date.today());
insert p4;


Product2 produto_composto2 = [select id from Product2 where name = 'COMBUSTÍVEL BIODIESEL 10%'];
RecordType rtpp = [select id from RecordType where name = 'Produtos Compostos'];
Pricing__c p3 = new Pricing__c (RecordTypeId = rtpp.id, produto__c = produto_composto2.id, 
valido_de__c =date.today(), valido_ate__c= date.today());
insert p3;
Account acc = new Account(name='testing account');
        insert acc;
Account acc_filho = new Account(name='testing account filho');
        insert acc_filho;
        
Account a = [select Parentid from Account where //id ='001Q000000AdLXY'
id= :acc_filho.id];

a.parentid = acc.id;
//'001Q000000AdLXO';
update a;

Account aa = [select Parentid from Account where id= :acc_filho.id];

aa.parentid = null;
update aa;
 
Partidas_Financeiras__c pf_criar = new Partidas_Financeiras__c(conta__c = acc.id,valor_liquido__c =1 );
insert pf_criar;
    list<Partidas_Financeiras__c> pf = [select Recebido_aguarda_registo_em_SAP__c from
    Partidas_Financeiras__c where conta__c = :acc.id];
    for(Partidas_financeiras__c pfff : pf){
pfff.Recebido_aguarda_registo_em_SAP__c =true;
}
update pf;   
        
 //create a test opportunity

        Opportunity op = new Opportunity(name='testopp1', StageName='Prospecting', CloseDate = date.today(), 
        AccountId = acc.Id);
        insert op;
        Product2 produto = [select id from Product2 where name = 'COMBUSTÍVEL GASÓLEO'];
        PriceBookEntry pbookEntry = [select id from PriceBookEntry where Product2Id = :produto.id];
        Centro_de_carga__c cdc = [select id from Centro_de_carga__c where name = '01 - PrioAF: Matosinhos'];
        //create opportunity line item
        OpportunityLineItem olitem = 
        new OpportunityLineItem(OpportunityId = op.Id, PriceBookEntryId = pbookEntry.Id, 
        Quantity = 1,centro_de_carga2__c = cdc.id, tipo_de_preco_de_referencia__c = 'Preço de Compra',
        incoterms__c = 'EXW');
        insert olitem;

        Product2 produto_composto = [select id from Product2 where name = 'COMBUSTÍVEL BIODIESEL 10%'];
        PriceBookEntry pbookEntry2 = [select id from PriceBookEntry where Product2Id = :produto_composto.id];
        Centro_de_carga__c cdc2 = [select id from Centro_de_carga__c where name = '01 - PrioAF: Matosinhos'];
        OpportunityLineItem olitem2 = 
        new OpportunityLineItem(OpportunityId = op.Id, PriceBookEntryId = pbookEntry2.Id, 
        Quantity = 1,centro_de_carga2__c = cdc2.id, tipo_de_preco_de_referencia__c = 'Preço de Compra',
        incoterms__c = 'EXW');
        insert olitem2;
       
Product2 produto_composto3 = [select id from Product2 where name = 'COMBUSTÍVEL BIODIESEL 20%'];
PriceBookEntry pbookEntry3 = [select id from PriceBookEntry where Product2Id = :produto_composto3.id];
            OpportunityLineItem olitem3 = 
        new OpportunityLineItem(OpportunityId = op.Id, PriceBookEntryId = pbookEntry3.Id, 
        Quantity = 1,tipo_de_preco_de_referencia__c = 'Preço de Venda',
        incoterms__c = 'EXW');
        insert olitem3;
    
        Product2 produto7 = [select id from Product2 where name = 'COMBUSTÍVEL GASÓLEO'];
        PriceBookEntry pbookEntry4 = [select id from PriceBookEntry where Product2Id = :produto7.id];
        //create opportunity line item
        OpportunityLineItem olitem4 = 
        new OpportunityLineItem(OpportunityId = op.Id, PriceBookEntryId = pbookEntry4.Id, 
        Quantity = 1, tipo_de_preco_de_referencia__c = 'Platts',
        incoterms__c = 'EXW');
        insert olitem4;

 
//---------------------------------------------------------------------

Proposta__c pro =new Proposta__c (Oportunidade__c =op.Id, name ='teste',valido_de__c =Date.today(),
    Validade_em_dias__c =3, count_proposta__c =1 );
insert pro;

Proposta__c pro2= [select substituida__c  from Proposta__c where id = :pro.id];
pro2.substituida__c = true;
update pro2;

Proposta__c pro3 =new Proposta__c (Oportunidade__c =op.Id, name ='teste2',valido_de__c =Date.today(),
    Validade_em_dias__c =3 );
insert pro3;



//-----------------------------------------------------------
RecordType rt = [select id from RecordType where name = 'Combustíveis Compostos'];
Input_Resumo_pricing__c  irp= new Input_Resumo_pricing__c(RecordTypeId = rt.id, valido_de__c = Date.today(),
valido_ate__c = Date.today());
insert irp;

RecordType rt2 = [select id from RecordType where name = 'Combustíveis não Compostos'];
Input_Resumo_pricing__c  irp2= new Input_Resumo_pricing__c(RecordTypeId = rt2.id, valido_de__c = Date.today(),
valido_ate__c = Date.today());
insert irp2;

RecordType rt3 = [select id from RecordType where name = 'Pricing Manual'];
Input_Resumo_pricing__c  irp3= new Input_Resumo_pricing__c(RecordTypeId = rt3.id, valido_de__c = Date.today(),
valido_ate__c = Date.today());
insert irp3;

//--------------------------------------------------------------


//-----------------------------------------------


    }
}

hi!

i had made a visualforce page of a custom object calls zones__c and one of the related list is opportunities.

when i list oportunities, shows all of the opportunities but i want to filter by stagename = closed Won.

 

what is the best way? component? extended controller?

can anyone gives me an example please?

tks!

Hi.

Can i put a custom field from a object in a static resource to appear in the footer of a visualforce page?

Hi.

anyone knows how to do a sort on a related list in a visualforce page?

Hi. since january i do triggers and depoloy to production without doing a test class..

Today when im going to deploy one trigger, Production SF get me an error saying "Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required"..

 

I have tested the trigger on sandbox with real case - with insert records..

 

What can i do?

hi people! i noticed that there is an idea that users can reset the auto-generated number from an object..

but..

some develop something to do that? or..any solution?

many tks!

Hi all.

 

I have a question about the partner portal.

I have "public read" on account on OWD and i have a custom profile for an user parter portal based on Gold Partner that i gave acess to "convert lead" and create/edit account/contact/opportunity.

 

when i try to convert the lead to an existing account that is not mine (the owner is not mine), i have an error of permission: "You do not have the required permission. To continue, you must have the 'Edit' permission on accounts "

 

Can you help me please? tks

hi.

i develop a force.com site with 3 pages and in the end i insert a record on the SF updating a field that i show on the second page.

but..without closing the browser, i click on the link to go to the first page, navegate into the second page and the field is not updated..just only when i click refresh to reload the browser.

 

someone can help me?

tks 

HI!

i know about dataloader or report but i have to create the csv with a specific lines and data.

So.. my ideia is to have a button that on clicking export a csv file.

Anyone has an example of that?

many tks

hi! can you help me?

i have a javascript button that i made to modify the owner id if the Business_unit__c field is not null.

 

Doesnt work.. :(

 

this is the code

{!REQUIRESCRIPT
("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.Case)};
var newRecords = [];

for (var n=0; n<records.length; n++) {
var c = new sforce.SObject("Case");

c.id = records[n];

var efdata = sforce.connection.query("Select  Business_unit__c From case where id = " + "'" +c.id + "'" );


if(efdata == null){
alert("O caso está incompleto! Dados em falta: Business Unit");

}else{
var efdata2 = sforce.connection.query("Select  User_logged__c From case where id = " + "'" +c.id + "'" );
for (var i=0; i<efdata2.length; i++) {
c.ownerId=efdata2[i];
newRecords.push(c);



}
result = sforce.connection.update(newRecords);

window.location.reload();
}


}

Hey all,

 

Our org uses a number of Email-to-Case processes, and we want to identify the ToAddresses used for the generated cases to leverage the workflow capacities. We are designing a IsInsert trigger that will automatically populate a custom field with the value of the ToAddress used.

 

The idea is very similar to the Web Email (SuppliedEmail) default page that associates a case with a originator's email address. In this trigger, we are doing a query for the originator's emailmessage and its information.

 

I'm not sure how to do the following:

1) Locate the email message that created the case. Would the code below locate the email that I'm loolking for?

         list<EmailMessage> email = [
         select
         id, ParentId, ToAddress
         from EmailMessage
         where ParentId = c.id  Limit 1];

2) Locate the ToAddress field. ToAddress in above query should be the Email-to-Case address for the created case c. Is that correct?

 

 

Thanks,

 

  • May 29, 2011
  • Like
  • 0

Hi!

i have an issue on html template email.

when i put a attachment (pdf or a image) on the html template email and do a mass email, the attachment goes on html..

 

This is normal?

Hi,

 

I want to show a popup of list of cases without parentid and allow to select usign checkbox and the selected cases are added up in a related list. This popup would be availabe on clicking of link button

 

First question would be can i call a vf page as popup from a standard page?

 

  • April 29, 2011
  • Like
  • 0

I am building a public site in salesforce and when I have outside people test the site they keep getting a Authorizatoin Needed page. When I do it in my sandbox I don't get any errors. What could I be missing? What causes this page to come up? 

Hello,

 

i have a little Problem with my VF-Page.

I would like to implement some related lists into the VF-Page, until now it works very well.

 

But now i would like to use some other Related List e.g. "Account History"  <apex:relatedList list="AccountHistories" /> or <apex:relatedList list="AccountHistory" /> doesn`t work.

 

Any Ideas or a proposal for solution?

 

Txs. in advanced