• Érick BS
  • NEWBIE
  • 10 Points
  • Member since 2019
  • Programmer
  • Accenture

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hi! I am facing a small problem, but so far I was not able to solve this issue.
Is anyone can help me to solve this?

The function MONTH(TODAY())-3 should return 11, but I think that is return -1 and of course does not exist the month -1 :)
Redlining__Effec_Date__c <
DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY()))

 
Hi! I am a new developer in Apex... Could someone help me to solve this error? I can´t understand what I have to do.
 
private static List<Task> queryExistingContractsTasks( List<User> entradaDuenos, List<Contract__c> entradaContratos ){
        return [
            SELECT
                WhoId,
                OwnerId
            FROM
                Task
            WHERE
                OwnerId IN :entradaDuenos
            AND WhoId IN :entradaContratos
            AND Subject LIKE '%Contract%'
            AND CreatedDate = TODAY
        ];
    }

 
Hi! I am new with SF Apex programming, then I am stuck with a simple problem I think so.
After I added a Validation Rule to unable the user saves a new account without entering data in the fields (ShippingCity, ShippingPostalCode, ShippingStreet) I am facing some problems with a trigger test class.

I must be able to put fake values in my trigger test for these new fields that now are required field.

Could you help me, pls?
 
@isTest
    static void UpdateAccountProspect1() {        
        Boolean result = true;
        try{
            User testUser = SetupClassTest.createUserSalesRep('2801','testadmin@testorg.com', 'testadmin@testorg.com.prod');
            System.runAs(testUser){
                RecordTypeInfo rt = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Prospect_2801');
                List<Account> accToUpdate = SetupClassTest.generateNAccountsWithRT(1, rt.getRecordTypeId(), '2801');
                accToUpdate[0].RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Customer_2801').getRecordTypeId();
                update accToUpdate[0];
            }
        }catch(Exception e){
            System.debug('Línea: ' + e.getStackTraceString());
            result = false;
        }
        System.assert(result);
    }



 
Hi! I am facing a small problem, but so far I was not able to solve this issue.
Is anyone can help me to solve this?

The function MONTH(TODAY())-3 should return 11, but I think that is return -1 and of course does not exist the month -1 :)
Redlining__Effec_Date__c <
DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY()))

 
Hi! I am a new developer in Apex... Could someone help me to solve this error? I can´t understand what I have to do.
 
private static List<Task> queryExistingContractsTasks( List<User> entradaDuenos, List<Contract__c> entradaContratos ){
        return [
            SELECT
                WhoId,
                OwnerId
            FROM
                Task
            WHERE
                OwnerId IN :entradaDuenos
            AND WhoId IN :entradaContratos
            AND Subject LIKE '%Contract%'
            AND CreatedDate = TODAY
        ];
    }

 
Hi! I am new with SF Apex programming, then I am stuck with a simple problem I think so.
After I added a Validation Rule to unable the user saves a new account without entering data in the fields (ShippingCity, ShippingPostalCode, ShippingStreet) I am facing some problems with a trigger test class.

I must be able to put fake values in my trigger test for these new fields that now are required field.

Could you help me, pls?
 
@isTest
    static void UpdateAccountProspect1() {        
        Boolean result = true;
        try{
            User testUser = SetupClassTest.createUserSalesRep('2801','testadmin@testorg.com', 'testadmin@testorg.com.prod');
            System.runAs(testUser){
                RecordTypeInfo rt = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Prospect_2801');
                List<Account> accToUpdate = SetupClassTest.generateNAccountsWithRT(1, rt.getRecordTypeId(), '2801');
                accToUpdate[0].RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Customer_2801').getRecordTypeId();
                update accToUpdate[0];
            }
        }catch(Exception e){
            System.debug('Línea: ' + e.getStackTraceString());
            result = false;
        }
        System.assert(result);
    }



 
Hi ,
I was trying to solve the trailhead challenge under "Using Static Resources".

Am getting following message:
Challenge not yet complete... here's what's wrong: 
The page does not include a reference to the specified image

Following code am using.
<apex:page >
            <apex:pageBlock title="Pic" >
                    <apex:pageBlockSection >
                         <apex:image value="{!URLfor($Resource.vfimagetest, '/cats/kitten1.jpg')}"/>
                    </apex:pageBlockSection>
             </apex:pageBlock>
</apex:page>
Am I missing something here?

Regards,
Manjunath C Sarashetti