• Pallavi Ghole
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 10
    Replies
Hello,

Has anyone used the Google Calender API to create , update , delete meeting requests etc from Salesforce ? 
Would you be willing to share your code ? 

Regards
Pallavi
Hello,
In the exercise "Create a unit test for a simple Apex trigger" , here is the code I wrote and for some reason it keeps giving me an Assertion failed 
@ line 24. Can you please help determine the reason?

@isTest
private class TestRestrictContactByName
 {
    @isTest static void TestMethodRestrictContact() {
        // Test data setup
        // Create an Account and its contact with Last Name = INVALIDNAME
        Account acct = new Account(Name='Test Account');
        insert acct;

List <Contact> contactlist = new List <Contact>();

Contact cont1 = new Contact(FirstName='Test1',LastName='INVALIDNAME',Email='test1@invalid.com',AccountId=acct.Id);
contactlist.add(cont1);
Contact cont2 = new  Contact(FirstName='Test2',LastName='VALIDNAME',Email='test2@valid.com',AccountId=acct.Id);
contactlist.add(cont2);

Test.startTest();
    try {
        insert contactlist;
        }
    Catch (DMLException exp) {
        for(integer i = 0; i < 2; i++) {
    //System.assert(exp.getMessage().contains('The Last Name "'+Contactlist[i].LastName+'" is not allowed for DML'));
    System.assert(exp.getMessage().contains('The Last Name INVALIDNAME is not allowed for DML'));
        }
    }
Test.stopTest();
}
}

 
Hello SFDC Gurus,
I am writing below code and while theSave button shows up on the VF page and on selecting a Rating value it seems to be updating all the selected records to that value on the VF page, however when I go back to the Account record from the standard search page and check the Account, its Rating has not been updated with the value I selected in the VF page.
Can you please help ?


<apex:page standardController="Account" recordSetVar="accounts">
  <apex:form >  
    <apex:pageBlock title="Account List">
        <apex:inputField value="{!Account.Rating}"/>
        <apex:commandButton action="{!save}" value="Update Rating"/>
        <apex:pageBlockTable value="{!selected}" var="acct"> 
            <apex:column >
                <apex:facet name="header">
                    Account Name
                </apex:facet>
                <apex:facet name="footer">
                    End of Table
                </apex:facet>
                <apex:outputField value="{!acct.Name}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    Rating
                </apex:facet>
                <apex:facet name="footer">
                    End of Table
                </apex:facet>
                <apex:outputField value="{!acct.Rating}"/>
            </apex:column>
        
        </apex:pageBlockTable> 
       <apex:commandLink action="{!previous}"/>Previous<apex:commandLink /> &nbsp;    
       <apex:commandLink action="{!next}"/>Next<apex:commandLink />    
    </apex:pageBlock>
  
  </apex:form>  
    
</apex:page>

 
I am currently on a VisualForce course by Matt Lacey and having trouble with the Apex code for DataList / PageBlockTable. 
Though my apex code does not show any errors the page does not display any records. Any help/direction would be appreciated.

Here is the Code
=============

<apex:page standardController="Account" recordSetVar="accounts">
    <apex:pageBlock title="Account List">
        <apex:pageBlockTable value="{!accounts}" var="acct">
            <apex:column >
                <apex:outputField value="{!acct.Name}"/>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!acct.Rating}"/>
            </apex:column>
        </apex:pageBlockTable>    
    </apex:pageBlock>
</apex:page>




Any idea what I may be doing wrong?  
Or is there a setup needed to display this data? 


Regards
Pallavi
I am learnig Apex coding using David Liu's Apex Academy and have a couple triggers on Case object 
WarrantySummary
CheckSecretInformation

All was well till I only had the WarrantySummary trigger but once I created the CheckSecretInformation trigger and try to insert/edit a case I get the error below ==> 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CheckSecretInformation caused an unexpected exception, contact your administrator: CheckSecretInformation: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, WarrantySummary: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.WarrantySummary: line 5, column 1: []: Trigger.CheckSecretInformation: line 32, column 1


Can you please help ?

