Skip to main content Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Feed

Connect with fellow Trailblazers. Ask and answer questions to build your skills and network.

(PREVGROUPVAL(AMOUNT:SUM, ACCOUNT_NAME) / AMOUNT:SUM)

 

上記  集計レベルの数式列のエラーが

「関数 'PREVGROUPVAL()' の引数の型が間違っています。」です

 

取引先ごとでグルーピングした小計を全体の商談金額で割ったパーセンテージをレポートに表示したいです。

 

#Formulas

1 answer
  1. Today, 2:57 AM

    @知菜 小池 さん

     

    正直なところPARENTGROUPVAL関数の挙動は理解できませんが、色々試すと以下で思った値になりますねぇ。何でだろうか。

    AMOUNT:SUM/PARENTGROUPVAL(AMOUNT:SUM,GRAND_SUMMARY)

     

    image.png

0/9000

hi @Zachary Kampel or any one.

 

NPSP package contains classes that are below version 45. 26 to be exact.  According to the email sent out recently, all apex classes, triggers and visualforce pages must have version 45 above in order to enable ICU Locale. What is the implication of unable to meet update criteria because NPSP package is no longer updated by the Salesforce. to generalize the issue, what is the implication and recommended action if we are unable to update the component versions from managed packages.

 

This is the email i got in regards to a sandbox. the message in this email sounds like ICU Locale enablement failed without the version update which seemingly contrasting to what's being posted hereIf we don't update the version, will ICU enablement fail in production instance? then what is the implication if the org is being stuck from the scheduled update?

 

Will you also cover the impact on Heroku sync or any other systems that consume Salesforce data?

How about Pardot (Account Engagement) package containing so many components with old API version? What's Salesforce plan for updating Salesforce owned packages?

 

#Heroku #Pardot B2b Marketing Automation #NPSP

 

Your sandbox org  was not enabled on the ICU locale formats as notified due to the API version below 45 used in the org.

 

Please upgrade your Apex classes, Apex triggers, and custom Visualforce pages to API version 45.- or higher. For details, refer to the Help article API Versions for Apex Classes, Apex Triggers, and Visualforce Pages.

 

Salesforce will make this update to your Production org in the following weeks. After the change is completed, you’ll receive a follow-up email confirmation.

 

For questions about the phased deployment, refer to the knowledge article JDK Locale Format Retirement and Enable ICU Locale Formats Release Update.

 

Thank you,

13 answers
  1. Today, 2:57 AM

    The way I read this: “Salesforce will make this update to your Production org in the following weeks.” They’re saying they are going to implement the change in prod, and it is on the customer to prevent it from causing a problem.

    Seems like it would help if they allowed us to enable it in sandbox. Then we could test all date fields to see if we can find and fix any problems.

0/9000

Create a method for inserting accounts.

To pass this challenge, create an Apex class that inserts a new account named after an incoming parameter. If the account is successfully inserted, the method should return the account record. If a DML exception occurs, the method should return null.

  • The Apex class must be called AccountHandler and be in the public scope
  • The Apex class must have a public static method called insertNewAccount
    • The method must accept an incoming string as a parameter, which will be used to create the Account name
    • The method must insert the account into the system and then return the record
    • The method must also accept an empty string, catch the failed DML and then return null

Code:

public class AccountHandler {

 

    public static Account insertNewAccount(String name){

        Account accObj = new Account(Name= name);

        try{

            insert accObj;

        }

        catch(Exception e){

            return null;

        }

        return accObj;

        

    }

}

 

Problem: 

There was an unexpected error in your org which is preventing this assessment check from completing: System.NullPointerException: Attempt to de-reference a null object

Check Challenge to Earn 500 Points

 

#Trailhead Challenges

2 answers
  1. Divya Chauhan (Kcloud Technologies) Forum Ambassador
    Jan 8, 5:15 AM

    Hello@Daniela Pineda,

    • make sure you have saved code 
    • Make sure you are checking the challenge in correct org
    •  If not working, then try in new fresh org, it might be the existing record causing the issues in your org. 
0/9000
0/9000

Hola, saben de códigos de descuentos para los exámenes de certificación?

1 answer
  1. Jan 8, 5:13 AM

    @Jose Matus

    Aquí tienes algunos enlaces:

    • Puedes recibir un descuento de $100 en un examen de certificación de Salesforce de $200 asistiendo a los webinars gratuitos de medio día de preparación para certificaciones. Los detalles sobre los próximos webinars están disponibles en la página de Salesforce Certification Days Trailhead Page  en Trailhead
    • Al participar en los Trailhead Quests, tienes la oportunidad de ganar vouchers gratuitos para exámenes de certificación de Salesforce y otras recompensas. Más información está disponible en la página de  Trailhead Quest Page
0/9000

I tried to upgrade Apex Classes' API version to 45 or higher due ICU locale formats enforcement, but when I did that, I got an error "Error: Compile Error: Defining type for testMethod methods must be declared as IsTest at line 32 column 35"

 

I have no knowledge of Apex Class... Can anyone help me improve the codes? 

 

/**

* @author Sebastian Munoz

* @createdDate 04/06/2010

*/

