• Ken Koellner
  • NEWBIE
  • 395 Points
  • Member since 2010
  • Lead Solutions Architect
  • HMH

  • Chatter
    Feed
  • 8
    Best Answers
  • 27
    Likes Received
  • 0
    Likes Given
  • 224
    Questions
  • 267
    Replies
I'm trying to pull the lightning components into my IDE, but can't figure out the way to include them in package.xml... would anyone know? ... The Dev guide only talks about packaging as a package, I couldn't find mention of lightning components in migration tool etc to give some lead on my problem... 

 

Hi, I'm creating a VF page, and I need to add "help text" in a fields, but I'm not using standarcontroller, what can I do? 

 

Please Help!

Hello,

 

I need to create records to check the SLA on our daily batch operations. The SLAs times are stored in its own object using a string to indicate HH:MM and a picklist value to specify the timezone for the client. Each day I need to generate the expected SLA record based on the date and the time stored in SLA times object to compare against the actual. Ideally, I should be able to create a datetime instance specifying the relevant time zone. However, the only options avaialble in Apex are GMT or current user locale.

 

Is there a way to accomplish the same using what's available in Apex?

 

I could store the time offset from our default time zone (EST) in the SLA object. However, I would need to deal with the periods when Europe and North America switch daylights savings at different dates.

 

Thanks,

 

Pedro

  • October 25, 2011
  • Like
  • 0

I know my question is going to be pretty simple for you veterans but can someone explain to me how relationships work in SOQL. I have looked at the documentation and the discussion boards but can not seem to understand it.

 

I want to get the following fields from the following tables:

 

Contact.FirstName,

Contact.LastName,

Account.Name,

Opportunity.Name

 

I have tried the following but it does not seem to work:

 

SELECT Contact__c.FirstName, Contact__c.LastName, Contact__c.Account__r.Name, Contact__c.Account__r.Opportunity__c.Name From Contact

 

The more I read the more confused I get.

 

I need to understand the basic concept. If someone could help I would appreciate it.

 

Robert

  • October 21, 2011
  • Like
  • 0
We'd like to check if about 200 fields are referenced anywhere in code-- Apex, VF, workflows, trigger.  Text searches really don't cut it as you could have a field such as MyCustomField__c in more than one object.  So without doing the same symbol-table work a compiler would do, with references like myObj1.MyCustomField__c and myObj2.MyCustomField__c you would not know the objec type.

I thought of a way to do it via validation but it does not appear to be working.  The idea I had is --

create a package.xml with no types.
create a destructiveChanges.xml with CustomField entries for the custom fields.

But one the descructiveChanges.xml field has one field I know is reference and a I run a validation with the ant deployment tool, I get a successful validation.

Anyone know why the validation could succeed even with a reference to the field in Apex?

Anyone know any other method that is 100% realiable and understands the object and field name together (no simple text searches)?

 
So are start doing some beginner trailheads and try a challenge but it won't let me use my dev org as it has a namespace (I was messing around with Lighning components a while back).  So it lets me create a new hands-on org curious-racoon ...  I do some beginning trailheads in that org.  Then I do a Lightning Trailhead and it says to create a namespace so I do.  The challenges in that Trailhead work fine.  Then I go back to a beginner Trailhead and do a simple challenge to create two custom fields.  The check fails.  I strongly suspect it's because it's looking for a field with an API name Description__c but my field has an API Name, myNameSpace_Description__c.

Is there a way to have a hands-on org that's compatible with all Trailhead Modules?
Does anyone --
  • develope with a team of at least 1/2 dozen developers.
  • Have a large org with lots of code and complex data that must be setup before any real work can be done.
  • Use a single development sandbox for all developers.
  • Use a source control for code.
