• AK-2
  • NEWBIE
  • 55 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 19
    Replies
I refreshed my sandbox and immediately after was not able to connect using the data loader or using ecliplse.  I did find out that by changing test.salesforce.com to cs30.salesforce.com in the data loader, I could connect.. I am just not sure how to make this change in eclipse.  Any help would be greatly appreciated!!  Thanks!!
  • February 27, 2015
  • Like
  • 0
I am trying to use the afterRender event in a custom component (below is the component markup, js handler and the error I am seeing). I have taken out all the code in the handler but I still can't get around the error. I also don't know what parameter I should be setting for value in the component markup for the handler. The documentation around afterRender is pretty sparse so wanted to see if someone in the group could help. If I remove the afterRender handler, the component shows without error.
 
Thank you.
 
<!-- COMPONENT MARKUP -->
<aura:handler name="afterRender" action="{!c.afterRender}" value="{!this}"/>
 
//js controller afterRender
afterRender: function (component, helper) {
                       
        this.superAfterRender();           
       
    }

----- ERROR MESSAGE -----
Uncaught Error in $A.getCallback() [Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details.
Action failed: forceChatter:lightningComponent$controller$doInit [Cannot read property 'b' of undefined]]
  • March 02, 2017
  • Like
  • 0
I have a VF page where a few records are displayed in a table. Those records are only saved to the DB when user clicks "SAVE". There are a couple of fields in the records that have a lookup relationship and lookup filter. However, it appears the look-up filters don't work because the records are not saved to the DB.
Is there any way to get the lookup filters to work on these records? 

Thank you.
  • May 28, 2015
  • Like
  • 0
I am writing a custom VF page that has tabbed input for different types of related records input. To streamline the coding, I was thinking of moving each tab into a custom VF component with a custom controller. There is only one form on the page that includes all the visible tabs and the related input and only one "SAVE" button on the form. The tabs don't have individual save button.

So, the question is, how do I call save on the custom controller of the components to save the input in the custom tabs?

Thank you.
  • May 26, 2015
  • Like
  • 0
I have a VF page that's embedded within the standard opportunity page layout. When user clicks on a commandbutton on the VF page, the user needs to be redirected to a custom page from the opportunity page. I have a commandbutton on the VF page with controller action that has code something like this:
 
Public PageReference OpenCustomPage(){
 
 PageReference pr = new PageReference('apex/MyCustomPage?LongVersion=1&Id='+optty.Id+'&retUrl=/'+optty.Id);
 
 pr.setRedirect(true);
 return pr;

}
However, when user clicks on the button instead of the entire opportunity page getting replaced, the VF page within the Opportunity page is replaced and the user remains on the opportunity page.

How can I redirect the user to the custom page completely? Please note the command button is on the VF page not on the opportunity page.

Thank you. 
 
  • May 02, 2015
  • Like
  • 0
I am playing with a canvas app that's a couple of web pages (html) with some js. I am using oauth for authenticating with Salesforce. In the javascript, I have index.html which starts the authentication flow using Sfdc.canvas.oauth.login as shown below. The page redirects to index1.html after login:
 
if (! Sfdc.canvas.oauth.loggedin()) {
                uri = Sfdc.canvas.oauth.loginUrl();
                Sfdc.canvas.oauth.login(
                    {uri : uri,
                        params: {
                            response_type : "token",
                            client_id : "code",
                            redirect_uri : encodeURIComponent(
                                "https://localhost:8181/index1.html")
                        }});
            }
            else {
                Sfdc.canvas.oauth.logout();
                login.innerHTML = "Login";
                Sfdc.canvas.byId("oauth").innerHTML = "";
            }

What I am noticing is that even when I am logged into my dev org, the page Sfdc.canvas.oauth.loggedin() is always false. If I am logged in, the page correctly redirects me to my callback page index1 and if I am not logged into the salesforce on the browser, the app correctly redirects me to the login page (I am using mydomain). But after I log-in, I can't seem to get the context or the token in index1.html here:
 