public with sharing class ShowPicture{

 

    public  Attachment  file        { set; get; }

    public  Boolean     hasPicture  { set; get; }

    private String      parentId    { set; get; }

    

    /**

    * Constructor

    */

    public ShowPicture( ApexPages.StandardController stdController ){

        

        this.parentId       = stdController.getId();

        this.hasPicture     = false;

                

        List<Attachment> attList = [ Select ParentId, Name, Id, ContentType, BodyLength 

                                        From Attachment 

                                        where ParentId =: this.parentId and name = 'Contact Picture' limit 1];

        if( attList.size() > 0 ){

            this.file       = attList.get( 0 );

            this.file.Body  = Blob.valueOf('AuxString');

            this.hasPicture = true;

        }

    }

    

    /**

    * Test method: Environment: no picture uploaded. Then upload one and show it.

    */

    public static testMethod void noPicture(){

        

        Test.startTest();

        

        TestUtilities tu = TestUtilities.generateTest();

        

        ApexPages.StandardController sc = new ApexPages.StandardController( tu.aContac );

        ShowPicture cTest = new ShowPicture( sc );     

        System.assert( cTest.file == null, 'ERROR: should not an image  ' );       

        Test.stopTest();

    }

    

    /**

    * Test method: Environment: a picture was uploaded then replace this with other.

    */

    public static testMethod void noPictureAndUploadOne(){

        

        TestUtilities tu = TestUtilities.generateTest();

        

        Test.startTest();

 

        ApexPages.StandardController sc = new ApexPages.StandardController( tu.aContac );

 

        tu.aAttachment.ParentId = sc.getid();

        tu.aAttachment.name = 'Contact Picture';

        insert tu.aAttachment;

 

        ShowPicture cTest = new ShowPicture( sc );     

        System.assert( cTest.file != null, 'Error no file attached' );     

        System.assert( tu.aAttachment.ParentId == cTest.file.ParentId, 'Error ParentId must be: ' + tu.aAttachment.ParentId );     

        System.assert( tu.aAttachment.name == cTest.file.name, 'Error name must be: ' + tu.aAttachment.name );

        Test.stopTest();

    }

 

    public static testMethod void pictureAndUploadOther(){

        

        TestUtilities tu = TestUtilities.generateTest();

        

        Test.startTest();

        ApexPages.StandardController sc = new ApexPages.StandardController( tu.aContac );

 

        tu.aAttachment.ParentId = sc.getid();

        tu.aAttachment.name = 'Contact Picture';

        insert tu.aAttachment;

        

        //Replace

        tu.aAttachment.Body = Blob.valueOf('String Othe value');

        update tu.aAttachment;

        ShowPicture cTest = new ShowPicture( sc );

          

        System.assert( tu.aAttachment.ParentId == cTest.file.ParentId, 'Error ParentId must be: ' + tu.aAttachment.ParentId );     

        System.assert( tu.aAttachment.name == cTest.file.name, 'Error name must be: ' + tu.aAttachment.name );

        Test.stopTest();

    }

}

1 answer
  1. Today, 2:21 AM

    Hi Rima!

    For the new API versions, you would need to add the tag @IsTest for the test class and also it must be included on the class methods. It should look as the following:

    @IsTest

    public class MyTestClass {

    @IsTest

    static void testMethod1() {

    // Test logic here

    System.assertEquals(1, 1);

    }

    @IsTest

    static void testMethod2() {

    // Test logic here

    System.assertNotEquals(1, 2);

    }

    }

    Please let me know if this information was useful or if you still have questions about this.

0/9000

初歩的な質問になり申し訳ありません。

取引先責任者を入力した際に取引先の候補が表示されるようにする方法が知りたいです。

現在は最近使用した取引先しか表示されず、入力に多少の手間がかかります。

0/9000
1 answer
  1. Ajaypreet Singh Saini (Grantbook) Forum Ambassador
    Today, 2:14 AM

    Hey @Eric Kreil, as far as i remember, there were 3 answer options.

     

    Though it's 3 or 4, if your concepts are clear for the exam then I don't think it matters :) 

     

    Good luck for your exam

0/9000

Hi

In the module Secure Server-Side Development - Write secure Apex Controllers, 

we are asked "When should developers use the "with sharing" keyword in Apex classes?"

 

There are 4 possible choice :

  • 1: When they want to bypass sharing rules for the current user
  • 2 : When they want to enforce CRUD access
  • 3 : When they want to specify inherited sharing for the current user
  • 4 : When they want to determine execution context and enforce permissions, field-level security, and sharing rules

To succeed the Module, the answer is 4 ...  

BUT, I think there is a mistake in this choice !!

 

If we read the Apex Developer Guide - Using the with sharing, without sharing, and inherited sharing Keywords

"Regardless of the sharing mode, object-level access and field-level security are not enforced by Apex. You must enforce object-level access and field-level security in your SOQL queries or code. "

 

My question : Could you confirm me that the documentation is right and the trailhead answer is wrong ?

 

I guest a good answer would have been 

* an improved 4 : When they want to determine execution context and enforce sharing rules for the current-user

* or an improved 3 : When they want to specify sharing for the current user

 

Thanks

 

#Salesforce Developer

1 answer
  1. Today, 2:12 AM

    Hi Fred,

    You are absolutely correct! WITH sharing does not enforce field-level security or object-level security. To address this in your queries, you should use the WITH SECURITY_ENFORCED clause when running SOQL queries.

    I’ll create a report on this module to provide additional insights. Feel free to open your own report as well to increase its visibility.

    I hope this explanation helps! Let me know if you have any further questions.

0/9000

Hello,

I have a call center team that needs to be a team member of an opportunity owned by a field sales person.  my opportunity teams are enabled, but I don't see any available fields or related lists.  The opportunity is not set to private.  What am I missing?

 

#Default Opportunity Teams

1 answer
  1. Today, 2:10 AM

    Did you update the Opportunity Page Layouts? (you need to do that)

    1

     

    Untitled 1.png

     

    2

     

    Untitled 2.png

     

    Also, make sure that the user did not manually remove the Opportunity Team related list

0/9000