• Shweta Garg
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 18
    Replies
Hello  developers,

I am working on a visualforce page In which I need a beep sound after record creation.I Have stored an audio soud in static resource and using audio.play() method of javascript . It is woring in Android phones.
But It is not working in IPAD.

Please  let me know any workaround for this problem?

Thank,
Shweta

 
Hello All,

I am building a mobile application for chatter using lightning web component. whenever a  new message comes,it should appear in chatting box.
I was implementing it through platform events and lightning.empApi module to get the latest message on chatbox.

This is working in desktop not in mobile phone.
Is lightning/empApi module supported in mobile phone?
OR is there any other workaround ?
Please help.

Thanks,
Shweta

 
Hi All,

I am sending file data from controller to javasctipt remoting method and File data  size is 8 MB.But It still show remoting response size exceeded maximum of 15 MB.
This is really needded in my project.
Could you please help me.

Thanks,
Shweta
Hi All,

Our requirement is zipping multiple CSV files together and send the ZIP file to external system.For which We are using ZIPPEX open source library(https://github.com/pdalcol/Zippex)

Approach:
We are writing a batch program which will create CSV file and save it to documents.another batch will fetch CSV files from documents and zip them together.But It is causing CPU Limit exceeded or heap size exceeded for large file (say 5 MB).
Can you please suggest a workaround to do this  via apex?
Hello,
I have a requirement to send ZIP file containing multiple CSV files.I am using Zippes library to cerate ZIP file in apex.
Here is the code.
Blob exceldata;
Zippex sampleZip = new Zippex();
sampleZip.addFile('rooms.csv', exceldata, null);

Blob zipBlob = sampleZip.getZipArchive();

Document newdoc = new Document();               
newdoc.Name = 'Roomtest'+'.zip';
newdoc.FolderId = UserInfo.getUserId();
newdoc.Body = zipBlob;
newdoc.ContentType = 'application/x-zip-compressed;charset=UTF-8';
insert newdoc;
This rooms.csv file contains some bold charcters and Japanese charcters .But When I downloaded the document ,bold and  japanese charcters are not showing properly.

Is there any way to define the file type of CSV file inside ZIP file ?How can we display japanese or bold charcaters properly in th CSV file inside  ZIP ?Please help.

Thanks in advance.



 
Hi,

I have to save mutilselect picklist values in any required Order .So i created visualforce component and added up and down buttton so that picklist values can be ordered.
User-added image
But When I am going to save the selected values in selected order .It does not save into the selected while it gets saved into default order.
let us suppose. I have defined this order( Name,Phone,Address ) in multipicklist but values are stored into the default order  i.e,(name,address,phone)
Default order : order in which picklist values are defined in the field.

Anyone know the workaround this?

Thanks,
Shweta
Hello Developers,

I am trying to delete report using metadata API. My code is working fine in one org.But when I move my code into client;s ORg.It did not work.
I checked my debug  logs and found this error messaage. "message=In field: members - no Report named Custom_Folder/Report1 found".
Custom_Folder is the folder developer name and Report1is the report developer name.They both exist in my org.
I also checked the permission of folder. I have given Read/Write access to folder. But Still metadata API cound not read the Report.
Is the issue related to permissions or is there any other  thing going wrong?

I am in urgent need . Please help me.


Thanks,
Shweta

 
Hello Developers,

While calling webservice from Salesforce Org,I am getting an Exception "System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 ".I have made a lot of search and found that This is a Firewall issue.
I have added these IP ranges in my Salesforce Org.

204.14.232.0/23 East Coast Data Center (set one)
204.14.237.0/24 East Coast Data Center (set two)
96.43.144.0/22  MidWest Data Centers
96.43.148.0/22  MidWest Data Centers
204.14.234.0/23 West Coast Data Center (set one)
204.14.238.0/23 West Coast Data Center (set two)
182.50.76.0/22  Japan Data Center

here 204.14.232.0/23 .->  204.14.232.0 - 204.14.233.255
I have added the IP address Like this. But Still I am getting the same issue. I suspect  these ip address should be added at the server side(where web service resides)?Am I right. Or i am doing mistake while adding IP address.
Please suggest me with your ideas.











 
Hello,
I need to parse JSON content. i think there are three ways to parse JSON.
1. Using deserialize method
2. JSON Parser is another solution.
3. using split method of String..

I want to use Deserialize method because it is very easy to maintain and fast too.
This is my JSON content that I want to parse.
{"size" : 391,"totalSize" : 391,"done" : true,"queryLocator" : null,"entityTypeName" : "Layout","records" : [ {"attributes" : {"type" : "Layout","url" : "/services/data/v34.0/tooling/sobjects/Layout/00h28000006RG0VAAW" },"FullName" : "Account-Account %28Marketing%29 Layout","Metadata" : {"customButtons" : null,"customConsoleComponents" : null,"emailDefault" : false,"excludeButtons" : null,"feedLayout" : null, "headers" : [ "PersonalTagging", "PublicTagging" ],"layoutSections" : [ {"customLabel" : false,"detailHeading" : false,"editHeading" : true,"label" : "Account Information","layoutColumns" : [ { "layoutItems" : [ {"analyticsCloudComponent" : null,"behavior" : "Edit","canvas" : null,"component" : null, "customLink" : null,"emptySpace" : null,"field" : "OwnerId","height" : null,"page" : null,"reportChartComponent" : null,"scontrol" : null,"showLabel" : null,"showScrollbars" : null,"width" : null} ],"reserved" : null}], "style" : "TwoColumnsTopToBottom"}],"relatedLists" : [ {"customButtons" : [ ],"excludeButtons" : [ ],"fields" : [ "FULL_NAME", "CONTACT.TITLE", "CONTACT.EMAIL", "CONTACT.PHONE1" ],"relatedList" : "RelatedContactList","sortField" : null,"sortOrder" : null}], "relatedObjects" : [ "ParentId" ],"runAssignmentRulesDefault" : false,"showEmailCheckbox" : true,"showHighlightsPanel" : false,"showInteractionLogPanel" : false,"showKnowledgeComponent" : null,"showRunAssignmentRulesCheckbox" : true,"showSolutionSection" : null,"showSubmitAndAttachButton" : false,"summaryLayout" : null,"urls" : null,"quickActionList" : {"quickActionListItems" : [ {"quickActionName" : "FeedItem.QuestionPost"}]},"relatedContent" : {"relatedContentItems" : [ {"layoutItem" : {"analyticsCloudComponent" : null,"behavior" : null,"canvas" : null,"component" : "runtime_sales_social:socialPanel","customLink" : null,"emptySpace" : null,"field" : null,"height" : null,"page" : null,"reportChartComponent": null,"scontrol" : null,"showLabel" : null,"showScrollbars" : null,"width" : null}} ]}, "miniLayout" : null,"multilineLayoutFields" : null,"platformActionList" : null}}]}'

I need to find fields from JSON content.  field is inside Layout sections.I have to go  three levels deep for reaching exactly at field.
If I adopt that  first Way i.e, Desrialize , I will stuck in for loops. I will had to use for loop 4 times(for inside for).
JSON Parser is pretty tedious way to use. should i use JSON PArsermethods?Will It make processing slow.
and Splitting the Json String does not seem to good way to implement.

Please suggest me. Is thery any workaround to escape from 4 for loops while using desilization method.If No, What way should I use?
Please help me . I am confused.

Thanks and Regards.


 
Hi All,

I have a requirement to retrieve metadata of all workflows, validation rules and flows using Tooling API. There is a limitation with Tooling API that we can not query metadata field when query returns more than one record. Mentioned in Force.com Tooling api doc-"Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance."
Because of this limitation I have to make callout for each workflows(validation or flows) one by one present in an org. So, if there are 1000 workflows then I will have to make 1000 callouts to retrieve metadata. This sometimes hits our org's API request limit and also increases processing time.

Is there any way to get metadata of multiple workflow rules in single callout.
Please suggest me. 

Thanks,
Shweta
 
Hi All,

I have created a Lightning component. It is all working fine in Lightning experience.But When I run the same component in Salesforce1 using  Quick action. $A.get('e.force:refreshView') event  is not working in Salesforce1.While,In documents , It is written that the event work in salesforce1 too.

Please suggest.Any help is much appreciated.
Thanks,
Shweta



Thanks,
Shweta
Hi all,
I want  to open a pdf on clicking custom button in another tab. I used Window.open method in onclick javascript.It was working fine but now I also need to increment  a field also on clicking button . Here is the code sample.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} 
var ID = "{!Quote.Id}"; 
var quoteobj = new sforce.SObject("Quote"); 
quoteobj.Id = '{!Quote.Id}'; 
quoteobj.ZT_PDF_Version__c = {!Quote.ZT_PDF_Version__c } + 1; 
var res = sforce.connection.update([quoteobj]); 
//window.location.reload(); 


