• usersfdc21
  • NEWBIE
  • 70 Points
  • Member since 2015
  • TechMegha

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 32
    Replies
I created a private report folder and shared only to 1 user A, however when I used my Admin login to login as a regular user, says User B, this user B can see private report folder of user A.
PLease tell me where to fix, the user A and user B are 2 different profiles and different roles.
thanks a lot
Hi guys,

I have created Rest API to integrate Salesforce with banking system.
I am facing problem with HmacSha256 encryption. I am using as below:

Blob blobSign = Crypto.generateMac('Hmac-SHA256', Blob.valueOf(privKey + xmlOutput.length() + unixTime));
String HMACKey = EncodingUtil.base64Encode(blobSign);

I am getting error 403.

Any one know how to connect external system. 

Thanks in advance.
Hi everyone,

I need help in uploading 5MB video files in to AWS S3.
We have 4 batch jobs running. these batch jobs are running with the help of triggers. I got the below error and users are unable to edit lead or opportunity.
Error: System.LimitException: Attempted to enqueue too many concurrent batch jobs in org (limit is 100).
May I know how to resolve this issue.

Thanks in advance.
I have got two batch classes written for Integrating from SF to ActiveCampaign and need to execute one after the other.
May I know how to do it?
I have developed vf page to display grand totals for each user on vf page.
I am struck with fetching the users list in to vf page.
any help appreciated

Thanks in advance
I have a Custom Opportunity (Master) and child obj which have picklist values of 10. I created VF page to upload documents by selecting the picklist values. when ever I upload file, then it is saving in opportunity obj. 
1.) while uploading: when we selecting the picklist value, then upload file and click "Save & New" button, the picklist value is showing the value instead of "none".
2.) suppose I uploaded 4 docs out of 10 docs, the picklist value should show only 6 docs which are not attached. it is showing all the picklist values.
do any one understood my requirement, if so could you plz help me in this req.
Thanks in advance.

 
Hi Everyone,

I am using Enterprise Edition. I tried to load bulk data through data loader in to Dev salesforce. I have loaded 1500 Accounts and loaded fine.
we have Custom Lead. when I tried to create a new lead the following error was showing.
"Collection size 1,500 exceeds maximum size of 1,000".
I contacted SFDC Customer service, they told it is Visualforce page error.
could any one suggest how to solve this problem. as I have got 35000 records to load in Prod. wonder if the same problem may come in Prod.

Thanks in advance
 
not able to migrate my javascript button in lightning experience. please help me to convert the below button. I am new to Lightning. current onclick javascript action: window.location.href ='/apex/RequestType?&id={!Opportunity.Id}';
Looking for an end to end website developer, experienced with Salesforce integrations, to help build website for a small company.  Opportunity for additional projects at a later date.
I created a private report folder and shared only to 1 user A, however when I used my Admin login to login as a regular user, says User B, this user B can see private report folder of user A.
PLease tell me where to fix, the user A and user B are 2 different profiles and different roles.
thanks a lot
Hello ,
I am integrating Salesforce with my custom php website.And I am using curl to post leads in my account.
I am posting bulk leads on the salesforce. According to me 40 leads shuold be posted and it is posting successfully as I got the responce .
BUT  the problem is that only 30 to 33 leads are displaying on salesforce leads listing
So my question is why all leads are not displaying???
Actually I have recently created account And this problem in these acconts
But  I have created an account  5 months before  In that all leads are displaying.

Please help me to resolve this thing so that I can continue my work with salesforce.
Regards
Amit
Hi, 

I want to change a field from  PICKLIST field to LookUp field..  Is it Possible? 
I was trying to enable Lightning on my salesforce account , and as I read from your trailhead website, that I should change "my Domain", but when I did that, it display this message for everything in my account : "An error has occurred in the following section: [Exception, DomainNotPropagated]. Salesforce.com has been notified of this error." and now I can't do any thing on the website and I can't solve it.
so what is the problem and how could I solve it.

I tried to contact support, but I couldn't even reach to contact page to open a case
please help
Hi

I have created a currency field but my requirment is format should be 4 decimal after point(12.98765).i have set (14,4),but it is showing 2 decimal when record saved.
Three Questions

How can I add the new notes back into LEADS
How can I copy Picklists from LEADS to ACCOUNTS
How do I Link LEADS fields to ACCOUNTS once converted
Hi guys,

I have created Rest API to integrate Salesforce with banking system.
I am facing problem with HmacSha256 encryption. I am using as below:

Blob blobSign = Crypto.generateMac('Hmac-SHA256', Blob.valueOf(privKey + xmlOutput.length() + unixTime));
String HMACKey = EncodingUtil.base64Encode(blobSign);

