• MattGoncalves
  • NEWBIE
  • 30 Points
  • Member since 2015
  • Senior Salesforce Developer


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
Hi there,

I have a custom field that follows the user language and this is working fine. 
For some reason, in a particular location I need to show this field value in English only, ignoring the system translation. 

How to achieve that? Is there a way to force a language in a formula field result? 

Thank you!
Hello,

I am getting these errors in my test class, can I please have some help fixing the issues?

Class
public class convToCst {
    public DateTime dateField{
        get;
        set;
    }
    public string dateFormat {
        get;
        set;
    }
    public string dateTimeZone {
        get;
        set;
    }
    public string output {
        get {return dateField.format(this.dateFormat,this.dateTimeZone);}
           
    }
}

Test class
@isTest
private class TestConvToCst {
    @TestSetup
    static void setupTestData()
    {
        Account acc = new Account(
            Name = 'Test Account');
        insert acc;
        
        Contact con = new Contact(
            FirstName = 'Test', LastName = 'Contact', AccountId = acc.Id  );
        insert con;
        
        eVolve_Service_Request__c ESR = new eVolve_Service_Request__c(Signing_Party_Type__c = 'Seller',
                                                                      Signing_Date_Requested_Start__c = system.today()+5, Status__c = 'New', 
                                                                      Contact_Name__c = con.Id );
        insert ESR;
    }
    @isTest
    static void validateconvToCst()
        
    {
        ConvToCst cst = new ConvToCst();
        cst.ConvToCstId = [Select Id from eVolve_Service_Request__c limit 1].Id;
        
        List<ESR_Signing_Party__c> esp = cst.getConvToCst();
        system.assertEquals('Test Party', esp[0].Name__c);
        
    }
}

Errors:
line 24: Variable does not exist: ConvToCstId
line 26: Method does not exist or incorrect signature: void getConvToCst() from the type convToCst

I tried to copy the code from this but for some reason it is producing errors on this test class: https://developer.salesforce.com/forums/ForumsMain?id=9062I000000ISkfQAG

Thanks,
  • November 02, 2020
  • Like
  • 0
I'm currently stuck on the "Learn Standard Open Redirect Preventions" challenge of the "App Logic Vulnerability Prevention" module.

The challenge is to submit a valid open redirect attack starting from the Standard Redirect Protections Challenge tab.

However, the links on this page are all to standard record pages, where the hack (e.g changing retURL to returl) won't work (it only works on VF pages).

Even if I attempt this and check the challenge, the error I get states: "It doesn't appear that you've successfully redirected to an external website using the Visualforce page. Please try again." - so it implies that it expects me executing this from a custom VF page.

Can anyone give me some advice on where I'm missing something on the challenge?

Please help me. Becuase im very new to sales force. how i can solve this problem

global with sharing class SaveExpenditureWebService {

webservice static Expenditure__c createExpenditure(Decimal amount,String expName, String paidByName )
{

Expenditure__c c = new Expenditure__c();
Person__c p = [Select p.Name From Person__c p Where Name = :paidByName limit 1];
c.Amount__c = amount;
c.Name__c = expName;
c.Exp_Date__c = Date.today();
c.Paid_By__c = p.Id;
insert c;
return c;
}

}

Hi,

I am getting following exception on my configuration sandbox while trying to use sendEmail API to send single email message.

Can you please tell me why and if there is a workaround to this?

SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature.: []

Thanks.

Hi all,

I am developing a sample Flex app in Force.com, which seems have problem to reach some standard objects like Product2 and Lead; but the same code ok with others like User and Account. (I was using SessionId to login.)

Thanks for your help!

~K.F.

 

Here is the error message, while try Query Lead: 

 

(com.salesforce.results::Fault)#0
  context = (null)
  detail = (Object)#1
    InvalidSObjectFault = (Object)#2
      column = 52
      exceptionCode = "INVALID_TYPE"
      exceptionMessage = "
LastName,Id, Email, Company from Lead
                                 ^
ERROR at Row:1:Column:52
sObject type 'Lead' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names."
      row = 1
      xsi:type = "sf:InvalidSObjectFault"
  faultcode = "sf:INVALID_TYPE"
  faultstring = "INVALID_TYPE:
LastName,Id, Email, Company from Lead
                                 ^
ERROR at Row:1:Column:52
sObject type 'Lead' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names."