window.location = '/apex/Generate_PDF?id='+ID;

But it is opening on the same tab. But customer wants to open a pdf in Another tab.
Window.open in not working when used with code (incrementing field).

Thanks for the help in advance.

Thanks,
Shweta
Hi All,

I need to transfer leads with attachments from one org to another org. I am using Salesforce to Salesforce connection.
User-added image

I have reached at stage . but Lead is being inserted in another org but not attchment. I have seen "Share with Connections" checkbox in attachment. When i add the attachment in the lead for the first time."Share with Connections" checkbox is not there in attachment. Since checkbox is false initially, Is this the reason for not adding attachment? IF yes, How to make  this checkbox true.
Any other workaround for this problem?
I have tried a lot but could not find anything.Please help me.
Hi All,

There is on entitlement pocess in which milestone time trigger value is calculated from AP02_MilestoneTimeCalculator.
On updating the case , I am getting an error on case detail Page.  Error:The time trigger value calculated by the Apex class "AP02_MilestoneTimeCalculator" must be a positive integer.

Milestone time is calculated in  "AP02_MilestoneTimeCalculator" class . Whenever It calculates the value either zero or negative. I am getting this error.
Does this mean Milestone time trigger value is always  greater than zero or something else?This error is due to some other reason?I am confused.Please help me.

