• priyanshu nema 2
  • NEWBIE
  • 15 Points
  • Member since 2019

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

How to write test class for map<object,object>collection object please have a look the below code
 @AuraEnabled
    public static String createContactRecords(List<Object> lstObjects) {
        
        For(Object obj : lstObjects) {
            Map<Object, Object> mapContact = (Map<Object,Object>)obj;
            
            If(mapContact.get('type') == 'string' || 
               mapContact.get('type') == 'text' || 
               mapContact.get('type') == 'textarea' || 
               mapContact.get('type') == 'url' || 
               mapContact.get('type') == 'phone' || 
               mapContact.get('type') == 'email'
              )  {
                  If(mapContact.get('value') != null && String.valueOf(mapContact.get('value')) != '') {
                      objContact.put(String.valueOf(mapContact.get('field')), String.valueOf(mapContact.get('value')));
                  }
              }
}





test class-
@isTest
public class ContactFormHandler_Test {
    @isTest
    public static void test(){
        Account acc= new Account();
        acc.Name = 'test';
        insert acc;
        contact con = new Contact();
        con.LastName = 'test1';
        insert con;
        List<object> objList = (List<object>)json.deserializeUntyped('[{"field": "FirstName","type": "string", "value": "tedf"},{"field":"LastName", "type":"string", "value":"hgghjh"}]');

ContactFormHandler.createContactRecords(objList);

It show error - System.TypeException: Invalid conversion from runtime type Map<String,ANY> to Map<ANY,ANY> 
     

Hi,

I am a Trainee in VF development. Stucked in between one assignement. Please suggest me solution to fulfill below requirement. 

Requriment: User should be able to select an Account, based on the selected Account, show Account’s Name, Industry and Type in new section.
 
<apex:page controller="AccountDetails">

<script type="text/javascript">
    function getRemoteAccount(){
        alert(document.getElementById("form1.accName"));//Unable to access selected value
    }

</script>
 <apex:form id="form1">
 <apex:pageblock >
     <apex:pageblockSection >
         <apex:inputField value="{!acc.AccountId}" id="accName" onchange="getRemoteAccount()"/>
     </apex:pageblockSection>
     <apex:pageBlockSection >
     <span id="span1" />
     </apex:pageBlockSection>
 </apex:pageblock>
 </apex:form>
</apex:page>
 
/************Controller*********************/

public class AccountDetails {

    public contact acc { get; set; }
}

 
Hi.. I have just started learning jQuery in Vf page and was checking online resources . I cam accross these codes , needed some clarity on this.
<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.11.4.min.js')}"  />
<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.8.6.custom.min.js')}"  />
<apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.8.6.custom.css')}"  />
  I have downloaded[ jquery-ui-1.11.4.custom.zip] and included as a static resource but I am not sure if I need to download something else as well?
Because in the example above there are 3 lines of code. Are they referring to the same jQuery zip folder?
Also please help me get some working example with jQuery in Visualforce page.
It's a basic question. How to rename Lightning component once created?  I couldn't find any menu on Devloper console and any buttons on Setup|Develop|Lightning Components. Is it necessary to delete and create new one with new name?
I am doing integration salesforce with box.com so after uploading file i want the download that file.Like in google drive we set approval_prompt=force and response body contain webContentLink for to download that file.How i can get box.com downloadable link ?

Hi,

 

When we create a user in salesforce, I would like to restrict the login credential email to be sent. How can we restrcict the user receiving the login credentails at the time of user creation?

 

I would like to send the credentials later but not at the time of user creation. 

 

Any thoughts?

 

Thanks

  • October 07, 2013
  • Like
  • 0

 

I am not getting the correct way putting date in below SOQL statement 

 

SELECT id, CreatedDate  FROM Sales_Order__c where CreatedDate < 2013-01-11

 

could some one help please 

 

Thanks 

 

error :

INVALID_FIELD:
recordtype__c FROM Sales_Order__c where CreatedDate < 2013-01-11
^
ERROR at Row:1:Column:877
value of filter criterion for field 'CreatedDate' must be of type dateTime and should not be enclosed in quotes

  • May 20, 2013
  • Like
  • 0