We have found it prohibitive to set up a sandbox for every developer because of the amount of setup data need for developers to do real work.  (Sandbox-to-sandbox copy would fix that; rumor is it's coming but not for 6-12 months.  So we all work in one sandbox.  We've never implemented source control as then there'd be an ambiguity over whether to get a module from source control or the sandbox org before editing.  The warning you get in the IDE before saving to the org would no longer be meaningful.  So developers would have to be maticuous about following some sort of procedure or they could either overwrite others' changes or fail to get there own changes saved properly.

Has anyone solved this problem and devised a strategy for using source control when multiple users are working in the same sandbox?
 
I have some rest service written in custom Apex.  Anyone know if there's a way to generate a WADL file from them?
I wrote a class to to wrap getting data from either disk or Platform Cache.  When not available in cache, it reads the data and puts it in cache.  When in cache, it returns data from cache.  That's a pretty standard pattern.  I wrote a test class for it and that test class works fine and gets 82% coverage.

I have other tests classes that make use of other functional classes that will use my cache wrapper class.  Those tests fail with message --
caused by: cache.Org.OrgCacheException: Failed Cache.Org.contains() for key 'local.CommonConstants.namesToIdMapMap': Org cache is only supported in Data Silo tests
I did some search and can't find anything specific in the manual about testing classes that use Platform Cache and can't find anything on "Data Silo" tests.

I'm guessing some kind of mixing of data operations isn't allow and maybe you can only test Platform Cache when certain other operations do not take place.  But I can't find rules documented anywhere. 

I'm guessing I can workaround by putting a hook in to only use the cache when isRunningTest() is true if the cache wrapper class is called by the one test specific to it that doesn't do any other data work.  But I hate to guess and have my test class come crumbling down in the future from some restriction I do not understand.

Anyone have any ideas?


 
I'm trying to deploy from one sandbox to anything via the ant migration tool using package.xml and destructiveChanges.xml.  I'm getting an error that the class is scheduled.  This is queueable, not schedulable.  I have other classes scheduled.  I'm not able to delete this via destructiveChanges.xml.  I was able to comment all the code and deploy a version that was empty.  I found that odd because usually if you something is scheduled, you can't deploy a new copy of it either. 

I'm wondering if there is some restriction I do not know about or if SF is acting up.  I'm not sure I want to take the time to run this issue by Tech Support. 
BUILD FAILED
/hmco_dev/SFDC/deploy/feature/IN25014_Rel31.4_ReleaseXYZ/build.xml:41:
*********** DEPLOYMENT FAILED ***********
Request ID: 0Afg000000fGqHjCAK

All Component Failures:
1.  classes/DoWOrkCalculatorQueueable.cls -- Error: This Schedulable class is in use. : Apex Class.

*********** DEPLOYMENT FAILED ***********

 
When I create a new Eclipse projects where I only want to work on a few modules, it still brings in everything in everything Referenced Packages.  That's over 4600 items for our org.  So it takes five to ten minutes just to create a new Eclipse project and loads up the workspace with a huge amount of stuff I don't need.

Is there anyway to get the Eclipse IDE to not load the stuff in Referenced Packages?
I've used apex-lang a bunch but can't find online any easy to read reference manual.  Anyone know where to find it.  Search for 15 minutes with no luck.
Anyone know a way to put a <meta .../> tag in the <head> </head> area of a page rendered by VF?

If I just include meta tag I need -- <meta name="viewport" content="width=device-width, initial-scale=1.0"/> after the <apex:page  .../> tag, it comes out in the body when VF renders the page.  Even with standard styles off.



 

I want to call an action method in a VF controller and have it return a PageReference that the user goes to (it's actually null, I'm going back to the same page) just like an apex:commandLink.  But, I need to do it onChange of a selectOption.  I'm using an actionFunction that does a rerender but it doesn't function the same as a page reload because of complex script and styles on the page.

So what I really want to do is the equivent of using apex:commandLink to call an actionMethod and go to the Page Reference returned but trigger it from onChange of a selectOption?

Anyone know how to do that?  Basically load a new page based on a PageReference from an onChange rather than a rerender?
 

W

I have a VF page that won't load for a user for a particular set of parameters.  I get the "Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested....." error.

Is there any way to tell what record it is complaining about?  I get one log and it does a bunch of stuff including a bunch of SOQL queries and I do not see any errors in it.
Can anyone explain definitively what goes on with Browser history when a page button calls an action method that returns a Null page reference, such that the user stays on the same page and with the same controller?

I've noticed three different behaviors--
  1. The browser Back button is enabled and if the user hits it, they goes to the page in the prior View State.
  2. The Back button is not enabled.
  3. The Back is enabled but if I hit it I get the error "Document Expired  This document is no longer available."
I'd like to get behavior 1 all the time for a certain application but I can't figure out why on some buttons on some pages I get that behavior and on other pages or buttons I get 2 or 3.
Doing a fast validation with selective test execution.  I'm getting too low a % on one module.  I really need to see which lines are covered (the red/blue highlighting you get if you click after you run a test with dev console and click on a module.)  But since this is a validation and it is a new module, I obviously can't use Test feature in Dev Console as the code in the package is different than what's currently in the org.

Anyone know if there's a way to view lines covered after a validation?
I have to say there are a lot of things I do not like about the Dev Console (or any javascript page).  For one thing, you can't do simple operations like copy and paste from it.

I see the coverage stats in the lower left and I really want to copy them and put them in an email.  But there's no way to copy-and-paste.  It seems inane that I'd have to re-key that stuff. 

Does anyone know if you can still get the coverage % by module, and even better the blue/red line coverage in the good old HTTP web page setup pages?
 
Does anyone know if there's a way to get the parent fields for the Account parent object via the ObjectId relationship in ObjectTerritory2Association?

The query below works to get the Name.  But I don't know of a way to get the other fields.  It's actually one custom field that I'm hoping to get in my query.

select ObjectId , Object.Name,  Territory2.MarketUser_Last_Modified_Date__c ,LastModifiedDate
from ObjectTerritory2Association
where   Object.Type = 'Account' limit 10
Summer '16 is hitting sandboxes within weeks. Yet I can't find any release notes.  I sure would like to know what features are included.

Anyone know where the feature list is?
I want to report to a caller an error via an Exception but I also want to store a log record in my own error log.  If I rethrow the Exception, my insert DML is always rolled back.  Anyone know a way to get it to stick?

Here's a test sequence I did but the insert is always rolled back.
Class MyException extends Exception {
}


Exception myEx;

try {
  throw new MyException ('force fail');
} Catch (exception ex) {
  myEx = ex;
}

if (myex != null) {
  MyLogRecord__c logRecord = new MyLogRecord__c();
  logRecord.message = 'test message';
  insert logRecord;
  savepoint beforeDML = null;
  beforeDML = Database.setSavepoint();
  database.rollback(beforeDML);
  throw myex;
}

 
I have to say that when you are working on one-record, a single-page type paradigm like Lightning works nice.

But for navigation, I think good ol' URLs fetching a new page is just better, better, better, better.

For Setup, I think Lightning is going to make our lives as developers much much harder and I wish SF would abandon the effort.  In the good ol' days of most of setup, you get a nice page with the create and modification dates and users.  So if something in a trigger breaks, you can check who developed it last, then you can grab the URL and mail it to the developer.

Try that with process builder.  You get a mod date and that's it.  You don't get a name of the last modification and you don't get a URL.  If a trigger breaks, you can email the URL.  If a process breaks, you can't email a URL. 

Yeah, Lightning looks pretty.  But I sure hope all of setup never never never migrates to Lightning.
I'm working for these instructions -- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm

I'm trying to get this to work.  My SB in on Winter '16.  I'm getting a 404 on my aura component (I have firebug on my browser) in the firebug console.

This is KKTestApp1.app --
<aura:application access="GLOBAL" extends="ltng:outApp"> 
  <aura:dependency resource="ui:button"/>
</aura:application>
This is KKTestLightningContainer.vfp --
<apex:page>
    <apex:includeLightning />
     This is a test.
    <div id="lightning" />

    <script>
        $Lightning.use("hmhco:KKTestApp1", function() {
          $Lightning.createComponent("ui:button",
          { label : "Press Me!" },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>
</apex:page>


I tried including our domain "hmhco:KKTestApp1", leaving it out "KKTestApp1", and just "c" as in the example "c:KKTestApp1".

I'm my firebug console, I get 404 error on the URL --
 https://hmhco--sb2.cs42.my.salesforce.com/hmhco/KKTestApp1.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT
or --
https://hmhco--sb2.cs42.my.salesforce.com/c/KKTestApp1.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT"
or --
https://hmhco--sb2.cs42.my.salesforce.com/KKTestApp1/undefined.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT"


Maybe I need a different prefix.

Maybe there is some global setting to turn something on and make it available.

I'm working for these instructions -- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm

There's no additional info on anything that has to be done.
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 
Now that we have the new Lightning Experience UI, there's a couple things I really need to learn about what's doable with Lightning and VF.  Lightning is really now two things -- Lightning Components/Apps (which you code) and Lightning Experience which is the new GUI you turn on.  I asked about this stuff at Dreamforce last week and really didn't get exact answers.  (The "Experts" in the Dev Zone only knew about using the Lightning styles in VF to make VF pages look like Lightning when not in Lightning.)

Here are what I consider the two BIG questions that everyone is going to want to know--

Our orgs has dozens and dozens of VF pages, typically launched from buttons or links on page layouts.  We'd like to turn on Lightning Experience to get the new UI but can't rewrite all that legacy code at once in Lightning Components.  Can we from Lightning Experience still launch all those VF pages and will they still work?  If so, how?

We are not ready to turn on Lightning Experience but we are continueing to do new development.  We'd prefer to write our new featues as Lightning Components/Apps (not simply as VF with the Lightning styles).  If we leave the legacy Aloha GUI on, could we launch and execute Lightning apps and return to the regular desktop on completion?  If so, how?


If anyone has can concrete into in either area and can offer insight, please follow up on this thread.
I have to say, I do not consider the new online version of the Apex manual an improvement.  I'm finding it much are to look things up than in the old more book-like version with the Index and Search.  Yes, I know there's a PDF but find then it's too bulk.

Also te scrolling area on the left is only a couple lines.

At least in the version of Firefox I'm suing ESR 31.6.0 the rendering is all messed up with text on top of it.

For a learning manual, the new manual might be okay but it really isn't as efficient as the old one when you have to really quickly look up one little detail.
We have a VF page that was originally written for desktop but we've also been using it in SF1 and it has been rendering fine.

Now one of our sandboxes is on Spring '15 and when I look at the page in SF1 in that sandbox (from SF1 on iPad or from Chrome on a PC via one/one.app) the page rendering is all messed up.

I looks to me like all the standard SF style for things like Page Blocks are missing.  Fonts are serif and page is gray and block and section borders are missing.

I'm wondering if something changed in SPring '15 and may I have to add code to get the standard SF styles in my page.

Anyone notice this behavior and have a fix?

(I want to enter a Support Case but that means typing up full instruction for reproducing the case and explaining it to them and I won't have time to do that for a day or two.)
 
I need to write some code to concurrently create, via queueable async apex, up to 5-6 Opportunity on the same Account.  In addition to the insert to Opportunity will be inserts of up to a few hundred records to OpportunityLineItem and also several records to custom tables related to Opportunity.  I have code that inserts all the records already but haven't tried using it concurrently yet.  There is no expicit commit in Apex so all those updates are in one transaction and that transaction can run for 20-30 seconds.

When I start doing the create Opportunities concurrently, I'm worried about locking errors.  The main resource shared by all Opps is Account.  If the first transaction write-locks Account then the others will likely fail with locking errors.  There's also the issue of PricebookEntry and Product as many of the Opps will be using similiar lists of Products.

Anyone know what locks will be held when the inserts are happening to Opp and Opp Line Item and what the likelihood of interference is?
 
It looks like I get a "New" action for every related list on have on a page layout when the page layout is view in Mobile / SF1/ Salesforce1 aka net/new.app.

In the layout in question, the New button as been disabled on the layout.  So in the regular (aloha) interface, there's no New button on the related list.

On Account, I get New Task, New Case, New Opportunity, etc.  But I don't want "New Opportunity".  None of those buttons are listed in the action list on the page layout definition so I don't know how they are editable.

I don't want the New Opportunity button on Account in SF1 but I'm getting it.

Is there a different way to remove the New button for a related list on the mobile / sf1 interface?

 
I know I'm getting ahead of myself but I'm already thinging about deployment and development.  The Dev Console has been good for working through the tutorial but there may be times when our developers will want to use the IDE, for one thing, just to get backup files of modules, and for another for doing quick incremental deployments between sandboxes.  I'm also thinking about our production deployments.  We use the ant meta-data tool as it provides a realiable way to extract all our source and the deploy to production from a batch (UNIX shell) environment.

I don't see anything in the 31.0 meta-data selector for Lightning components but it seems to me the IDE and metadata tools have always come a few months late.

Anyone know if/when the IDE and ant migraition tool will support retreive and deploying Lightning components?

-Ken
 
I'm starting to work through the Lightning Components Developer Guide working my own developer org where I've created a name space.

But I'm confused about how to do this in our real development stream.  We have a production org and some sandboxes we do development in.  (We develop in sandboxes instead of individual developer orgs as we need common data that is setup for all developers and there's no way we could maintain it in several individual developer's org.)

In out production org and in our sandboxes, there is no "Edit" button to allow specification of Namespace on the Packages page.

So I'm unclear how to reserve a namespace.  Any clue? 

We do have a domain name registered.  Does it have something to do with that?
Tried doing a callout from an execute method in a queueable class and go the @future error -
Callout not allowed from this future method. Please enable callout by annotating the future method. eg: @Future(callout=true)
07:13:51.752 (8701449752265601)|SYSTEM_METHOD_EXIT|[1263]|System.Http.send(ANY)
Is there a way to annotate the execute with "(callout=true)".

I sounds like what i want to do may be doable if there's just some syntax to get the annotation.

 
<apex:pageBlockTable value="{!accountWrapperList}" var="rowEntry">
  <apex:repeat value="{!columnList}" var = "colEntry">
     <apex:dymanicComponent value="{!myDynamicColumn}"/>
  </apex:repeat>
</apex:pageBlockTable>

I'm trying to do something like the above where a pageBlockTable iterates over a list.  Then within the table, the columns are determined via another list that contains a data structure with some info on the column including the label in a String member and the API Name in another string member.  Then a dynamicComponent is included to generate the apex:column which will contain some more complex VF inside it.  (It would be a very lengthy discussion to explain why I want to do that so I'll skip it for now.)

I'm not sure what I'm trying to do can be accomplished.  For the value expression on the element that will contain the value, I think expression would have to be evalated twice.  First an explession needs to be evaluated to get the field name, then an expression is needed for the value.

It's as if what I woud want to code be someting that returns a Component.Apex.Column and either that column or an element within that column would have an element equivelent to --
expressions.value = "{!rowEntry.{!colEntry.apiName}}"
But obviously that makes no sense.

I can't think of anyway to code a getter for the dynamic component I want in this scenario. 

Anyone that has any ideas, feel free to chime in.


If I had a file/document/attachment stored in SF, there is a document link.  What I'd like to do is actually display the contents without a VF page instead.

The file is an HTML document.  I don't think I could use a simple outputText with HTML not escaped as VF is going to put <html> tags around the page.  I'd end up with nested <html> tags which wouldn't work.

What I'd like to do is put the attachment/file/document in an iframe.  But to do that, I'd need a URL to the content of the document and not a download link.

Anyone know if there's a way to do that?
I'd like to set some additional email header in a SingleEmailMessage sent by Messaging.sendMail.  I don't see any mothod to start arbitrary standard or custom (-X) headers.

My guess is there's no way to do it but I htought I'd ask just in case I missed something in the docs, or there's some super secret workaround trick I never figured out.
Anyone know if there's a way to get some HTML that's configured somewhere to show up anywhere in the Chatter tab?

When the sidebar shows in most of the other tabs, you can configure some content that appears.  I know some people use that to put a bit of HTML with some javascript in it to slightly alter the rest of the page.  For example, even though SF doesn't have a feature to override the colors on the page.  If you put a bit of Javascript in something in the sidebar, you can change the colors.

I'm wondering if there's a way to to that on the Chatter tab but don't see any elements on the page that can be configured via administration.
We have various emails sent both via code and workflow that sends email to owner and createdBy on Opportunity.  For things created from Sites, the createId is the public access sites user; the email ends up going to a system address and all supporters get it;  that creates a lot of noise we don't want to see.

I'm thinking of changing the email address on public access sites user to a bogus address.  At least in a sandbox, it doesn't appear to validate that it is a real address.  I'd use something like noReply@myDomain.com.  Then if email ever gets sent to things createdBy that user, it would go nowhere.

What I worry about is could there be any other email that gets sent to the Sites Guest User that we might miss if we went with that solution.

Any ideas?

I'd like to set up an API for an Enterprise Integration Service consisting of many Get and Post methods.

It would be nice if I could put them all in one class.  Is there anyone to put multiple @HttpGet and @HttpPost in the same class and have the last part of the path be different for each?
 

Otherwise, I'd need to define a class for each method.

The only other alternative would be to have just one get/post and have the input define what operation to perform and have the get post method act as a dispatcher to call the proper inner method.  I'd rather not do it that way.

-Ken
 

I got "Value is not valide" error message when a particularly values was selected. I used the name text for value and name when creating the selectOption in Apex and they were both "Test that a My APPT CPT can have more than 75 characters."

That's an exact quote with the "." being in the text.

I made a coding change and left the label as is but changed the value to an artifical key.  It works fine now.

I'm thinking there's some limit on who long or what can be in the value member of a selectOption.  The Apex and VF manuals do not mention any restrictions in the documentation for the selectOption class.

I'm thinking maybe either the length or the "." broke it.

Anyone know if there are some limitation to what can be in the value member?  If so, are they documented somewhere else?

I started a thread over on the Sites board but there doesn't appear to be much traffic over there so I'm posting a link here--

 

http://boards.developerforce.com/t5/Force-com-Sites-Site-com/Site-written-in-VF-and-access-to-standard-objects-with-Public/td-p/700949

 

I researching doing a SF Site in VF that allows a public access user to both create a Cost Proposal in Opportunity and come back later an edit it.

 

Of course the sticky wicket is that Sites public access allows only Insert to Opportunity and OpportunityLineItem and not Update.

 

I do have what I think is a viable work around and post it with screenshot and sample code in the other thread.

 

I'm wonder if any other VF developers have run into this issue and found any other work arounds.

 

Feel free to comment here are on the other thread.  (Might be better on the other other thread as that's where the details are.)

 

 

-Ken

 

 

I'm working throught the very first tip calculator tutorial.  I figure rather than retype, I'd copy and paste text.  Every time I try to paste Flash crashes.  Not sure if it's just the machine I'm on.  Anyone experience that? 

 

I'm planning on converting a number of validation done in formulas and approval rules to flows and it would be a lot easier to cut and paste names than have to retype.

I have some batchable apex, in the execute() method, udpates are done to pricebookentry.

 

I'm getting a weird mixed DML error.  Originally I had pricebookentry and a custom table updated in the execute() but to be safe, I took out the other update.  Now the execute() is issueing exactly one DML to pricebookentry for a few hundred rows.  I still get the mixed dml error.  Not sure how I could get a mixed dml error when there is exactly one DML issued.

 

09:23:22.107 (92107648000)|EXCEPTION_THROWN|[68]|System.DmlException: Update failed. First exception on row 0 with id 01u40000002CKwBAAW; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): CustomFieldDefinition, original object: PricebookEntry: []

 

The message doesn't make much sense as it says there's an attempt to update "CustomFieldDefinition".  That sounds like metadata, not data.  And as I mentioned, there is exactly one dml, to pricebookentry.

 

Yes, I did open a case with Tech Support.   I updated the logic to a single DML this morning and added that to the case, still waiting on a response after that update.

 

I thought I'd post here anyway in case anyone else has experienced this anomoly.

Apex Debug Log Detail
User	Ken Koellner	Date	10/1/2013 10:20:15 AM EDT
Status	Success	Application	Unknown
Request Type	Api	Operation	SerialBatchApexRangeChunkHandler
Duration (ms)	163,082	Log Size (bytes)	16,757
Log	

27.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
10:22:57.875 (162875309000)|EXECUTION_STARTED

....

10:22:58.074 (163074777000)|EXECUTION_FINISHED

 

Subtracting finished time from setart time, I get 199ms.  How come it says duration is 163,082 ms ?

We have a sites URL http://ourcompany.force.com/XYZZY  Some users are trying to access http://ourcompany.force.com/xyzzy and they are getting thrown to a generic page not found.

 

I could put in a redirect from http://ourcompany.force.com/xyzzy to http://ourcompany.force.com/XYZZY but that would work only for that one specific case.  If a user tried http://outcompany.force.com/XYzzy they would still get a page not found.

 

Is there any way to make a sites URL case insensitive or have some sort of case-insenstitve redirect?

We'd like to check if about 200 fields are referenced anywhere in code-- Apex, VF, workflows, trigger.  Text searches really don't cut it as you could have a field such as MyCustomField__c in more than one object.  So without doing the same symbol-table work a compiler would do, with references like myObj1.MyCustomField__c and myObj2.MyCustomField__c you would not know the objec type.

I thought of a way to do it via validation but it does not appear to be working.  The idea I had is --

create a package.xml with no types.
create a destructiveChanges.xml with CustomField entries for the custom fields.

But one the descructiveChanges.xml field has one field I know is reference and a I run a validation with the ant deployment tool, I get a successful validation.

Anyone know why the validation could succeed even with a reference to the field in Apex?

Anyone know any other method that is 100% realiable and understands the object and field name together (no simple text searches)?

 
So are start doing some beginner trailheads and try a challenge but it won't let me use my dev org as it has a namespace (I was messing around with Lighning components a while back).  So it lets me create a new hands-on org curious-racoon ...  I do some beginning trailheads in that org.  Then I do a Lightning Trailhead and it says to create a namespace so I do.  The challenges in that Trailhead work fine.  Then I go back to a beginner Trailhead and do a simple challenge to create two custom fields.  The check fails.  I strongly suspect it's because it's looking for a field with an API name Description__c but my field has an API Name, myNameSpace_Description__c.

Is there a way to have a hands-on org that's compatible with all Trailhead Modules?
I have some rest service written in custom Apex.  Anyone know if there's a way to generate a WADL file from them?
When I create a new Eclipse projects where I only want to work on a few modules, it still brings in everything in everything Referenced Packages.  That's over 4600 items for our org.  So it takes five to ten minutes just to create a new Eclipse project and loads up the workspace with a huge amount of stuff I don't need.

Is there anyway to get the Eclipse IDE to not load the stuff in Referenced Packages?
I've used apex-lang a bunch but can't find online any easy to read reference manual.  Anyone know where to find it.  Search for 15 minutes with no luck.

I want to call an action method in a VF controller and have it return a PageReference that the user goes to (it's actually null, I'm going back to the same page) just like an apex:commandLink.  But, I need to do it onChange of a selectOption.  I'm using an actionFunction that does a rerender but it doesn't function the same as a page reload because of complex script and styles on the page.

So what I really want to do is the equivent of using apex:commandLink to call an actionMethod and go to the Page Reference returned but trigger it from onChange of a selectOption?

Anyone know how to do that?  Basically load a new page based on a PageReference from an onChange rather than a rerender?
 

W

Doing a fast validation with selective test execution.  I'm getting too low a % on one module.  I really need to see which lines are covered (the red/blue highlighting you get if you click after you run a test with dev console and click on a module.)  But since this is a validation and it is a new module, I obviously can't use Test feature in Dev Console as the code in the package is different than what's currently in the org.

Anyone know if there's a way to view lines covered after a validation?
Does anyone know if there's a way to get the parent fields for the Account parent object via the ObjectId relationship in ObjectTerritory2Association?

The query below works to get the Name.  But I don't know of a way to get the other fields.  It's actually one custom field that I'm hoping to get in my query.

select ObjectId , Object.Name,  Territory2.MarketUser_Last_Modified_Date__c ,LastModifiedDate
from ObjectTerritory2Association
where   Object.Type = 'Account' limit 10
I've started dabling in Lightning Components and worked through a tutorial last year and have done one of the trailheads a few days.  So I know how to code basic Lightning components and apps.  And I see in the metadata that these become AuraDefinitionBundles.  I also so an example of some code where a bit of JS is added to an empty VF page and that always a Lightning Component to be spun up inside a VF page.

What I want to do is take an exist VF page that is exposed to the internet as a SF "Sites" application and port it to Lightning.  What I included in the prior paragaph leads me to believe the page is codable.  Here's what I don't know.  When a Sites application is configured, you have to tell it what it has access to-- VF pages, Apex controllers, objects and fields, etc.  I don't know how you would give it access to the Aura bundle.  (Unless it's totally implicit and you don't have to and it automatically gets acces.)

Can anyone address the question of how to configure and deploy Sites application that includes a VF page that spins up an Lightning Component?
 

 

A client of one of our web service written in Apex reported an error.  It turns out there was an error --

 

Insert failed. First exception on row 9; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusie access to this record: []

 

I'm trying to think of what would cause an lock problem on an insert.  The method does to a start transaction and then inserts a row in Opportunity and then several in OpportunityLineItem. 

 

I don't see how the problem could be with the row being inserted.  Could it be with something locked a parent record like account?  Could something have already read the Opportunity record while the OpportunityLineItem records where being written?

 

I found out that I can render pages inside IE as if it were chrome rendering the page. http://code.google.com/chrome/chromeframe/ I just need to set this in my <meta http-equiv="X-UA-Compatible" content="chrome=1" /> But I can't seem to be able to get the <meta /> tag inside of without turning off the salesforce header. I want to do this: <meta http-equiv="X-UA-Compatible" content="chrome=1" />