var login    = Sfdc.canvas.byId("login"),
                loggedIn = Sfdc.canvas.oauth.loggedin(),
                token = Sfdc.canvas.oauth.token();

What am I missing? Why is the token blank?
Thank you.
  • April 06, 2015
  • Like
  • 0
In my org, I have Lead object with multiple custom fields and all the fields except standard field Description and custom field ProductInterest__c are visible to the Custom – Sales Profile.
Activity object has two custom fields and all the activity fields except standard field Comments and custom field TaskDescription__c are visible to that profile.
 
Now I want to make the Lead.ProductInterest__c and Activity.TaskDescription__c visible to the profile through Ant. So, I created the Custom – Sales Profile.profile file and added it to the package. Here is the Custom - Sales Profile.profile xml:
 
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
    <custom>true</custom>
    <fieldPermissions>
        <field>Activity.TaskDescription__c</field>
        <readable>true</readable>
        <editable>true</editable>
    </fieldPermissions>
    <fieldPermissions>
        <field>Lead.ProductInterest__c</field>
        <readable>true</readable>
        <editable>true</editable>
    </fieldPermissions>
</Profile>
I am not including the fields in the package since they are already in the org. I have included the package.xml at the bottom of this post.
 
When I run this script I noticed that the lead object FLS was updated correctly. However, when I look at Task object’s field level security, the following standard fields: Name, Public, Related To, Type and the custom field Hours__c  are now invisible (the visible checkbox is unchecked). I have been able to create this scenario in my Dev org multiple times.
 
Why is the FLS on fields not included in the Ant script changing? And why does it work correctly and only updates the fields I include in the script for the Lead object but not on Activity object?
Thank you.

package.xml:
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	
	<!-- Profile -->
	<types>
		<members>Custom - Sales Profile</members>	
		<name>Profile</name>
	</types>
	
	<version>32.0</version>
</Package>

 
  • January 16, 2015
  • Like
  • 0
I am trying to deploy a report through Ant script and seeing this error: Error: columns-field: Invalid value specified: STATE_CODE

The report includes standard fields Company, City, State_Code, First_Name, Last_Name, Phone and a few custom fields.