Regards
Pallavi
Hello,

Has anyone used the Google Calender API to create , update , delete meeting requests etc from Salesforce ? 
Would you be willing to share your code ? 

Regards
Pallavi
Hello,
In the exercise "Create a unit test for a simple Apex trigger" , here is the code I wrote and for some reason it keeps giving me an Assertion failed 
@ line 24. Can you please help determine the reason?

@isTest
private class TestRestrictContactByName
 {
    @isTest static void TestMethodRestrictContact() {
        // Test data setup
        // Create an Account and its contact with Last Name = INVALIDNAME
        Account acct = new Account(Name='Test Account');
        insert acct;

List <Contact> contactlist = new List <Contact>();

Contact cont1 = new Contact(FirstName='Test1',LastName='INVALIDNAME',Email='test1@invalid.com',AccountId=acct.Id);
contactlist.add(cont1);
Contact cont2 = new  Contact(FirstName='Test2',LastName='VALIDNAME',Email='test2@valid.com',AccountId=acct.Id);
contactlist.add(cont2);

Test.startTest();
    try {
        insert contactlist;
        }
    Catch (DMLException exp) {
        for(integer i = 0; i < 2; i++) {
    //System.assert(exp.getMessage().contains('The Last Name "'+Contactlist[i].LastName+'" is not allowed for DML'));
    System.assert(exp.getMessage().contains('The Last Name INVALIDNAME is not allowed for DML'));
        }
    }
Test.stopTest();
}
}

 
Hello SFDC Gurus,
I am writing below code and while theSave button shows up on the VF page and on selecting a Rating value it seems to be updating all the selected records to that value on the VF page, however when I go back to the Account record from the standard search page and check the Account, its Rating has not been updated with the value I selected in the VF page.
Can you please help ?


<apex:page standardController="Account" recordSetVar="accounts">
  <apex:form >  
    <apex:pageBlock title="Account List">
        <apex:inputField value="{!Account.Rating}"/>
        <apex:commandButton action="{!save}" value="Update Rating"/>
        <apex:pageBlockTable value="{!selected}" var="acct"> 
            <apex:column >
                <apex:facet name="header">
                    Account Name
                </apex:facet>
                <apex:facet name="footer">
                    End of Table
                </apex:facet>
                <apex:outputField value="{!acct.Name}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    Rating
                </apex:facet>
                <apex:facet name="footer">
                    End of Table
                </apex:facet>
                <apex:outputField value="{!acct.Rating}"/>
            </apex:column>
        
        </apex:pageBlockTable> 
       <apex:commandLink action="{!previous}"/>Previous<apex:commandLink /> &nbsp;    
       <apex:commandLink action="{!next}"/>Next<apex:commandLink />    
    </apex:pageBlock>
  
  </apex:form>  
    
</apex:page>

 
I am currently on a VisualForce course by Matt Lacey and having trouble with the Apex code for DataList / PageBlockTable. 
Though my apex code does not show any errors the page does not display any records. Any help/direction would be appreciated.

Here is the Code
=============

<apex:page standardController="Account" recordSetVar="accounts">
    <apex:pageBlock title="Account List">
        <apex:pageBlockTable value="{!accounts}" var="acct">
            <apex:column >
                <apex:outputField value="{!acct.Name}"/>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!acct.Rating}"/>
            </apex:column>
        </apex:pageBlockTable>    
    </apex:pageBlock>
</apex:page>




Any idea what I may be doing wrong?  
Or is there a setup needed to display this data? 


Regards
Pallavi
I am learnig Apex coding using David Liu's Apex Academy and have a couple triggers on Case object 
WarrantySummary
CheckSecretInformation

All was well till I only had the WarrantySummary trigger but once I created the CheckSecretInformation trigger and try to insert/edit a case I get the error below ==> 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CheckSecretInformation caused an unexpected exception, contact your administrator: CheckSecretInformation: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, WarrantySummary: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.WarrantySummary: line 5, column 1: []: Trigger.CheckSecretInformation: line 32, column 1


Can you please help ?

Regards
Pallavi