Thanks,
 
Hello All,

I am having one requirement. I just want to navigate to the URL on clicking button In Lightning experience using quick actions,global actions or custom button Url either. Is thery any way through which i can achive this.

Please help me.

thanks,
 
Hi All,

I created one Lightning component and use that component on vfpage.There is one button in lightning component. I just want to refresh the Page on button click.I have used force:refreshView and Window.reload(). But nothing seems to work.

Any help is much appreciated
Thanks,

 
Hello All,

I have changed google chrome language settings from english to French.from then String methods in my apex class are not working properly.
Here is my code sample.
for(String s:valuearray){
            String s9 = s;
            system.debug('startvalue!!'+s+'******'+s.remove(' ')+'!!!!'+s.deleteWhitespace()+'@@@'+s.replace(' ',''));

  String sx = '675 75 56454 ';
            System.debug('testing!!'+sx.remove(' '));

}

here valuearray is the list of semicolon separated string .for example(4567 89 0;Q1).I need to remove space from it.I tried all these methods remove,deletewhitespace and replace. but no method  is working.and this is strange when  i am hardcoding the value.String methods are working.

Please help me.

Thanks,

 
Hi All,

I want to override edit button on Case detail Page as i wanted to hide the portal if i override the button it gets hide on Portal. for overriding i used standard controller with extension and on action of the page,this code is being executed.
 
