• Cloud Atlas
  • NEWBIE
  • 275 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 59
    Replies
Hi,
Does anyone know how to build a service which allows Kafka to push data into Salesforce?
Or maybe a service where Salesforce listens to Kafka changes via api and creates a record in one or more objects?
Any help is appreciated.
Thanks!
Hello,

Disclaimer : I have read the all the documentation for sites, so please don't just post links.

I am just curious to hear from folks who have used Sites, as to the limitations surrounding it, like
  1. Can I build a site which accepts details and attachments (like a form) from site users , without the need for any additional license?
  2. Can I build workflows and approval processes around the records which were captured via sites?
  3. How many folks can access the site per month?
  4. What happens when site limits are breached?
  5. How many clicks to the site are allowed per day?
  6. How much should Aura compenents be involved in building sites or can it just be a simple VF page?
Things like that.
Any advice/information in this regards would be much appreciated.
Thanks!
I have a service inserting records and accepting EST values.
"publishedAtEt": "2019-06-13T15:00:33",
"submittedAtEt": "2019-05-01T00:03:34",
Then I have a formula field to figure out the month for "submitted at" value.
INTEGER SUB_MONTH = MONTH(DATEVALUE( Submitted_At__c ))
But upon debugging , I am finding that the SUB_MONTH value is not 5, but 4.
USER_DEBUG |DEBUG|Sub_Month 4
Has anyone ever experienced something like that?
If yes, how did you resolve.
Any help is appreciated.
Thanks!

 
All of our Visualforce pages suddenly stopped displaying all fields and values. I see no changes made to the pages, the underlying classes, the objects and fields referenced, nor to guest profile permissions.
On the Salesforce side, the only message I see is that legacy SOAP API versions were retired today, but I don't see how that comes into play here. Furthermore, they say those versions are usable until the Winter '19 release (we are on Summer '18).

Has anyone seen this before?
I am trying to send a record to an external system via Async service . Only one value within that payload needs to be an array while the remaining should be string. Does any one know how it can be done?
searlization looks like below..
Map<String, String> data = new Map<String, String>{
            'email' => acc.Email__c,
            'displayName' => acc.Display_Name__c,
            'bioUrl' => acc.Bio_URL__c,
            'imageUrl' => acc.Image_URL__c,
            'vertical' => acc.Channel__c,
            'status' => acc.Status__c,
            'gid' => acc.Legacy_GID__c,
            'numberOfExperts' => String.valueOf(acc.Number_of_Experts__c),
            'userId' => String.valueOf(acc.Selene_ID__c),
            'socialPreference' => acc.Social_Presence__c
        };
        String jsonInput = JSON.serializePretty(data, True);

While the output that I am seeking is like..
{
  "socialPreference" : [
                    "www.facebook.com/101", 
                    "www.twitter.com/101"
                        ],
  "userId" : "123456789123",
  "numberOfExperts" : "1",
  "gid" : "210967",
  "status" : "LIVE",
  "vertical" : "SALESFORCE",
  "imageUrl" : "",
  "bioUrl" : "",
  "displayName" : "test101",
  "email" : "test101@test.com"
}
I don't know how to convert just one value (socialPresence)into an array format.
That is a LONG TEXT field in UI and will hold multiple urls separated by comma or semi-colon.

 
Hello,

I am building an approval process for a custom object and have run into a problem.
The approval process limit is 1000 records at each execution. 
While my page will send more than 1000 records for approval at a single click.
So it seems I cannot use standard approval process provided in CRM.
Does any one know a way how this limit can be bypassed or do I need to write complete custom code for approval process??

Any help is appreciated.
Thanks!
Hello Guys,

I have setup a simple SEARCH visualforce page...
I am having a hard time covering test percentage... and am stuck at 35%
Can some one guide me as to how I can improve the code coverage...

I don't think anyone needs VF page as the problem is with test class and the controller. 
 APEX CLASS :
 
public with sharing class URLMonthlySearchController {
	 
    public URL_Monthly_Activity__c usr {get; set;}
     
    public List<URL_Monthly_Activity__c> AllGIDs
    {
        get
        {
            if(con != null)
                return (List<URL_Monthly_Activity__c>)con.getRecords();
            else
                return null ;
        }
        set;
    } 
    
    //Controller
    public URLMonthlySearchController()
    {
        AllGIDs = new List<URL_Monthly_Activity__c>() ;
        usr = new URL_Monthly_Activity__c() ;
    }
    
    //Instantiate the StandardSetController
    public ApexPages.StandardSetController con{get; set;}
    
    public PageReference Search()
    {   
        if(usr.GID__c != null && usr.Month__c != null && usr.Year__c != null)
        {
            con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id ,GID__c, Month__c, Year__c,Total_Article_Creates__c, 
                                                                                Total_Compliant_Article_Creates__c,  Total_Article_Updates__c, 
                                                                                Total_Compliant_Article_Updates__c, Total_Newsletter_Creates__c, 
                                                                                Total_Compliant_Newsletter_Creates__c, GAPageviews__c, URL__c  
                                                                                FROM URL_Monthly_Activity__c 
                                                                                WHERE ( URL_Monthly_Activity__c.GID__c =: usr.GID__c AND URL_Monthly_Activity__c.Month__c =: usr.Month__c AND URL_Monthly_Activity__c.Year__c =: usr.Year__c)]));
 
            // sets the number of records in each page set
            con.setPageSize(50);
        }
        else
        {
            con = null;
        }
        return null ;
    }
    
     public PageReference Cancel()
    { 
        return new PageReference('/home/home.jsp');
    }   
        
    
    //Boolean to check if there are more records after the present displaying records
    public Boolean hasNext
    {
        get
        {
            return con.getHasNext();
        }
        set;
    }
 
    //Boolean to check if there are more records before the present displaying records
    public Boolean hasPrevious
    {
        get
        {
            return con.getHasPrevious();
        }
        set;
    }
 
    //Page number of the current displaying records
    public Integer pageNumber
    {
        get
        {
            return con.getPageNumber();
        }
        set;
    }

    //Returns the previous page of records
    public void previous()
    {
        con.previous();
    }
 
    //Returns the next page of records
    public void next()
    {
        con.next();
    }
}

