• Jagadeesh Angadi
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 3
    Replies
I know we can track VF pages in Google Analytics. But how can we track Salesforce standard tabs and pages? Below are the sample URLs for which I want to enable Google Analytics tracking. Please let me know if anyone has a solution for this.

https://mydomain.salesforce.com/001/o
https://mydomain.salesforce.com/006/o
I am trying to create a lookup to Territory on the Account object. But while creating a lookup field, I am not able to see the Territory object in "Related To" dropdown box. I am not able to see this on custom objects as well.

Am I missing something here or Salesforce not allows us to add Territory as lookup to other objects?

 
I am trying to export non-printable report into .XLSX format and send it to external users via email. Exporting to CSV works fine, but when I try to export the same with .XSLX format, I am getting the attachment either in corrupt state or an unformatted state.

Is it possible to export a report in .xslx format?

Below is my code snippet, I am trying out with different combinations of report URL and content type, but none of them worked. Please help if there is any way forword for this?
String reportId = '00O1700000*****';
String instanceName = System.URL.getSalesforceBaseUrl().toExternalForm();
string url=instanceName+'/'+reportId+'?excel=1'; // Not working
//string url=instanceName+'/'+reportId+'?export&xf=xls'; // Not working
//string url=instanceName+'/'+reportId+'?csv=1&isdtp=p1'; //Not working
ApexPages.PageReference report = new ApexPages.PageReference(url);
Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
List<Messaging.EmailFileAttachment> csvAttcList = new List<Messaging.EmailFileAttachment>();
Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
String mailBody = 'Please find the attachment for daily case report.';
csvAttc.setFileName('Daily Case Report.xlsx');
csvAttc.setBody(report.getContent());
csvAttc.setContentType('text/vnd.openxmlformats'); //Not working
//csvAttc.setContentType('text/csvs'); //Not working
//csvAttc.setContentType('application/vnd.ms-excel'); //Not working
csvAttcList.add(csvAttc);
email.setSubject('Daily Case Report on '+System.now());
List<String> toAddress = new List<String>();
toAddress.add('email@gmail.com');
email.setToAddresses( toAddress );
email.setPlainTextBody(mailBody);
email.setFileAttachments(csvAttcList);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

 
I have simple workflow with field update on Quote which executes when a quote is created, this workflow is not firing. 

I have set the log levels to finest still, I am not able to see Quote workfows being fired in log. In same transaction we are updating opportunity, I am able to see Opportunity workflows as "CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Opportunity" but the same kind of statements are not available for Quote object. Any suggestions?
I am trying to write a batch class to clone a quote along with quote line items. I am not able to clone a quote along with related quote line items. Can someone help on how to clone a quote along with related quote line items?
External system(RoR) trying to login to SFDC using connected app(username, Password, Client Id and client secret), but they are getting error saying that “Failed to open TCP connection to instance.salesforce.com:443 (No route to host - connect(2) for "instance.salesforce.com" port 443)“

Is this salesforce error? If yes, why salesforce is not allowing connection?

Below is my vf page line
<apex:inputtextarea html-maxlength="500" richText="true" styleClass="inputRichText"  id="inputRichText" value="{!some_Field__c}" />
html-maxlength is not working here, I mean text area excepting more than 500 characters. I guess html-maxlength attribute with richtext is not supported. Do we have any other options?
 
I have a private key with me, I have to decrypt a message using my private key with asymmetric RSA algorithm, Please help with the documentation or sample code on how to decrypt a message using asymmetric RSA.
I have batch class, basically it will query on account where Account_Status__c is empty(Account_Status__c='') then it will create contact for such accounts then Account.Account_Status__c will be updated to 'Contact Generated' so that same account will not be picked for next batch processing. This batch class is scheduled to run for every 5 minutes.
Now consider the example - First batch execution is started @ 10AM but it is not finished within 10.05AM(because number of batches to be processed is more hence it is taking much time to finish), then at 10.05 AM next set of batch processing will start. During second batch execution will system consider same records as in first execution(because first batch is not yet completed and Account_Status__c field is not yet updated on account). If yes, then it will create duplicate contacts for an account. Please clarify how to handle this issue? Please note that, I cannot increase the time interval between batch execution because of some reasons.
I have requirement where I have to read a CSV file. Using CSV file I have to insert a records in Salesforce after that I have to upload attachment in newly inserted records.
CSV File will be having data to create a records as well as file name and file path(from local drive).
I have managed to insert a records and upload the given file under Notes & Attachment section of the newly created records. But when I download the uploaded file it will show the error message that file is damaged, which means Im not reading the file properly that resulting in inserting damaged file in Notes & Attachment.
below is my piece of code, can any one help me in reading file path from csv and uploading the corresponding file in Salesforce?

Apex Controller which is used to insert a Attachment file: 
for(Integer rowCount = 0 ; rowCount < listOfRows.size() ; rowCount++){    //It will iterate through each row of CSV File
	List<String> row = listOfRows[rowCount];
	for(Integer docCount = rowCount ; docCount<docsAttachmentList.size() ; docCount++){ //It will iterate through newly created records, in which I have to Insert a file
		Documents_Attachments__c doc = docsAttachmentList[docCount];
		if(row[0] == doc.COPF_ID__c){
			Attachment attacmentRec = new Attachment();
			attacmentRec.ParentId = doc.Id;
			attacmentRec.Name = row[2];   //row[2] is a file name
			attacmentRec.ContentType=contentType; 
			attacmentRec.Body = Blob.valueOf(row[3]); //row[3] is a file path
			attachmentToInsertList.add(attacmentRec);
			break;
		}
	}
}
insert attachmentToInsertList;

VF Page :
<apex:page controller="BulkUploadAttachmentsController"> 
    <apex:form >
        <apex:sectionHeader title="Upload CSV File"/>
        <apex:pageBlock Title="CSV File Upload Section" >
            <apex:inputFile value="{!contentFile}" filename="{!nameFile}" contentType="{!contentType}" accept="csv"/>
            Select The Document type : <apex:selectList id="chooseColor" value="{!recordType}" size="1">
                <apex:selectOption itemValue="- None -" itemLabel="- None -"/>
                <apex:selectOption itemValue="Handover to PM" itemLabel="Handover to PM"/>
                <apex:selectOption itemValue="Handover to SS" itemLabel="Handover to SS"/>
            </apex:selectList> 
            <apex:pageBlockButtons location="Bottom" >
                  <apex:commandButton action="{!BulkUploadAttachmentsController}" value="Upload File"  id="theButton" style="width:70px;" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
I have simple workflow with field update on Quote which executes when a quote is created, this workflow is not firing. 

I have set the log levels to finest still, I am not able to see Quote workfows being fired in log. In same transaction we are updating opportunity, I am able to see Opportunity workflows as "CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Opportunity" but the same kind of statements are not available for Quote object. Any suggestions?

Below is my vf page line
<apex:inputtextarea html-maxlength="500" richText="true" styleClass="inputRichText"  id="inputRichText" value="{!some_Field__c}" />
html-maxlength is not working here, I mean text area excepting more than 500 characters. I guess html-maxlength attribute with richtext is not supported. Do we have any other options?
 
I have a private key with me, I have to decrypt a message using my private key with asymmetric RSA algorithm, Please help with the documentation or sample code on how to decrypt a message using asymmetric RSA.