• Sneha1991
  • NEWBIE
  • 65 Points
  • Member since 2014
  • TA
  • Salesforce


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

Hi guys,

I'm trying to create objects of Territory2Type and Territory2Model classes but it says that DML is not allowed. I also tried SOAP calls but these are not allowed for testing. What should I do?

Best regards,

Community Users are trying to update their email on User object, username is getting updated with the same value but Email is not.. Is it part of some release and how username is updated? Appreciate any help on this. Thanks.
I have to schedule a batch class every hour from 6AM to 6PM. Currently the batch executes every hour but now it has to be restricted i.e. 6AM-6PM. How can it be achieved? 
Hi All,

If anyone has done CTI integration in Salesforce using Genesys CTI Adapter please let me know ASAP.

Thanks. 
Hi All,

What is  the difference between Knowledge and Solution ??
Hi All,

I am new to salesforce so I am not clear about test classes.
Can we write constructor inside test class or it is necessary to write method inside it ???
Hi All,

I want to know about Compact Layout. What it does??? I have created Compact Layout for an object but
I am not getting where I can see its changes.
Community Users are trying to update their email on User object, username is getting updated with the same value but Email is not.. Is it part of some release and how username is updated? Appreciate any help on this. Thanks.
I have to schedule a batch class every hour from 6AM to 6PM. Currently the batch executes every hour but now it has to be restricted i.e. 6AM-6PM. How can it be achieved? 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,
hi Guys,
how can slove this one .

i have 2 objects a and b .B  object contains role field it is picklist .A object contains x and y fields both are no fields.
Now i creating the record in B object when i take the role as Primary and click on save button in the A object x = 1.when i change the role as secondary for same record in B object in A object y = 1.
Please can any one help me.
please
How can my testclass test service calls.
When i run the testclass atm it stopt because of Salesforce doesn't support these calls.

Hi guys,

I'm trying to create objects of Territory2Type and Territory2Model classes but it says that DML is not allowed. I also tried SOAP calls but these are not allowed for testing. What should I do?

Best regards,

Hi,

I'm facing below error in Callout. Can anyone help?


System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
public static void CallforListContactsRequest(string accno)
    {  
       
        contactrequest cntreq1 = new contactrequest();
        contactrequest cntreq = new contactrequest();
        cntreq1.Customername = 'TelAssistant';
        cntreq1.Username = 'Salesforce';
        cntreq1.Password = '&7mXvDGwvU';
        cntreq1.ThirdpartyAccountID= accno;
        //cntreq1.ClientId='517ec5430f4e161a400dc07a';
        String jsonBody = json.serialize(cntreq1);
        system.debug(jsonBody);
        system.debug('this is called from CallforListContactsRequest');
        HttpResponse res;
        HttpRequest req = new HttpRequest();
        req.setEndPoint('https://telassistant.hostedsuite.com/api/json/reply/ListClientsRequest'); 
        req.setMethod('POST');
        req.setHeader('Content-Type','application/json');
        req.setBody(jsonBody);
        Http http_req = new Http();
      try 
        {
            res = http_req.send(req);  //********ERROR  AT THIS LINE  
            system.debug('bodycontact'+res);
           // if(res.getbody()!='[]')
             //{    
                string httpresp = res.getBody();
                String reqresponse = res.getBody();
                list<contactrequestresp> deserializedString= (list<contactrequestresp>)JSON.deserialize(reqresponse,list<contactrequestresp>.class);
                system.debug('deserializedString contact request'+deserializedString);
                for( contactrequestresp d1 : deserializedString )
                  {
                     clientidx = d1.id;
                     system.debug('** client name **' + d1.id );
                     system.debug('** client name **' + d1.clientname );
                     system.debug('**3rdpartyno **' + d1.ThirdPartyAccountId );
                     system.debug('**Client id **' + d1.ClientId );
                 }//}  
          /***   else
             {
                Daily_Billing_Error_Log__c e8 = new Daily_Billing_Error_Log__c();
                e8.Accountno3__c = accno;
                e8.processdate__c = system.today();
                e8.errormsg__c = ' contact request response error '; 
                insert e8;
             }***/          
        }  
        catch(System.CalloutException e) 
        {
            Daily_Billing_Error_Log__c e9 = new Daily_Billing_Error_Log__c();
            e9.Accountno3__c = accxx;
            e9.processdate__c = system.today();
            e9.errormsg__c = ' call out error - contact request '; 
            insert e9;
           
        }
        
     }
Thanks
Hi All,

I am new to salesforce so I am not clear about test classes.
Can we write constructor inside test class or it is necessary to write method inside it ???
Hi All,

I want to know about Compact Layout. What it does??? I have created Compact Layout for an object but
I am not getting where I can see its changes.
Hi,

I'm facing below error in Callout. Can anyone help?


System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
public static void CallforListContactsRequest(string accno)
    {  
       
        contactrequest cntreq1 = new contactrequest();
        contactrequest cntreq = new contactrequest();
        cntreq1.Customername = 'TelAssistant';
        cntreq1.Username = 'Salesforce';
        cntreq1.Password = '&7mXvDGwvU';
        cntreq1.ThirdpartyAccountID= accno;
        //cntreq1.ClientId='517ec5430f4e161a400dc07a';
        String jsonBody = json.serialize(cntreq1);
        system.debug(jsonBody);
        system.debug('this is called from CallforListContactsRequest');
        HttpResponse res;
        HttpRequest req = new HttpRequest();
        req.setEndPoint('https://telassistant.hostedsuite.com/api/json/reply/ListClientsRequest'); 
        req.setMethod('POST');
        req.setHeader('Content-Type','application/json');
        req.setBody(jsonBody);
        Http http_req = new Http();
      try 
        {
            res = http_req.send(req);  //********ERROR  AT THIS LINE  
            system.debug('bodycontact'+res);
           // if(res.getbody()!='[]')
             //{    
                string httpresp = res.getBody();
                String reqresponse = res.getBody();
                list<contactrequestresp> deserializedString= (list<contactrequestresp>)JSON.deserialize(reqresponse,list<contactrequestresp>.class);
                system.debug('deserializedString contact request'+deserializedString);
                for( contactrequestresp d1 : deserializedString )
                  {
                     clientidx = d1.id;
                     system.debug('** client name **' + d1.id );
                     system.debug('** client name **' + d1.clientname );
                     system.debug('**3rdpartyno **' + d1.ThirdPartyAccountId );
                     system.debug('**Client id **' + d1.ClientId );
                 }//}  
          /***   else
             {
                Daily_Billing_Error_Log__c e8 = new Daily_Billing_Error_Log__c();
                e8.Accountno3__c = accno;
                e8.processdate__c = system.today();
                e8.errormsg__c = ' contact request response error '; 
                insert e8;
             }***/          
        }  
        catch(System.CalloutException e) 
        {
            Daily_Billing_Error_Log__c e9 = new Daily_Billing_Error_Log__c();
            e9.Accountno3__c = accxx;
            e9.processdate__c = system.today();
            e9.errormsg__c = ' call out error - contact request '; 
            insert e9;
           
        }
        
     }
Thanks