PageReference p1 =new PageReference ('/500/e?nooverride=1&cas15='+record.Description+'&cas14='+record.Subject+'&00N4E000000cT43='+record.Z_Unknown_SN__c);
        p1.setRedirect(true);
        return p1;

If i use this method.I have to override every field on case detail Page and custom field id also varies from sandbox to Production.
What is the best solution for it.
Do i need to craete a separate vfpage for it?
I am confused .Please help me out.
Hi All,

I have created a visualforce email template.I need to show T_Last_External_Post__c (field in  Case object) on email template with line break.
Here is my code.
 
<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Case"> <messaging:htmlEmailBody > <html> <body> <apex:outputText value="{!SUBSTITUTE(SUBSTITUTE(JSENCODE(relatedTo.T_Last_External_Post__c), '\r\n', '\n'),'\n','<br/>')}" style="white-space:pre;" /> </body> </html> </messaging:htmlEmailBody> </messaging:emailTemplate>


but it not working .
any help is much appreciated.
Hi All,

How to show Long text area field with Line breaks in email template
thanks.
Hello All,

I am building a mobile application for chatter using lightning web component. whenever a  new message comes,it should appear in chatting box.
I was implementing it through platform events and lightning.empApi module to get the latest message on chatbox.

This is working in desktop not in mobile phone.
Is lightning/empApi module supported in mobile phone?
OR is there any other workaround ?
Please help.

Thanks,
Shweta

 
Hello,
I have a requirement to send ZIP file containing multiple CSV files.I am using Zippes library to cerate ZIP file in apex.
Here is the code.
Blob exceldata;
Zippex sampleZip = new Zippex();
sampleZip.addFile('rooms.csv', exceldata, null);

Blob zipBlob = sampleZip.getZipArchive();

Document newdoc = new Document();               
newdoc.Name = 'Roomtest'+'.zip';
newdoc.FolderId = UserInfo.getUserId();
newdoc.Body = zipBlob;
newdoc.ContentType = 'application/x-zip-compressed;charset=UTF-8';
insert newdoc;
This rooms.csv file contains some bold charcters and Japanese charcters .But When I downloaded the document ,bold and  japanese charcters are not showing properly.

Is there any way to define the file type of CSV file inside ZIP file ?How can we display japanese or bold charcaters properly in th CSV file inside  ZIP ?Please help.

Thanks in advance.



 
Hi All,

I have created multiple checkbox from selectoption. Now I want to submit the form and filter record based on selected checkbox.

Visualforce code:
 
<apex:selectCheckboxes value="{!checkboxSelections}" >
  <apex:selectOptions value="{!MyCheckboxes}"  >
     <apex:actionSupport event="onclick" action="{!getSelectedOrder}" /> 
  </apex:selectOptions>
</apex:selectCheckboxes>
APex code:
 
public PageReference getSelectedOrder() {
     system.debug('yadav');
     return null;
}

public list<string> checkboxSelections {get;set;}  //holds the values of the selected checkboxes

public list<selectOption> getMyCheckboxes(){
    system.debug('rohiatsh');
    //create list of checkboxes
    list<selectOption> myOptions = new list<selectOption>();
    for(integer i=0;i<5;i++){
    myOptions.add(new selectOption(string.valueof(i),string.valueof(i)));
     } 
    return myOptions;
 }


When I click on any chekbox then getSelectedOrder is not getting called. Can anyone help me.
Hello,
I need to parse JSON content. i think there are three ways to parse JSON.
1. Using deserialize method
2. JSON Parser is another solution.
3. using split method of String..

