• Simon Repar
  • NEWBIE
  • 65 Points
  • Member since 2014


  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies
Hello,
we are experiencing an code coverage problem on our production environment. Last week we deployed an change set without any issues and the code coverage was at 75%. 3 days later we tried to deploy an other change set, but this has failed do to code coverage error. The code coverage is now at 73%. The problem is, this change contains no code and is only an flow.
There were no changes to any code in those 3 days and no changes to validation rules or work-flows (checked via audit trail), all tests succeed, the only problem is in the coverage. We are generating our test data via factories and using seeAllData=false and aren't using any record in the org for testing.
The code coverage was at 75% at the time of the deployment of the first change set, it would not deploy otherwise. How is is possible, that it is only 73 now?
Classes recompiled, test history deleted, we get the 73% when deploying or running all tests(UI and IDE).

I have found this issue on the forums
https://success.salesforce.com/issues_view?id=a1p30000000T1m1AAC
and have checked the ApexCodeCoverageAggregate, but there is no problem.

I have even tried to validate an change set containing 600 lines of i++; (I know, ugly) and haven't got even 1% more coverage. We are currently using about 2M chars of code.

This is an blocker for us, any help would be appreciated.

Thanks.
Hi All,

I have a requirement to create a custom object name: Status__c


   and field is Staus_name__c    and picklist values for this Status Name__c are 

    1. Task
    2. email alert
    3. chatter post
    4. field update

    --> If task is selected then it should ask Start date, End Date, Assign task to whom
    --> If email alert is selected then it should ask Email template
    --> If Field Update is selected then it should ask field name
    --> If Chatter post is selected then it should ask post name.

Can you please write the VF and Apex Controller code for above task..

Thanks in Advance..
Hi everyone.

I know that it is possible to POST data (text) to VF page and than fetch them through ApexPages.getCurrentPage().getParameters(), but I didn't find a way to do the same if I POST a file and data is multipart/form-data encoded.

This is my piece of sample code:

VF page (page which receive a file after POST)
<apex:page controller="PostFile_Controller" sidebar="false" showheader="false"  applyBodyTag="false" applyHtmlTag="false" cache="false" action="{!react}">

</apex:page>
Controller:
public class PostFile_Controller {

    public PageReference react() {
	
		//get all parameters
		system.debug(ApexPages.currentPage().getParameters());
		
		//get all headers
		system.debug(ApexPages.currentPage().getHeaders());
	}	
}