I am getting error 403.

Any one know how to connect external system. 

Thanks in advance.

HI ALl,

I have a requirement with Salesforce with Amazon server with S3 Integration. I need to upload the files and same time download the files or URL of file form Amazon to  Salesforce.

I have uploaded the file using PUT method. Response i m receiving is like only [Status=OK and Statuscode=200] successful
but i m not getting any other things like uploadid or URL of the file.

i need URL of the File uploaded in Salesforce. Help me out from this

Thanks,

Reddy


Hi every one,
    i have requirement for update grand parent field update when update happens in grand child object .how can we achieve this .
The object like A (grand parent) ,B (parent) ,C(grand child)
Please suggest me.



 
I am trying to connect to amazon MWS and fetch some report but ever time the API produces the same error  
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message>

THE CODE
Datetime now = Datetime.now().addDays(1);
    //String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'.'+now.formatGMT('SS')+'Z';
    String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'Z';
    DateTime start_dt = DateTime.newInstance(2014, 12, 16,15,21,30);
    DateTime end_dt = DateTime.newInstance(2014, 12, 18,14,17,21);
    //String start_date = start_dt.formatGmt('yyyy-MM-dd')+'T'+start_dt.formatGmt('HH:mm:ss')+'.'+start_dt.formatGMT('SS')+'Z';
    //String end_date = end_dt.formatGmt('yyyy-MM-dd')+'T'+end_dt.formatGmt('HH:mm:ss')+'.'+end_dt.formatGMT('SS')+'Z';
    String start_date = start_dt.formatGmt('yyyy-MM-dd')+'T'+start_dt.formatGmt('HH:mm:ss')+'Z';
    String end_date = end_dt.formatGmt('yyyy-MM-dd')+'T'+end_dt.formatGmt('HH:mm:ss')+'Z';

String request = 'AWSAccessKeyId='+urlencode('-***MY CODE*****-')+
            '&Action='+urlencode('RequestReport') +
            '&ReportType=' + urlencode( '_GET_MERCHANT_LISTINGS_DATA_')  +
            //'&StartDate=' + urlencode(start_date) +
            //'&EndDate=' + urlencode(end_date)+
            '&MWSAuthToken='+urlencode('-**** MY TOKEN******-')+
            //'&Marketplace='+urlencode('***ID***') +
            '&MarketplaceIdList.Id.1='+urlencode('-****ID*****-')+
            '&Merchant='+urlencode('-****ID*****-') +
            '&SignatureMethod='+urlencode('HmacSHA1') +
            '&SignatureVersion='+urlencode('2')+
            '&Timestamp=' + urlencode(timestamp) +                                                                            
            '&Version=' + urlencode('2009-01-01');


String canonical =  'GET'+'\n'+
                      'mws.amazonservices.ca\n'+
                      '/\n'+
                      request;
    String key = '-****KEY****-';
    
    //Signature HmacSHA256
    
    //Blob bsig = Crypto.generateMac('HMacSHA1', Blob.valueOf(canonical), Blob.valueOf(key));
    //Blob  b =Crypto.generateDigest('MD5',bsig );
    //Blob bsig =Crypto.generateDigest('HmacSHA256', Blob.valueOf(canonical), Blob.valueOf(key));
     //Blob bsig = Crypto.encryptWithManagedIV('AES256',  Blob.valueOf(key),Blob.valueOf(canonical));
    
    //String signature = EncodingUtil.base64encode(bsig);
    
        String c = EncodingUtil.base64Encode(Blob.valueOf(canonical));
        String signature ;
        String signingKey = EncodingUtil.base64Encode(Blob.valueOf(key));
        Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(c),blob.valueof(signingKey)); 
        signature = EncodingUtil.base64Encode(mac);                
        //return macUrl;
  
  
    System.debug('String to sign===>\n' + canonical );
    System.debug('Signature===>\n' + signature );

String body =request+'&Signature=' + urlEncode(signature);
   
   
   System.debug('canonical ===>\n' + canonical);
    System.debug('Body===>\n' + body );
   
   
        HttpRequest req = new HttpRequest();
        HttpResponse res = new HttpResponse();
        Http http = new Http();
        req.setCompressed(true);
        req.setHeader('Content-Type','text/xml');
         req.setHeader('User-Agent','Salesforce');
        req.setEndpoint('https://mws.amazonservices.ca/?'+body);
        req.setMethod('GET');
        //req.setBody(body);
           
           /*req.setHeader('Host','salesforce.com');
           req.setHeader('x-amazon-user-agent','cloud/1.0');*/
      
        res = http.send(req); 
  
   
   system.debug(res.getbody());
   
   
    return null;
    
    
    
    
    }

     private String urlEncode(String rawValue) {
        String value = (rawValue == null) ? '' : rawValue;
        String encoded = null;

        try {
            encoded = EncodingUtil.urlEncode(rawValue, 'UTF-8') 
                .replace('+', '%20')
                .replace('*', '%2A')
                .replace('%7E','~');
        } catch (Exception e) {
            //System.err.println("Unknown encoding: " + CHARACTER_ENCODING);
            //e.printStackTrace();
        }

        return encoded;
    }