I want to use Deserialize method because it is very easy to maintain and fast too.
This is my JSON content that I want to parse.
{"size" : 391,"totalSize" : 391,"done" : true,"queryLocator" : null,"entityTypeName" : "Layout","records" : [ {"attributes" : {"type" : "Layout","url" : "/services/data/v34.0/tooling/sobjects/Layout/00h28000006RG0VAAW" },"FullName" : "Account-Account %28Marketing%29 Layout","Metadata" : {"customButtons" : null,"customConsoleComponents" : null,"emailDefault" : false,"excludeButtons" : null,"feedLayout" : null, "headers" : [ "PersonalTagging", "PublicTagging" ],"layoutSections" : [ {"customLabel" : false,"detailHeading" : false,"editHeading" : true,"label" : "Account Information","layoutColumns" : [ { "layoutItems" : [ {"analyticsCloudComponent" : null,"behavior" : "Edit","canvas" : null,"component" : null, "customLink" : null,"emptySpace" : null,"field" : "OwnerId","height" : null,"page" : null,"reportChartComponent" : null,"scontrol" : null,"showLabel" : null,"showScrollbars" : null,"width" : null} ],"reserved" : null}], "style" : "TwoColumnsTopToBottom"}],"relatedLists" : [ {"customButtons" : [ ],"excludeButtons" : [ ],"fields" : [ "FULL_NAME", "CONTACT.TITLE", "CONTACT.EMAIL", "CONTACT.PHONE1" ],"relatedList" : "RelatedContactList","sortField" : null,"sortOrder" : null}], "relatedObjects" : [ "ParentId" ],"runAssignmentRulesDefault" : false,"showEmailCheckbox" : true,"showHighlightsPanel" : false,"showInteractionLogPanel" : false,"showKnowledgeComponent" : null,"showRunAssignmentRulesCheckbox" : true,"showSolutionSection" : null,"showSubmitAndAttachButton" : false,"summaryLayout" : null,"urls" : null,"quickActionList" : {"quickActionListItems" : [ {"quickActionName" : "FeedItem.QuestionPost"}]},"relatedContent" : {"relatedContentItems" : [ {"layoutItem" : {"analyticsCloudComponent" : null,"behavior" : null,"canvas" : null,"component" : "runtime_sales_social:socialPanel","customLink" : null,"emptySpace" : null,"field" : null,"height" : null,"page" : null,"reportChartComponent": null,"scontrol" : null,"showLabel" : null,"showScrollbars" : null,"width" : null}} ]}, "miniLayout" : null,"multilineLayoutFields" : null,"platformActionList" : null}}]}'

I need to find fields from JSON content.  field is inside Layout sections.I have to go  three levels deep for reaching exactly at field.
If I adopt that  first Way i.e, Desrialize , I will stuck in for loops. I will had to use for loop 4 times(for inside for).
JSON Parser is pretty tedious way to use. should i use JSON PArsermethods?Will It make processing slow.
and Splitting the Json String does not seem to good way to implement.

Please suggest me. Is thery any workaround to escape from 4 for loops while using desilization method.If No, What way should I use?
Please help me . I am confused.

Thanks and Regards.


 
Hi all,
I want  to open a pdf on clicking custom button in another tab. I used Window.open method in onclick javascript.It was working fine but now I also need to increment  a field also on clicking button . Here is the code sample.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} 
var ID = "{!Quote.Id}"; 
var quoteobj = new sforce.SObject("Quote"); 
quoteobj.Id = '{!Quote.Id}'; 
quoteobj.ZT_PDF_Version__c = {!Quote.ZT_PDF_Version__c } + 1; 
var res = sforce.connection.update([quoteobj]); 
//window.location.reload(); 


window.location = '/apex/Generate_PDF?id='+ID;

But it is opening on the same tab. But customer wants to open a pdf in Another tab.
Window.open in not working when used with code (incrementing field).

Thanks for the help in advance.

Thanks,
Shweta
Hello All,

I am having one requirement. I just want to navigate to the URL on clicking button In Lightning experience using quick actions,global actions or custom button Url either. Is thery any way through which i can achive this.

Please help me.

thanks,
 
Hello All,

