• davcondev
  • NEWBIE
  • 85 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 34
    Replies
In our production org there is a usage-based entitlement entry of "Maximum Custom BigObjects Rows" with value of 1 million. Is this a hard limit on the number of records?

If so, setting the record limit so low nullifies much of the potential utility of BigObjects. The point at which BigObjects become valuable is 1 million records and above i.e. the point at which SObjects would experience performance degradation.

(Posting in developer forums because most aspects of BigObjects management aren't available yet in configuration.)
 
I suspect it's possible to replace the standard communities login component with a custom component that creates a cookie on login and uses the contents of this cookie to automatically relogin whenever the user's session expires.

The cookie would need to be undecryptable and device-specific to prevent misuse.

Feasible? If so, has anyone done this?
I'm trying to get Google Tag Manager working with a Lightning Community. This involves getting a script and iframe into the site as per https://developers.google.com/tag-manager/quickstart

Script can't be put into the community head markup or branding css, so I created 2 Lightning components as follows:

Header component
<aura:component implements="forceCommunity:availableForAllPageTypes">
    <ltng:require scripts="{!$Resource.googletagmanager}"/>
</aura:component>

Body component
<aura:component implements="forceCommunity:availableForAllPageTypes">
    <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
    height="0" width="0" style="display:none;visibility:hidden"></iframe>
</aura:component>

The header component gives me an error as follows:

Uncaught Error: SecureElement does not allow access to async throws at https://myorg--livepreview.instance.force.com/mycommunity/s/sfsites/auraFW/javascript/egTJsAb7_Esngaq3zUvPDw/aura_prod.js:8:15

It looks like Lightning Components doesn't like the async attribute in the GTM script? If so, can I somehow get them to be friends? I can remove async from the script but I don't know how this will affect GTM. Anyone needed to do this before?
Classic communities have typical error pages corresponding to 404 etc. These pages can be customized with different messaging and branding. With Lightning Communities, if someone mistypes a url they just get "Invalid Page". Is it possible to customize this message?
In a Napili Lightning Community with self-registration enabled, if I replace the standard Self Registration component with the customizable selfRegister component, self-registration fails with an error "Ending position out of bounds: -1".

The only changes I have made are the standard uncommenting (implements and siteforce:registerQueryEventMap).

Is there additional config that needs to be done to make the custom component work? There is a recent StackExchange on this too, does this suggest a recent release has broken the custom component?

https://salesforce.stackexchange.com/questions/178821/class-auth-authconfiguration-ending-position-out-of-bounds-on-aloha-community
forceCommunity:themeLayout applies a theme to a collection of community components. Is it possible to achieve the same for external sites via Lightning Out?
The Tabs component supports drag-drop of child components in both Lightning App Builder and Community Builder. Is it possible to implement the same in a custom component?
With Winter 17, access checks for Lightning components will be enforced. If unspecified, the default access value is "public" which means the component will be "Available within your org only".

Am I right to assume Salesforce1 is considered "within your org" and therefore Lightning components will pass the access check if access is unspecified?
With a Visualforce community I can edit the code e.g. CommunitiesLogin.vfp and CommunitiesLoginController.cls. Can I do this with a Lightning templated community too?

In a Napili community I have edited loginform.cmp and other Lightning resources but so far my edits haven't been reflected in the community. Are these components even being used by it?
I know how to set up Salesforce as an identity provider for other services. I know how to enable social sign-on for Salesforce. How do I get the two working together?

i.e. user logs in to Salesforce using social credentials and then is able to access other services that use Salesforce as an identity provider without having to re-enter either social or Salesforce credentials.
The identity provider requires a specific samlp tag to be included in the request. I can't see a way of achieving this.
  • There doesn't appear to be any way to specify this in the configurable single sign-on settings.
  • Creating a setting via "New Metadata from File" using the metadata from the identity provider doesn't help either.
Any ideas?

About the only thing I can think of manually modifying the metadata file to force addition of the tag - anyone done this before?
 
I need to create a ready-to-login community user with prespecified password and corresponding contact and account. Contact and account have custom fields that need to be populated as part of this.

None of the available CreatePortalUser methods offer the ability to specify a contact, but I found some code (see link below) to manually create the user and link to a contact.

https://developer.salesforce.com/page/ExampleApexCustomerPortalUser

The problem I have with this code is it's not possible to set the password as part of the user insert, and adding a subsequent system.setPassword() call in the same transaction doesn't work. Weirdly, if I execute setPassword again immediately after in developer console then it works.

It seems that if the password isn't set during user insert then SFDC sends out the first time login link and won't accept a setPassword during the same transaction?

If so I can't get around it by putting the setPassword in a @future call because this code already has an @future call and you can't nest them.

Any insights or suggestions to get around this?
The examples and how-tos I've seen for continuous integration with Salesforce are based on the deployment of raw metadata pulled from version control. But what about non-developers? I think they would come up to speed with version control ok, but they I doubt they would ever work with metadata - either directly or via a tool like Eclipse.

They know how to build change sets, is it possible to identify the associated metadata?

Would anyone know if the native version control entering pilot is going to cater for configurators?
https://success.salesforce.com/ideaview?id=08730000000BrBKAA0
Several DF14 speakers had big praise for Trialforce, and being able to spawn free temporary orgs based on meta & data templates certainly sounds super useful. One talk mentioned "trialforce feature orgs" which sounds to me like using trialforce for isv dev purposes (as opposed to provisioning customer trials).

My question: does it make any sense to use trialforce with unpackaged internally facing apps?

There's also the question of the org owner type (customer vs partner) which would determine whether trialforce is even accessible, but I'd like to keep this a separate point so I can understand the pure technical suitability.
I'm messing around with managed packages and I have included some customized oob communities code.

Two situations I can see: install managed package and then enable communities, or vice versa. I'm guessing last install wins in these cases?
Does anyone have a solution for the following situation:
  • Trigger uses a static runOnce boolean class variable to prevent recursive firing
  • Test method creates data that fires the trigger and runOnce is set
  • Test method then performs a DML operation but the trigger doesn't fire because runOnce is already set
In real usage the data creation and the DML operation would never occur in the same context and the trigger should fire twice, so an assert fails.

The only way I can think of to get around this is to fudge the assert to match the test-only result, or use @SeeAllData=true and rely on preexisting data - neither very satisfactory.
Dropping list views into homepage components is a quick way of consolidating multiple tabs onto a single community home page.

However I'm not liking the lookup click behavior in this situation - additional header & sidebar are displayed along with the clicked record.

Any suggestions to get rid of these or force a new tab to be opened?

I could substitute every lookup field used in the list views with a url formula field, because url formulas open a new tab. But was wondering if there is a lower maintenance solution.

HTML area home page component:

<iframe src="/myCommunity/ListViewA" frameborder="0" height="200" width="100%"></iframe>

ListViewA visualforce page:

<apex:page sidebar="false" showHeader="false">
<apex:sectionHeader title="Object A Records"/>
  <apex:listViews type="ObjectA__c">
    <apex:facet name="header">&nbsp;</apex:facet>
  </apex:listViews>
</apex:page>
I need to suppress the creation of some Chatter feed items based on the parent object without causing error or rollback (I'd rather not get into the fairly convoluted why). I'm thinking it should be possible to do this using a before trigger, but I haven't figured out how yet. Any pointers?

trigger suppressSelectedFeedItems on FeedItem (before insert) {
  for (FeedItem fi: trigger.New){
    if(String.valueOf(FeedItem.ParentId).startsWith('XYZ')){
      //I need something here to suppress the insert of this record without reporting an error
      //fi.addErrorNotReally();
  }
}
What happens if I don't provide the optional External Id parameter for a Database.Upsert call?

Will an insert be performed?

Thanks in advance

A test method uses runAs to apply some restrictive sharing rules applied to a particular user. However the class being executed by the test method is "without sharing".

 

I thought sharing rules would be ignored, but they weren't. Is this correct?

I need to suppress the creation of some Chatter feed items based on the parent object without causing error or rollback (I'd rather not get into the fairly convoluted why). I'm thinking it should be possible to do this using a before trigger, but I haven't figured out how yet. Any pointers?

trigger suppressSelectedFeedItems on FeedItem (before insert) {
  for (FeedItem fi: trigger.New){
    if(String.valueOf(FeedItem.ParentId).startsWith('XYZ')){
      //I need something here to suppress the insert of this record without reporting an error
      //fi.addErrorNotReally();
  }
}
User-added image
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually, this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: PGHBFJOE

above error am getting while completing the "Session-Based Permission Sets and Security
Activate Session-Based Permission Sets Without Code"  challenge
I'm able to create scratch org which I can see in my trail dev hub but I can't open them.   from "Get Ready to Create an App" tailhead
 
pogilvie:~/Projects/geolocation-> sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch
pogilvie:~/Projects/geolocation-> sfdx force:org:open
ERROR running force:org:open:  No defaultusername org found. 

I've also tried:

sfdx force:org:create --setdefaultusername -f config/project-scratch-def.json

and I get the same error.   I wished I tried this out yesturday when I was a trailhead dx!    
 
Classic communities have typical error pages corresponding to 404 etc. These pages can be customized with different messaging and branding. With Lightning Communities, if someone mistypes a url they just get "Invalid Page". Is it possible to customize this message?
With Winter 17, access checks for Lightning components will be enforced. If unspecified, the default access value is "public" which means the component will be "Available within your org only".

Am I right to assume Salesforce1 is considered "within your org" and therefore Lightning components will pass the access check if access is unspecified?
With a Visualforce community I can edit the code e.g. CommunitiesLogin.vfp and CommunitiesLoginController.cls. Can I do this with a Lightning templated community too?

In a Napili community I have edited loginform.cmp and other Lightning resources but so far my edits haven't been reflected in the community. Are these components even being used by it?
The identity provider requires a specific samlp tag to be included in the request. I can't see a way of achieving this.
  • There doesn't appear to be any way to specify this in the configurable single sign-on settings.
  • Creating a setting via "New Metadata from File" using the metadata from the identity provider doesn't help either.
Any ideas?

About the only thing I can think of manually modifying the metadata file to force addition of the tag - anyone done this before?
 
I need to create a ready-to-login community user with prespecified password and corresponding contact and account. Contact and account have custom fields that need to be populated as part of this.

None of the available CreatePortalUser methods offer the ability to specify a contact, but I found some code (see link below) to manually create the user and link to a contact.

https://developer.salesforce.com/page/ExampleApexCustomerPortalUser

The problem I have with this code is it's not possible to set the password as part of the user insert, and adding a subsequent system.setPassword() call in the same transaction doesn't work. Weirdly, if I execute setPassword again immediately after in developer console then it works.

It seems that if the password isn't set during user insert then SFDC sends out the first time login link and won't accept a setPassword during the same transaction?

If so I can't get around it by putting the setPassword in a @future call because this code already has an @future call and you can't nest them.

Any insights or suggestions to get around this?
Several DF14 speakers had big praise for Trialforce, and being able to spawn free temporary orgs based on meta & data templates certainly sounds super useful. One talk mentioned "trialforce feature orgs" which sounds to me like using trialforce for isv dev purposes (as opposed to provisioning customer trials).

My question: does it make any sense to use trialforce with unpackaged internally facing apps?

There's also the question of the org owner type (customer vs partner) which would determine whether trialforce is even accessible, but I'd like to keep this a separate point so I can understand the pure technical suitability.
This is my first time using the migration tool, so I'm not sure if it's user error or if it's not supported.

I posed a question on StackExchange (http://salesforce.stackexchange.com/questions/46154/is-it-possible-to-delete-a-record-type-through-metadata-api/46156?noredirect=1#comment60102_46156) which I'm fairly certain confirms it can be done.

I built a destructiveChanges.xml file which I'm able to successfully deploy without the elements for RecordType. When I add them into the file and deploy, I get an error reading "Error: Cannot delete record type through API". As mentioned in the StackExchange question, the Metadata API guide states "Use this metadata type to create, update, or delete record type definitions for a custom object.", so I'm at a bit of a loss.

I have 4 record types (all for the standard object Case), and they are all inactive and not default for any profiles.

Has anyone ever been able to delete a record type using a destructiveChanges.xml file? Here is my code referencing RecordType:

<types>
	<members>case.Associate_Services</members>
	<members>case.InformationTechnology</members>
	<members>case.Operational</members>
	<members>case.Website</members>
	<name>RecordType</name>
</types>

Does anyone have a solution for the following situation:
  • Trigger uses a static runOnce boolean class variable to prevent recursive firing
  • Test method creates data that fires the trigger and runOnce is set
  • Test method then performs a DML operation but the trigger doesn't fire because runOnce is already set
In real usage the data creation and the DML operation would never occur in the same context and the trigger should fire twice, so an assert fails.

The only way I can think of to get around this is to fudge the assert to match the test-only result, or use @SeeAllData=true and rely on preexisting data - neither very satisfactory.

A class variable I'm looking at in the debug log is 50k chars long and has 4 levels of nested classes/objects, which means it's pretty much unexaminable in plain text. I'd like to view it in a formatted tree, ideally collapsible. Does such a viewer exist?

 

Since the structure is json-like I tried using http://json.parser.online.fr/ but it's not well formed enough.

 

I was able to format the output using http://jsonviewer.stack.hu/ but now it's 30 pages long so I'm not much better off without collapsibility.

 

Is there a find/replace sequence I can use to json-ise my var?

I want to have accurate code coverage statistics continually, without degrading deployment times (all my deployments are via ANT, not change set). Based on some reading (see links below) I believe that:

 

- The most accurate code coverage is via manual apex test execution via GUI - but only if previous values are cleared out first

- Eclipse & Developer Console can't be trusted to accurately calculate and update the coverage statistics

- Deployments with runAllTests=true also accurately calculate the coverage statistics - but don't update them

- "Store Only Aggregated Code Coverage" is suggested to run tests faster - but this has no impact on deployment times because of the previous point

 

And based on this I believe the following is the best I can do:

 

- After every major deployment (including those with runAllTests=true), clear the code coverage, clear test history and manually run all tests.

- Don't bother setting Store Only Aggregated Code Coverage for deployments with runAllTests=true as this will make no difference to deployment time.

 

Is my thinking correct?

 

Reference info:

 

http://blogs.developerforce.com/developer-relations/2012/11/how-code-coverage-works.html

http://salesforce.stackexchange.com/questions/4165/why-are-code-coverage-results-different-in-ide-and-developer-console

http://salesforce.stackexchange.com/questions/3689/faster-unit-tests

To see the canvas in action I clicked the Heroku Quick Start button in Canvas App Previewer, and everything looks like it deployed ok.

 

Now I want to have a look at the Heroku app code to see how it works, but there doesn't seem to be any way from the Heroku Dashboard. Can anyone tell me how to do it?

 

Also the developers guide says to get rid of the app, go into Admin Settings | Connected Apps and choose Uninstall - but this option isn't available in my developer org. Help?

When single sign-on (SSO) was implemented the (My Domain) domain for our Full environment was set to acme--acmefull.cs10.my.salesforce.com and the domain for our production environment was set to acmeprod.my.salesforce.com.


A Production to Full refresh was performed. After the refresh the refresh process had changed the domain for our Full environment to acmeprod--acmefull.cs10.my.salesforce.com. Salesforce support has stated, " It is expected that the domain name will change after the sandbox refresh." However, I do not see how this is not considered a bug since:

 

1) It (in effect) breaks SSO every 28 days.

2) Only Salesforce level 3 support has the ability to restore the correct domain name. 

 

My question is, is everyone else experiencing this issue? Because I did not find the discusion boards flooded with posts regarding this issue I assume the answer is "No".

 

Thanks in advance.

 

Crocket

Hi, I've installed Newest Eclipse with the latest realease of Force.com IDE

The problem is i keep getting timeout exception, trying to deploy even sipliest class to the server (as well as in case of refreshing project from the server)

The timeout is set to 600 sec but the connection fail is occurring after 20-30 secs.

Hese is my IDE log dump:

 

 WARN [2011-01-25 22:00:12,909] (ProxyManager.java:init:49) - No proxy bundle found - default proxy service will be initialized
ERROR [2011-01-25 22:01:43,909] (MetadataOperationsRetryAspect.java:metadataOperationsRetry:24) - ForceRemoteException occurred while attempting to perform a metadata operation
 WARN [2011-01-25 22:01:43,957] (BaseRetryAspect.java:isExceptionRetryable:198) - General evaluation deemed exception not retry-able:
 ConnectException: Connection timed out: connect
ERROR [2011-01-25 22:01:43,962] (PackageRetrieveService.java:retrieveWork:1065) - Unable to retrieve components: ConnectException: Connection timed out: connect
ERROR [2011-01-25 22:01:44,288] (RefreshResourceAction.java:fetchRemoteComponents:94) - Unable to refresh resource(s)
java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
    at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:130)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:157)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:114)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:2248)
    at org.apache.axis.client.Call.invoke(Call.java:2171)
    at org.apache.axis.client.Call.invoke(Call.java:1691)
    at com.sforce.soap._2006._04.metadata.MetadataBindingStub.checkRetrieveStatus(MetadataBindingStub.java:1850)
    at com.salesforce.ide.core.remote.MetadataStubExt.checkRetrieveStatus(MetadataStubExt.java:261)
    at com.salesforce.ide.core.remote.MetadataStubExt$$FastClassByCGLIB$$9404e285.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
    at com.salesforce.ide.core.internal.aspects.MetadataOperationsRetryAspect.metadataOperationsRetry(MetadataOperationsRetryAspect.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
    at com.salesforce.ide.core.remote.MetadataStubExt$$EnhancerByCGLIB$$6c4872ef.checkRetrieveStatus(<generated>)
    at com.salesforce.ide.core.services.PackageRetrieveService.getRetrieveResult(PackageRetrieveService.java:948)
    at com.salesforce.ide.core.services.PackageRetrieveService.retrieveWork(PackageRetrieveService.java:1053)
    at com.salesforce.ide.core.services.PackageRetrieveService.retrieveWork(PackageRetrieveService.java:1006)
    at com.salesforce.ide.core.services.PackageRetrieveService.retrievePackage(PackageRetrieveService.java:319)
    at com.salesforce.ide.core.services.PackageRetrieveService.retrievePackage(PackageRetrieveService.java:290)
    at com.salesforce.ide.ui.actions.RefreshResourceActionController.refreshSourceFolder(RefreshResourceActionController.java:210)
    at com.salesforce.ide.ui.actions.RefreshResourceActionController.refreshResources(RefreshResourceActionController.java:137)
    at com.salesforce.ide.ui.actions.RefreshResourceAction$1.execute(RefreshResourceAction.java:67)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
 WARN [2011-01-25 22:07:54,631] (Utils.java:loadDocument:790) - Unable to load document: C:\Users\krzewinski.DAX\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\InteliWiseTest1\com.salesforce.ide.core\packageCache.xml (Nie można odnaleźć określonego pliku)
 WARN [2011-01-25 22:19:01,328] (ConnectionFactory.java:clearCache:212) - Clearing the following cached connections
 WARN [2011-01-25 22:19:01,333] (DescribeObjectRegistry.java:clearCache:654) - No cached describes
 WARN [2011-01-25 22:19:01,336] (MetadataFactory.java:clearCache:134) - Clearing the following cached metadata stubs
 WARN [2011-01-25 22:19:32,828] (ProxyManager.java:init:49) - No proxy bundle found - default proxy service will be initialized
 WARN [2011-01-25 22:22:24,546] (BaseRetryAspect.java:isConnectionExceptionRetryable:130) - Connection evaluation deemed exception not retry-able:
 ConnectException: Connection timed out: connect
 WARN [2011-01-25 22:22:24,550] (BaseRetryAspect.java:isOperationsExceptionRetryable:159) - Operataions evaluation deemed exception not retry-able:
 ConnectException: Connection timed out: connect
 WARN [2011-01-25 22:22:24,612] (ApexCodeScanner.java:generateKeywordRule:139) - Unable to get describe object for type project 'InteliWiseTest1'

 

Any help would be preciated

  • January 25, 2011
  • Like
  • 0
Hi,
     I am upserting records in a custom object using Apex in Visualforce.
The custom object has columns i.e. CustName & Month which are together used as primary key to identify unique record in table. I am updating already existing records based on this combined key or inserting new  if table dont have such record.

Can I use two external Id's like follows to do same:

Upsert CustomerTab__c CustName__c , Month__c;

I am facing error like

ErrorError: Compile Error: Variable does not exist: Month__c at line 353 column 35

I have both variables having External Id option selected.

Anybody has any solution for this?

Thanks.