I have done every possible altaration on Signing algo,Url encoding as there docs but all were invain...
I have this sample java code below that I need to translate into apex code for authentication. I already used the EncodingUtil and Crypto class to generate the password but I failed to connect to the service. The nonce parameter is a random generated string and the timeCreatedStr is a timestamp.

public static String getPasswordDigest(String nonce, String timeCreatedStr, String password) 
            throws UnsupportedEncodingException {
        
        ByteBuffer buf = ByteBuffer.allocate(1000);
        buf.put(Base64.decodeBase64(nonce));
        buf.put(timeCreatedStr.getBytes("UTF-8"));
        buf.put(password.getBytes("UTF-8"));
        byte[] toHash = new byte[buf.position()];
        buf.rewind();
        buf.get(toHash);
        
        System.out.println("@@@buf "+buf);
        
        byte[] hashSha256 = DigestUtils.sha256(toHash);
        String passwordDigestSha256 = Base64.encodeBase64String(hashSha256);
        return passwordDigestSha256;
    }
May I ask if there is a way to translate the above code into apex? May I know what is the use of the ByteBuffer? Is there any Bytebuffer class in apex?

Thank you!

My use case:

  • Sending demand letters to customers - single and mass
  • Custom objects: Payment_Schedule__c contains the amount to be paid/already paid amounts. Demand_Letter__c contains the body of the Demand Letter sent as well as its PDF attachment. Both are linked to Opportunity
  • User will send a Demand Letter by clicking on New button in Opportunity's related list - Single
  • User will send Demand Letter by selecting Opportunities and clicking Create Demand Letter button on Opportunity list view - Mass

Single sending works absolutely fine. Steps invlolved: 1. Create demand letter (name,Page1 content,Page2 content). 2. Save. 3. After saving on clicking Generate PDF button will display the contents - page1,page2 as well as pending payment in 3rd page. 4. If it looks fine, then send an email by attaching the pdf by clicking on Send Email button. DONE.

 