I have changed google chrome language settings from english to French.from then String methods in my apex class are not working properly.
Here is my code sample.
for(String s:valuearray){
            String s9 = s;
            system.debug('startvalue!!'+s+'******'+s.remove(' ')+'!!!!'+s.deleteWhitespace()+'@@@'+s.replace(' ',''));

  String sx = '675 75 56454 ';
            System.debug('testing!!'+sx.remove(' '));

}

here valuearray is the list of semicolon separated string .for example(4567 89 0;Q1).I need to remove space from it.I tried all these methods remove,deletewhitespace and replace. but no method  is working.and this is strange when  i am hardcoding the value.String methods are working.

Please help me.

Thanks,

 
Hi All,

How to show Long text area field with Line breaks in email template
thanks.
Hi All,

Lets say a field is given. that field can be used in entry criteria of approval process.I just want to find those approval process where the given field is being used in entry criteria of approval process?

Any help is much appreciated.

 
Hi,
I have created a Picklist field(Application) which is depndent on another picklist (Vertical) . I have provided the values using dependency matrix.values in Picklist are showing in Preview Format.
Here is the snapshot.
User-added image

But one thing i could not figer out values are showing correctly in preview format but not when I am creating an object and choosing picklist field value. values are not appearing.
User-added image
Please help me out.
thanks in advance
 
Hi

I am facing the issue while deploying the test class in production. The test class is working fine in sandbox but failing in production
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: PricebookEntryId (pricebook entry is in a different pricebook than the one assigned to the opportunity): [PricebookEntryId] 
Here is my code
 
@isTest
public class CopytoOppLineItemTest{
    
     @isTest static void testTrigger(){
          
         Id pricebookId = Test.getStandardPricebookId();
         //Pricebook2  pb = [select name,id from Pricebook2 where  IsStandard =true  LIMIT 1];
         
        system.debug('pricebookId !!'+pricebookId );
        
         Product2 prod = new Product2(
             Name = 'Product X',
             ProductCode = 'Pro-X',
             isActive = true
        );
        insert prod;

        //Create your pricebook entry
        PricebookEntry pbEntry = new PricebookEntry(
             Pricebook2Id =  pricebookId ,
             Product2Id = prod.Id,
             UnitPrice = 100.00,
             IsActive = true
        );
        insert pbEntry;
        
      
         
        Opportunity op = new Opportunity();
        op.name = 'test';
        op.closedate = Date.today();
        op.StageName = 'Init';
        op.pricebook2Id  = pricebookId   ;
        insert op;
        system.debug('op.pricebook2Id!!!!'+op.pricebook2Id+'pbEntry.Pricebook2Id !!!'+pbEntry.Pricebook2Id);
        
         OpportunityLineItem  ol = new OpportunityLineItem();
         ol.opportunityid = op.id;
         ol.quantity = 4;       
         ol.TotalPrice = ol.quantity * pbEntry.UnitPrice ;
         ol.PricebookEntryId = pbEntry.id ;
        
         insert ol;
         
     }
    


}

I have also checked the values in debug in production, the value of opportunity pricebookid and pricebookentry pricebookid are the same(system.debug('op.pricebook2Id!!!!'+op.pricebook2Id+'pbEntry.Pricebook2Id !!!'+pbEntry.Pricebook2Id);)

Please help me on this issue.
I have two rich text fields in user object which holds two images in it. I want to build an email template(custom or VF template) to display those two rich text fields in it and when I send an email using that template, those two images need to be displayed. it is an urgent requirement. Please help. Thanks in advance.

How can we split an address field(text area) into multiple lines. It shows in multiple lines. But when used in template will show all in one line.

 

Lets consider Billing Street. I am building a rich text area field where I need to display that field in a template. Now it is showing Billing Street in one line. I need to show them into mulitple lines.

 

I was using

String s = billingstreet.replaceAll('\r\n','<br/>');

String s = billingstreet.replaceAll('\n','<br/>');

 

Eg: 123 broad street <br/> headquarters of office

Even when i try this in rich text area its not displaying in seperate lines. Showing as same.

 

But nothing is working. Any Ideas!!!