VF page which POST a file (this is just an example, I actually use jquery file upload plugin (http://blueimp.github.io/jQuery-File-Upload/)):
var formData = new FormData($('form')[0]);
$.ajax({
	url: '/apex/postfile',  //Server script to process data
	type: 'POST',
	xhr: function() {  // Custom XMLHttpRequest
		var myXhr = $.ajaxSettings.xhr();
		return myXhr;
	},
	// Form data
	data: formData
});


Do you have any ideas what I am doing wrong or it is completely impossible to achieve that? 

Thank you.
Hi,

did anyone notice some strange behaviour of input fields (input type=text, textarea,..) in Visualforce pages. Keyboard just locks up ...
To reproduce this bug do the following:
1. Create custom VF page with <input type="text" /> and make VF accessible by SF1
2. Focus this input by doing "one tap"
3. Type text(to here, everything works normally)
4. Tap again on input or tap somewhere outside of virtual keyboard (e.g. on blank space), or try to scroll page.
5. Try to type some more text (focus has to be still in input field).

I've research that problem and it seems it is related to input fields which are inside iframe (this is limited just to iOS) and because Visualforce pages in Salesforce1 are placed inside iframe, that is the reason why it breaks.

I've read that Apple fixed this bug in iOS 8, but because Salesforce 1 probably doesn't use latest phonegap/cordova engine it isn't fixed yet. 

Did anybody notice the same problem and how did you resolve it?  

Bug reference: http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html (http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html)
Hi,

did anyone notice some strange behaviour of input fields (input type=text, textarea,..) in Visualforce pages. Keyboard just locks up ...
To reproduce this bug do the following:
1. Create custom VF page with <input type="text" /> and make VF accessible by SF1
2. Focus this input by doing "one tap"
3. Type text(to here, everything works normally)
4. Tap again on input or tap somewhere outside of virtual keyboard (e.g. on blank space), or try to scroll page.
5. Try to type some more text (focus has to be still in input field).

I've research that problem and it seems it is related to input fields which are inside iframe (this is limited just to iOS) and because Visualforce pages in Salesforce1 are placed inside iframe, that is the reason why it breaks.

I've read that Apple fixed this bug in iOS 8, but because Salesforce 1 probably doesn't use latest phonegap/cordova engine it isn't fixed yet. 

Did anybody notice the same problem and how did you resolve it?  

Bug reference: http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html (http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html)
Hi everyone.

I know that it is possible to POST data (text) to VF page and than fetch them through ApexPages.getCurrentPage().getParameters(), but I didn't find a way to do the same if I POST a file and data is multipart/form-data encoded.

This is my piece of sample code:

VF page (page which receive a file after POST)
<apex:page controller="PostFile_Controller" sidebar="false" showheader="false"  applyBodyTag="false" applyHtmlTag="false" cache="false" action="{!react}">

</apex:page>
Controller:
public class PostFile_Controller {

    public PageReference react() {
	
		//get all parameters
		system.debug(ApexPages.currentPage().getParameters());
		
		//get all headers
		system.debug(ApexPages.currentPage().getHeaders());
	}	
}

VF page which POST a file (this is just an example, I actually use jquery file upload plugin (http://blueimp.github.io/jQuery-File-Upload/)):
var formData = new FormData($('form')[0]);
$.ajax({
	url: '/apex/postfile',  //Server script to process data
	type: 'POST',
	xhr: function() {  // Custom XMLHttpRequest
		var myXhr = $.ajaxSettings.xhr();
		return myXhr;
	},
	// Form data
	data: formData
});


Do you have any ideas what I am doing wrong or it is completely impossible to achieve that? 

Thank you.
Hello,
we are experiencing an code coverage problem on our production environment. Last week we deployed an change set without any issues and the code coverage was at 75%. 3 days later we tried to deploy an other change set, but this has failed do to code coverage error. The code coverage is now at 73%. The problem is, this change contains no code and is only an flow.
There were no changes to any code in those 3 days and no changes to validation rules or work-flows (checked via audit trail), all tests succeed, the only problem is in the coverage. We are generating our test data via factories and using seeAllData=false and aren't using any record in the org for testing.
The code coverage was at 75% at the time of the deployment of the first change set, it would not deploy otherwise. How is is possible, that it is only 73 now?
Classes recompiled, test history deleted, we get the 73% when deploying or running all tests(UI and IDE).

I have found this issue on the forums
https://success.salesforce.com/issues_view?id=a1p30000000T1m1AAC
and have checked the ApexCodeCoverageAggregate, but there is no problem.

I have even tried to validate an change set containing 600 lines of i++; (I know, ugly) and haven't got even 1% more coverage. We are currently using about 2M chars of code.

This is an blocker for us, any help would be appreciated.

Thanks.
Hi,

did anyone notice some strange behaviour of input fields (input type=text, textarea,..) in Visualforce pages. Keyboard just locks up ...
To reproduce this bug do the following:
1. Create custom VF page with <input type="text" /> and make VF accessible by SF1
2. Focus this input by doing "one tap"
3. Type text(to here, everything works normally)
4. Tap again on input or tap somewhere outside of virtual keyboard (e.g. on blank space), or try to scroll page.
5. Try to type some more text (focus has to be still in input field).

I've research that problem and it seems it is related to input fields which are inside iframe (this is limited just to iOS) and because Visualforce pages in Salesforce1 are placed inside iframe, that is the reason why it breaks.

I've read that Apple fixed this bug in iOS 8, but because Salesforce 1 probably doesn't use latest phonegap/cordova engine it isn't fixed yet. 

Did anybody notice the same problem and how did you resolve it?  

Bug reference: http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html (http://webbugtrack.blogspot.com/2013/03/bug-345-keyboard-locks-up-in-ios-webkit.html)
Hi Everyone,

This is probably a pretty easy answer, but I'm just drawig a blank.  The code snippet below is designed to clone an Opportunity.  The RecClone class is set up to pull in all createable fields for the clone, since the clone function that Apex offers only pulls those fields that you specifically name.  The clone works fine, but I want to overwrite some of the clone fields with other values.  How do I pull the values from Line 3 and replace them with the values from lines 4 - 10?
 
String soql = RecClone.getCreatableFieldsSOQL('Opportunity','Id =: OppId');
                    Opportunity opp = (Opportunity)Database.query(soql);
                    Opportunity opp2 = opp.clone(false, true);
                        opp2.CloseDate = opp.Renewal_Date_Next__c;
                        opp2.OwnerId = amh.Assigned_Account_Manager__c;
                        opp2.Term__c = 12;
                        opp2.Renewal__c = 'Yes';
                        opp2.Effective_Date__c = opp.Renewal_Date_Next__c;
                        opp2.Renewed_Opportunity__c = opp.Id;
                        Opp2.StageName = 'Call Scheduled';

                insert opp2;

 
What are the impacts of enabling single sign on in an org?
Hello community,

I am trying to import data from a CSV file with an Apex class.
To do it I am reading each lines of the csv.
To read it I am using the Regex "docBody.split('\n')" in order to read each lines of the CSV file (each lines terminated by the tag \n). 
Everything works fine till approximatively 11 000 lines!
BUT there is a problem when I want to import a file with more data. I obtain this error message :
‘Regex too complicated’ with a reference to the line where there is docBody.split('\n'). 
So when I want to import a big file Force.com can not support the REGEX.
Did you encountered this issue? Did you find a workaround?

Thank you for your help,

Paul.B
Hi,

How to proceed with the above requirement?

Please let me know some available examples

Thank You
  • December 02, 2014
  • Like
  • 0
Hi All,

I have a requirement to create a custom object name: Status__c


   and field is Staus_name__c    and picklist values for this Status Name__c are 

    1. Task
    2. email alert
    3. chatter post
    4. field update

    --> If task is selected then it should ask Start date, End Date, Assign task to whom
    --> If email alert is selected then it should ask Email template
    --> If Field Update is selected then it should ask field name
    --> If Chatter post is selected then it should ask post name.

Can you please write the VF and Apex Controller code for above task..

Thanks in Advance..
Hi,
Are there UI components that handle lookup field selection, for example lookup from my custom object to an account? From experience this takes a lot of effort to implement and would seem like a very common use case. Maybe there is an open source version?

Thanks