I am encountering problem with mass email. When there are more than 10 recipients(or Opportunities) selected, I receive System.LimitException: Too many Email Invocations: 11. Below is my code:

 

    public void sendAction() {
        try {
            showSendBtn = false;
            rtId = [select Id,name from RecordType where name='Demand Letter_After Sending' and SObjectType='Demand_Letter_Repository__c' limit 1].Id;
            if(! mass) {
                System.debug('### (DemandLetterEmailController) SINGLE. sendAction');
                sendAndAttach(dlObj);
                dlObj.RecordTypeId = rtId;
                update dlObj;
            }
            else {
                System.debug('### (DemandLetterEmailController) MASS. sendAction');
                System.debug('### (DemandLetterEmailController) lstDLR.size-inside sendAction: ' + lstDLR.size());
                //System.debug('### (DemandLetterEmailController) lstDLR-inside sendAction: ' + lstDLR);
                arrId.clear(); // arrId contains the opp ids. Hence clear all before re-using it for storing DLR's ids
                for(Demand_Letter_Repository__c dObj : lstDLR) {
                    arrId.add(dObj.Id);
                }
                lstDLR = [select Name,Opportunity__c,Page1__c,Page2__c,To__c,
                    CC__c,OwnerId,Opportunity__r.HFI__c,Opportunity__r.HFI__r.Email__c,
                    MassEmail__c,RecordTypeId from Demand_Letter_Repository__c 
                    where Id IN: arrId];
                System.debug('### (DemandLetterEmailController) after select.lstDLR.size-inside sendAction: ' + lstDLR.size());    
                for(Demand_Letter_Repository__c d : lstDLR) {
                    oId = String.valueOf(d.Opportunity__c).subString(0,15);
                    dId = String.valueOf(d.Id).subString(0,15);
                    //System.debug('### (DemandLetterEmailController) d-for loop: ' + d);
                    if(d.To__c !=null)
                        toAddresses = new String[]  { d.To__c } ;
                    else
                        toAddresses = null;
                    if(d.CC__c !=null) {
                        if(d.Opportunity__r.HFI__c !=null) {
                            System.debug('### (DemandLetterEmailController) inside d.Opportunity__r.HFI__c !=null');
                            if(d.Opportunity__r.HFI__r.Email__c != null) {
                                if(! d.CC__c.contains(d.Opportunity__r.HFI__r.Email__c)) {
                                    System.debug('### (DemandLetterEmailController)if ! d.CC__c.contains(d.Opportunity__r.HFI__r.Email__c)');
                                    d.CC__c = d.CC__c + ',' + d.Opportunity__r.HFI__r.Email__c;
                                }
                            }
                        }
                        ccAddresses = d.CC__c.split(',');
                    }
                    else
                        ccAddresses = null;
                    
                    sendAndAttach(d);
                    d.MassEmail__c = true;
                    d.RecordTypeId = rtId;
                }
                update lstDLR;
            }
            insert lstAtt;
            insert lstTask;
        }
        catch(Exception e) {
            System.debug('### (DemandLetterEmailController) Exception-sendAction: ' + e.getMessage());
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,e.getMessage()));            
        }
    }
    private void sendAndAttach(Demand_Letter_Repository__c dlr) {
        mail = new Messaging.SingleEmailMessage();
        System.debug('### (DemandLetterEmailController) dlr: ' + dlr);
        System.debug('### (DemandLetterEmailController) dId: ' + dId);
        System.debug('### (DemandLetterEmailController) oId: ' + oId);
        pdf = new PageReference('/apex/DemandLetterPDF?id=' + dId + '&oppId=' + oId + '&type=old');
        System.debug('### (DemandLetterEmailController) pdf: ' + pdf);
        pdf.setRedirect(true);
        
        // Take the PDF content
        if(test)  // Just to skip if called from test method
            b = null;
        else
            b = pdf.getContent();
                
        //Attach to Progress-**bleep**-Demand Letter Repository record
        lstAtt.add(new Attachment(parentId =dlr.Id,name=dlr.Name + '.pdf',body=b,OwnerId=dlr.OwnerId));
        System.debug('### (DemandLetterEmailController) lstAtt: ' + lstAtt);
        
        System.debug('### (DemandLetterEmailController) toAddresses: ' + toAddresses);
        if(toAddresses== null) {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,'Error while sending email - No TO address specified. *** A task has been created to take hard copy ***'));
            lstTask.add(new Task(Subject='Send Hard Copy',ActivityDate=System.Today(),Status='Not Started',
                                 WhatId=dlr.Id,Description='The customer does not have email specified. Send hard copy.',
                                 OwnerId = dlr.OwnerId,ReminderDateTime=System.Now(),IsReminderSet=true));
            return;
        }
        
        // Create the email attachment  
        efa = new Messaging.EmailFileAttachment();
        efa.setFileName(dlr.Name+'.pdf');
        efa.setBody(b);
        
        mail.setSubject(dlr.Name);
        //System.debug('### (DemandLetterEmailController) toAddresses: ' + toAddresses);
        mail.setToAddresses(toAddresses);
        mail.setCcAddresses(ccAddresses);
        mail.setPlainTextBody('Find attached demand letter.');
        mail.setHtmlBody('<div align="center"><h2><b>Demand Note</b></h2></div>'+
                     '<br/><br/><br/>'+
                     'Dear Sir/Madam,<br/><br/> Find attached demand letter.<br/><br/><br/>' +
                     'Regards,<br/>For Brigade Group.<br/>' +
                     'Date:' + String.valueOf(System.today()).subString(0,10));
        
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
        System.debug('### (DemandLetterEmailController) mail: ' + mail);
        r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
        for(Messaging.sendEmailResult result : r) {
            if(result.isSuccess()) {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Email Sent Successfully. To: ' + toAddresses + ' Cc: ' + ccAddresses));
                dlr.Sent_Date__c = System.Today();
            }
            else
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, 'Error while sending email. To: ' + toAddresses + ' Cc: ' + ccAddresses));
        }
        System.debug('### (DemandLetterEmailController) mail: ' + mail);
    }
}

 

Any help would be appreciated.

 

Hello

 

I have a field where a Full Name is entered - I need to split this into a First Name field and a Last Name field

 

I have created the fields - I need help on the formula

 

In many cases there are 4 entries

John abott-gacey

Mary Smith-Felch

Sam M. Wall

 

Thanks

 

Hello, all-

 

One of my field updates uses the TEXT(Date__c) function to convert the date into text.  It prints it in the YYYY-MM-DD format, though, which means it's the only date in our entire Salesforce system that is not in the MM-DD-YYYY format.

 

Is there a way to customize that within the formula editor?

 

You're all life-savers; thank you as always!