Not sure what this means and how I can go about fixing it. All the custom fields are already migrated to the destination sandbox. I even removed all the custom fields from the report but the error remains :-(

Thank you.

Thank you.
  • January 13, 2015
  • Like
  • 0
I have a VF page that's a simple proof of concept to get geolocation. The page is accessible through Salesforce1. The javascript on the page, makes a call to navigator.geolocation.getCurrentPosition and shows the location on the page. The page works correctly on desktop but through salesforce1, the geolocation.getCurrentPosition doesn't go go to success or error function handlers. I added javascript alerts to try to debug the problem. When viewing the page through salesforce1 I see the alert message "geolocation enabled" that I added in the if (navigator.geolocation) but none of the alerts from the success handler or the error handler show up! (Below is my VF page code)

What am I doing wrong?

Thank you. 
 
<apex:page controller="testController" doctype="html-5.0">
  
   <label id='test'>No geo-location</label>
   
   <script type="text/javascript">
  
    //error handler
    function showError(error) {
    alert('in error');
    
    var testElem = document.getElementById("test");
    var strError = "Unknown Error";
    switch(error.code) {
        case error.PERMISSION_DENIED:
            strError = "User denied the request for Geolocation."
            break;
        case error.POSITION_UNAVAILABLE:
            strError = "Location information is unavailable."
            break;
        case error.TIMEOUT:
            strError = "The request to get user location timed out."
            break;
        case error.UNKNOWN_ERROR:
            strError = "An unknown error occurred."
            break;
    }
    alert(strError);
    testElem.innerText = strError;
    };
    
    //success handler
    function successGeo(position){
            
            lat = position.coords.latitude;
            lon = position.coords.longitude;
            var testElem = document.getElementById("test");
            var strLatLong = 'lat: ' + lat.toString() + ', long:' + lon.toString();
            alert('Location: ' + strLatLong);
            testElem.innerText  = strLatLong;
    };
    
    // detection capabilities with JavaScript
    if (navigator.geolocation) {
        var testElem = document.getElementById("test");
        testElem.innerText = 'getting geo location!';
        alert('geolocation enabled1');
        
        navigator.geolocation.getCurrentPosition(successGeo, showError);
    };
    
    
   </script>





 
  • December 13, 2014
  • Like
  • 0
I am trying to use an Enterprise WSDL to make an API call from a java client. However, after login is successful, the subsequent calls fail with an error: Invalid session ID found in SessionHeader: Illegal Session. However, the login is successful and I am using the endpoint URL and session id returned by the login. What could be the reason for this error?
Any ideas.

Thank you.
  • November 29, 2014
  • Like
  • 0
I have a development org where I trying out a few deployment scripts with Ant. However, when I deploy to the dev org, the unit tests are not run automatically. 

In the dev org, if I run unit tests when I deploy using the "runAllTests" flag to true, the deployment fails because of code coverage. However, if I set runAllTests to false, the deployment works since the unit tests don't run.
However, my question is - shouldn't the unit tests always run when I deploy to the org since it's a prod org (even though it's a dev org)? Will I be able to set runAllTests to false in prod org to bypass unit tests?
 
  • November 17, 2014
  • Like
  • 0
Is there a way to obfuscate the username and password in the build.properties file in the Ant deployment foler? I don't like the fact that the password is sitting there in plain sight along with user name.

I am assuming there is a way to obfuscate it; could someone educate me please?

Thank you.
  • November 01, 2014
  • Like
  • 0
I am trying to migrate a profile with a / in the name. I am on a mac and there is a matching name file (with / in the name) but I still get an error from the Ant migration tool: Error: An object 'Custom - Credit/Underwriting' of type Profile was named in package.xml, but was not found in zipped directory

Any suggestions on how to get around the issue?

Thank you.
  • October 10, 2014
  • Like
  • 0
I am trying to migrate profile settings using Ant and seeing this error "Unknown user permission: CreateCustomizeDashboards". I am using API 31.0 and it seems like this is a new issue.

It almost seems like the only way around is to remove this permission and then migrate without it.

Anybody else running into this?
  • October 06, 2014
  • Like
  • 0
1. I am working on a batch interface using dataloader and have a simple quesiton. If I combine multiple files into a single file and load it through dataloader, will my API usage go down - so if I had 100 records, one in each file and I combine those into a single file, will it only increment the API request count by 1 instead of 100?

2. I tried doing a quick test - loaded 3 records through Lexiloader in a single csv file. When I noted the API usage count before and after the record load, the count didn't go up by 1 or 3 but instead it went up by 5! That completely confused me.

I am doing this exercise to make sure the API limits aren't reached with a large volume batch interface.

Thank you.
  • September 24, 2014
  • Like
  • 0
This is probably an easy question for some of you:

I ran the following query in the IDE "SELECT COUNT() FROM User". The query runs but I don't see the result of the query in the output window of the Force.com IDE. If I run a "SELECT name FROM User LIMIT 5", I see the 5 users in the output window.

Why do I not see the result of the first query (the one with Count)? I tried changing the query to SELECT COUNT(Id) FROM User but that only added expr0 to the output but I still don't see the number of user records.

Thank you.
  • September 11, 2014
  • Like
  • 0
I am writing a custom VF page that has tabbed input for different types of related records input. To streamline the coding, I was thinking of moving each tab into a custom VF component with a custom controller. There is only one form on the page that includes all the visible tabs and the related input and only one "SAVE" button on the form. The tabs don't have individual save button.

So, the question is, how do I call save on the custom controller of the components to save the input in the custom tabs?

Thank you.
  • May 26, 2015
  • Like
  • 0
I have a VF page that's embedded within the standard opportunity page layout. When user clicks on a commandbutton on the VF page, the user needs to be redirected to a custom page from the opportunity page. I have a commandbutton on the VF page with controller action that has code something like this:
 
Public PageReference OpenCustomPage(){
 
 PageReference pr = new PageReference('apex/MyCustomPage?LongVersion=1&Id='+optty.Id+'&retUrl=/'+optty.Id);
 
 pr.setRedirect(true);
 return pr;

}
However, when user clicks on the button instead of the entire opportunity page getting replaced, the VF page within the Opportunity page is replaced and the user remains on the opportunity page.

How can I redirect the user to the custom page completely? Please note the command button is on the VF page not on the opportunity page.

Thank you. 
 
  • May 02, 2015
  • Like
  • 0
I am playing with a canvas app that's a couple of web pages (html) with some js. I am using oauth for authenticating with Salesforce. In the javascript, I have index.html which starts the authentication flow using Sfdc.canvas.oauth.login as shown below. The page redirects to index1.html after login:
 
if (! Sfdc.canvas.oauth.loggedin()) {
                uri = Sfdc.canvas.oauth.loginUrl();
                Sfdc.canvas.oauth.login(
                    {uri : uri,
                        params: {
                            response_type : "token",
                            client_id : "code",
                            redirect_uri : encodeURIComponent(
                                "https://localhost:8181/index1.html")
                        }});
            }
            else {
                Sfdc.canvas.oauth.logout();
                login.innerHTML = "Login";
                Sfdc.canvas.byId("oauth").innerHTML = "";
            }

What I am noticing is that even when I am logged into my dev org, the page Sfdc.canvas.oauth.loggedin() is always false. If I am logged in, the page correctly redirects me to my callback page index1 and if I am not logged into the salesforce on the browser, the app correctly redirects me to the login page (I am using mydomain). But after I log-in, I can't seem to get the context or the token in index1.html here:
 
var login    = Sfdc.canvas.byId("login"),
                loggedIn = Sfdc.canvas.oauth.loggedin(),
                token = Sfdc.canvas.oauth.token();

What am I missing? Why is the token blank?
Thank you.
  • April 06, 2015
  • Like
  • 0
I am trying to figure out the best way to handle posting warranty information on a piece of equipment. An example is I have a piece of equipment; call it a 525AT. That piece of equipment may have serveral different warranties  Commercial, Consumer, Entry Commercial. I need those warranties to be displayed on each peice of equipment with maybe visualforce page on the equipment page. I've tried a couple differnt things with no luck.  Currently this objects are not related. 

If anyone could point me to a possible solution that would be helpful.


The object names:
Unit__c
Warranty__c

Equipment:
525AT

Warranty Info:
Commercial 
part 1
labor 1
frame 1

Consumer:
parts 3
Labor 3
Frame 5

Entry Commercial:
Parts 2
Labor 1
Frame 1
  • February 27, 2015
  • Like
  • 0
I refreshed my sandbox and immediately after was not able to connect using the data loader or using ecliplse.  I did find out that by changing test.salesforce.com to cs30.salesforce.com in the data loader, I could connect.. I am just not sure how to make this change in eclipse.  Any help would be greatly appreciated!!  Thanks!!
  • February 27, 2015
  • Like
  • 0
I am trying to deploy a report through Ant script and seeing this error: Error: columns-field: Invalid value specified: STATE_CODE

The report includes standard fields Company, City, State_Code, First_Name, Last_Name, Phone and a few custom fields.

Not sure what this means and how I can go about fixing it. All the custom fields are already migrated to the destination sandbox. I even removed all the custom fields from the report but the error remains :-(

Thank you.

Thank you.
  • January 13, 2015
  • Like
  • 0
I have a VF page that's a simple proof of concept to get geolocation. The page is accessible through Salesforce1. The javascript on the page, makes a call to navigator.geolocation.getCurrentPosition and shows the location on the page. The page works correctly on desktop but through salesforce1, the geolocation.getCurrentPosition doesn't go go to success or error function handlers. I added javascript alerts to try to debug the problem. When viewing the page through salesforce1 I see the alert message "geolocation enabled" that I added in the if (navigator.geolocation) but none of the alerts from the success handler or the error handler show up! (Below is my VF page code)

What am I doing wrong?

Thank you. 
 
<apex:page controller="testController" doctype="html-5.0">
  
   <label id='test'>No geo-location</label>
   
   <script type="text/javascript">
  
    //error handler
    function showError(error) {
    alert('in error');
    
    var testElem = document.getElementById("test");
    var strError = "Unknown Error";
    switch(error.code) {
        case error.PERMISSION_DENIED:
            strError = "User denied the request for Geolocation."
            break;
        case error.POSITION_UNAVAILABLE:
            strError = "Location information is unavailable."
            break;
        case error.TIMEOUT:
            strError = "The request to get user location timed out."
            break;
        case error.UNKNOWN_ERROR:
            strError = "An unknown error occurred."
            break;
    }
    alert(strError);
    testElem.innerText = strError;
    };
    
    //success handler
    function successGeo(position){
            
            lat = position.coords.latitude;
            lon = position.coords.longitude;
            var testElem = document.getElementById("test");
            var strLatLong = 'lat: ' + lat.toString() + ', long:' + lon.toString();
            alert('Location: ' + strLatLong);
            testElem.innerText  = strLatLong;
    };
    
    // detection capabilities with JavaScript
    if (navigator.geolocation) {
        var testElem = document.getElementById("test");
        testElem.innerText = 'getting geo location!';
        alert('geolocation enabled1');
        
        navigator.geolocation.getCurrentPosition(successGeo, showError);
    };
    
    
   </script>





 
  • December 13, 2014
  • Like
  • 0
I am trying to use an Enterprise WSDL to make an API call from a java client. However, after login is successful, the subsequent calls fail with an error: Invalid session ID found in SessionHeader: Illegal Session. However, the login is successful and I am using the endpoint URL and session id returned by the login. What could be the reason for this error?
Any ideas.

Thank you.
  • November 29, 2014
  • Like
  • 0
Is there a way to obfuscate the username and password in the build.properties file in the Ant deployment foler? I don't like the fact that the password is sitting there in plain sight along with user name.

I am assuming there is a way to obfuscate it; could someone educate me please?

Thank you.
  • November 01, 2014
  • Like
  • 0
Hi to all,

I am working on a project that I have to crate a unique id ..integer.. by converting salesforce id from alphanumeric to integer every time a new account is saved or updated-and-field-is-empty. I have written a trigger creating that field by removing letters from salesforce id but I receive a read only error when I try to update account record (after insert, after update). If I use it before insert, before update then salesforce id hasn't been created yet. How do I handle this? Ideas? PS. quite new to Apex ... 
1. I am working on a batch interface using dataloader and have a simple quesiton. If I combine multiple files into a single file and load it through dataloader, will my API usage go down - so if I had 100 records, one in each file and I combine those into a single file, will it only increment the API request count by 1 instead of 100?

2. I tried doing a quick test - loaded 3 records through Lexiloader in a single csv file. When I noted the API usage count before and after the record load, the count didn't go up by 1 or 3 but instead it went up by 5! That completely confused me.

I am doing this exercise to make sure the API limits aren't reached with a large volume batch interface.

Thank you.
  • September 24, 2014
  • Like
  • 0
This is probably an easy question for some of you:

I ran the following query in the IDE "SELECT COUNT() FROM User". The query runs but I don't see the result of the query in the output window of the Force.com IDE. If I run a "SELECT name FROM User LIMIT 5", I see the 5 users in the output window.

Why do I not see the result of the first query (the one with Count)? I tried changing the query to SELECT COUNT(Id) FROM User but that only added expr0 to the output but I still don't see the number of user records.

Thank you.
  • September 11, 2014
  • Like
  • 0