TEST CLASS :
 
@isTest
public class URLMonthlySearchController_Test {
    
    public static testMethod void testPage(){
        
        PageReference pageRef = Page.URLMonthlySearch;
        Test.setCurrentPage(pageRef);
      
        //ApexPages.StandardSetController pageController = new ApexPages.StandardSetController();
        
        URLMonthlySearchController controller = new URLMonthlySearchController();
        //List<URL_Monthly_Activity__c> urlMon = controller.search();
        
        controller.search();
        
    }
}

Any help is appreciated.
Thanks! ​
Hello,
I have the below async class  and its test.
What I failing with is how to cover test percentage for Messaging.SingleEmailMessage Invocation when callout fails..
I have already gone through multiple links on stack exchange and Apex forum, tried some approaches but none worked for me.
Can some one please assist in what I may be doing wrong here.
Code coverage under SUCCESS is 78% while under FAILURE is 24%.
 
public class DeleteExpertInSelene {
	//method to be invoked by ProcessBuilder apex
    @InvocableMethod
    public static void deleteAccountInSelene(List<Id> acctIds){
        Account acc = [SELECT Selene_ID__c FROM Account WHERE Id = :acctIds[0]];   
        System.enqueueJob(new QueueableSeleneCall(acc.Selene_ID__c, acc.Id));
    }
    
    // future method to make delete experts
    @Future(callout=true)
    private static void deleteToSelene(Decimal userId, Id acctId) {				 
        List<String> EMAIL_RESULTS = new List<String>{System.Label.Email_Selene_List};
        List<String> EMAIL_RESULTS_2 = new List<String>{System.Label.Email_Selene_List_2};
        String tokenVar = '';
        tokenVar = 'Token '+GetSeleneID.getAuthorizationToken();
        HTTPRequest req = new HTTPRequest();
        req.setEndPoint('some api'+ userId);     
        req.setMethod('DELETE');
        req.setHeader('authorization',tokenVar);
        req.setHeader('Accept','application/json;charset=UTF-8');
        req.setHeader('Content-Type', 'application/json;charset=UTF-8'); 
        req.setHeader('Cache-Control', 'no-cache'); 
        req.setHeader('x-api-key', 'some key');
        req.setTimeout(120000);                                         
        HTTP http = new HTTP();
        HTTPResponse res = http.send(req);
        
        if(res.getStatusCode() != 200){
            System.debug('Failure: ' + res.getStatusCode() + ' ' + res.getStatus());
            // Send email
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            mail.setToAddresses(EMAIL_RESULTS);
            mail.setCcAddresses(EMAIL_RESULTS_2);
            mail.setSenderDisplayName('Salesforce Administrator');
            mail.setSubject('Delete To Selene Failed ');
            mail.setPlainTextBody('some mssg');
            Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{mail});
        } else {
            if(res.getStatusCode() == 200){
                System.debug('Success: ' + res.getBody() + ' ' + res.getStatus());
        }
        
    }
           
 }   
    //queueable class to enque the put request
    class QueueableSeleneCall implements System.Queueable, Database.AllowsCallouts {
        private Decimal seleneId;
        private String Id;
        public QueueableSeleneCall(Decimal userId, Id acctId){             
            this.seleneId = userId;
            this.Id = acctId;
        }
        public void execute(QueueableContext context) {
            deleteToSelene(seleneId, Id);                               
        }
    }
}

Test Class...
@isTest
public class DeleteExpertInSelene_Test {
	  @testSetup static void testSetupdata(){
        //create the account record
        Account acc1 = new Account();
        acc1.Name = 'ABC Corp1';
        acc1.Email__c = 'test@testmail.com';
        acc1.Phone = '5554446767';
        acc1.Legacy_GID__c = '54321';
        acc1.Display_Name__c = 'abc1';
        acc1.Status__c = 'Live';
        acc1.Selene_ID__c = 112233445.00;
        insert acc1;
        //create the account record
        Account acc2 = new Account();
        acc2.Name = 'ABC Corp2';
        acc2.Email__c = 'testmail@test.com';
        acc2.Phone = '6665554343';
        acc2.Legacy_GID__c = '12345';
        acc2.Display_Name__c = 'abc2';
        acc2.Status__c = 'Live';
        acc2.Selene_ID__c = 112233446.00;
        insert acc2;
    
  }
  
       
  @isTest static void testPostCalloutSuccess() {
      Account acc = [Select Id, Name FROM Account WHERE Name = 'ABC Corp1' Limit 1];
      List<Id> accList = new List<Id>();
      accList.add(acc.Id);
      System.assertEquals('ABC Corp1', acc.Name);
      System.assertEquals(1,accList.size());
      // Set mock callout class 
      Test.setMock(HttpCalloutMock.class, new SeleneCalloutMockService()); 
      // This causes a fake response to be sent
      // from the class that implements HttpCalloutMock. 
      
      Test.startTest();
      DeleteExpertInSelene.deleteAccountInSelene(accList);
      //Integer invocations = Limits.getEmailInvocations();
      Test.stopTest(); 
      
      
      // Verify that the response received contains fake values        
      acc = [select Selene_ID__c from Account where id =: acc.Id];
      System.assertEquals(112233445.00,acc.Selene_ID__c);
      
    }
    
    @isTest static void testPostCalloutFailure() {
        Account acc = [Select Id, Name FROM Account WHERE Name = 'ABC Corp2' Limit 1];
        List<Id> accList = new List<Id>();
        accList.add(acc.Id);
        System.assertEquals('ABC Corp2', acc.Name);
        System.assertEquals(1,accList.size());  
        
        // Set mock callout class
        Test.setMock(HttpCalloutMock.class, new SeleneCalloutMockService()); 
        // This causes a fake response to be sent
        // from the class that implements HttpCalloutMock. 
        Test.startTest();
        DeleteExpertInSelene.deleteAccountInSelene(accList);
        Integer invocations = Limits.getEmailInvocations();
        Test.stopTest();        
        // Verify that the response received contains fake values        
        acc = [select Selene_ID__c from Account where id =: acc.Id];
        System.assertEquals(112233446.00,acc.Selene_ID__c);
        System.assertEquals(1, invocations, 'An email should be sent');
    }  
    
}
Any help is appreciated.
Thanks!


Hi,
Picklist value is not showing whenever i insert through data loader,Please anyone can help me
#dataManagement
#dataloader
Thanks
Did anything change in Salesforce over the weekend? Across all of our Apex Call Outs we are now getting this error:

System.CalloutException: Read timed out

Could this be associated with the new TLS requirements? Anyone else experiencing something like this? 

Thanks,
Ricky 
I am trying to insert a custom object from accounts, (in this case it is our prospects' current suppliers) into tasks.  That way, when our sales people pull up their tasks as they are making calls, they will automatically see who the current supplier is without having to look at the account.  I am new to salesforce but what I have gathered is that I need to create a trigger and use Apex?  Help!
We have encountered an issue that seems to have happened during a scheduled job but the debug logs were not running when the error occurred.  Would salesforce be able to send the logs for a certain timeframe for our environment?  Can I open a ticket to get that information?
In a visual force page, i want to create two section one for creating records for the object . As soon as I hit submit button In the second section of page record that got should get the display in a table. It should have at least 5 last record

I'd like to create a flow that our HR department can use for onboarding a new hire that creates a user account and configures settings such as assigning a managed package, setting a role, setting a profile, etc.

I haven't found a lot of information on this... is it even possible?
Hi ,

Can some one help me to write a trigger to prevent delete of all Account records and its supporting test class.
Doesn't matter who the user is (Sys Admin/Custom Profile/Read Only...etc), the user should not be able to delete the account record.
There cannot be any exception.

Any help is appreciate.
Thanks!
A