• asadim2
  • NEWBIE
  • 155 Points
  • Member since 2009

  • Chatter
    Feed
  • 4
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 70
    Questions
  • 71
    Replies
The following SOSL fails, even when re-written in SOQL or used in a query for-loop, when there are 100K+ Contacts in the org:
FIND :value1 IN ALL FIElDS RETURNING Contact(Id WHERE PKG__Field__c = :value2 OR (Lastname = :value3 OR Name = :value4))
The error is: System.QueryException: Non-selective query against large object type (more than 100000 rows)

I know why it's failing but I don't know how to fix it! I can't split this into 2 queries/searches either because the where-clause is ORed which means I have no choice but to query with the custom non-indexed field.

Note that this SOSL only fails when ran in a trigger!
I have this very simple script on the JSforce script executor (https://jsforce.github.io/document/#tooling-api):
var apexBody = "<apex:page standardController='Account'>Test</apex:page>"; conn.tooling.sobject('ApexPage').create({ markup: apexBody, name: "PageTest", masterlabel: "PageTestLabel" }, function(err, res) { if (err) { return console.error(err); } console.log(res); });

I am in a DE org as Sys Admin. I recall getting the same error while ago when I tried the Tooling API in Apex:
FIELD_INTEGRITY_EXCEPTION: Object type not accessible. Please check permissions and make sure the object is not in development mode: sObject type 'Account' is not supported.. Original queryString was: 'SELECT Id FROM Account WHERE id = '000000000000000'': Markup

The script works without setting standardController in the markup. Any ideas? Thanks.
Running the following query in Developer Console using Tooling API fails.
SELECT Id FROM Account WHERE id = '000000000000000'

Error: sObject type 'Account' is not supported.

Same query runs fine without the Tooling API. I am the System Admin in a Developer Edition org. Any ideas? Thanks.
The following 2 points should explain everything:

1. Code coverage in production is 74% (cleared all tests, then re-ran all to make sure). When deploying a single field (some dummy test field) from the sandbox we get this error:
Your code coverage is 63%. You need at least 75% coverage to complete this deployment.

2. Production is on Summer '15. Sandbox is not. Regardless, we hardly have multi-line code anywhere (maybe 1% of all Apex code).

Why is production code coverage falling to some obscure value during deployment of changesets?
Hello Helpers


by mistake I  started  recursive  batch class  chain

In the batch  finsih()  method  I  inserted a call for the same batch

Now  I  have a  batc running for  half  day  I  can not stop  it

Abor  does  not work If  i try to abort  I  get the be,ow  message
Failed to Abort Job Unable to remove job from Apex Job Queue.

I  need to stop  this  somehow
What  opton I have?

In the specs  I sew  that  "You can submit up to 5,000 batches per rolling 24 hour period."

but  since start my batch run more then 5000 times    


regards
csaba
Controller:
public class TestRerenderController
{
    public List<String> titles { get; set; }
    public List<VO> vos { get; set; }
    
    public TestRerenderController()
    {
        titles = new String[]{'Title A', 'Title B', ' Title C'};
        
        vos = new List<VO>();
        vos.add(new VO('text a'));
        vos.add(new VO('text b'));
        vos.add(new VO('text c'));
    }
    
    public void hi()
    {
        titles.add('Title D');
        vos.add(new VO('text d'));
    }
    
    public class VO
    {
        public String text { get; set; }
        public VO(String s)
        {
            text = s;
        }
    }
}

VF page:
<apex:page controller="TestRerenderController" id="p">
    <apex:form id="f">
    <apex:pageBlock id="pb">
        <apex:variable value="{!-1}" var="index"/>
        <apex:repeat value="{!titles}" var="title">
            <b>{!title}</b><br/>
            <apex:variable value="{!index+1}" var="index"/>
            <apex:inputText value="{!vos[index].text}"/><br/>
            <apex:commandLink action="{!hi}" value="Add D row" reRender="pb"/>
            <br/><br/>
        </apex:repeat>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Problem 1:
When the commandLink on each row except the last one is clicked, I get a new row but all the input fields reset to their original values. However if I change the value of the last row and click the link on the last row, the value is remembered.

Problem 2:
On click of the link, if I rerender the page instead of pageBlock I don't get a new row. Any ideas why?!

To make it simple you can directly copy/paste above code into your org and test.
Controller:
public class TestRerenderController
{
    public List<String> text { get; set; }
    
    public TestRerenderController()
    {
        text = new List<String>();
        text.add('a');
        text.add('b');
        text.add('c');
    }
    
    public void hi()
    {
    }
}

VF page:
<apex:page controller="TestRerenderController" id="p">
    <apex:form >
        <apex:repeat value="{!text}" var="t">
            <apex:inputText value="{!t}"/><br/>
        </apex:repeat>
        <br/>
        <apex:commandLink action="{!hi}" value="Click me" reRender="p"/>
    </apex:form>
</apex:page>

Error when saving the page:
Error: Unknown property 't'


What gives?!
I don't understand how we can store Geolocation values that are not in degrees (i.e. different spatial reference) in SF. Seems like the 2 available sub-types for Geolocation fields are the same. I thought choosing Decimal would allow for non-degree values, but it doesn't work.

To make the problem less technical, how can I enter 665679.879932 as latitude in SF?

Thanks.
Issue: If a parent object is deleted, the Date fields on the now-orphan children show as today in VF when binded using outputFields. If using outputText the proper value (empty) is shown.


Scenario:
2 objects: Car__c is the parent for Part__c

Excerpt from controller (partly pseudo):
public Schema.FieldSetMember[] carFields { get; set; }
public Part__c[] parts { get; set; }

public Controller()
{
    carFields = list of fields from Fieldset containing Model__c, CreatedDate, Intro_Date__c
    parts = [select Name, Car__r.Model__c, Car__r.CreatedDate, Car__r.Intro_Date__c from Part__c];
}

Excerpt from VF page (a table with a list of part Names + their corresponding Car info):
<apex:pageBlockTable value="{!parts}" var="part">

    <!-- Part Name -->
    <apex:column value="{!part.Name}">

    <!-- Car Fields -->
    <apex:repeat value="{!carFields}" var="f">
        <apex:column>
            <apex:outputField value="{!part.Car__r[f]}"/>
        </apex:column>
    </apex:repeat>

</apex:pageBlockTable>

The resulting table looks like this:
Name____Model__Created Date__Intro Date
=======================================
Gear____Benz___4/9/2013______1/4/2013
Knob____BMW____6/8/2012______6/7/2012
Screw__________5/5/2014______5/5/2014 < CHILD DELETED >
Pedal__________5/5/2014______5/5/2014 < CHILD DELETED >
Bushing_Audi___3/5/2011______________
This seems like a bug to me. Anything I'm missing?

You know how you need to use Changesets to deploy stuff from sandbox to production? So am I going to run into errors if my code tries to create Apex classes and VF pages in a production org?

Thanks.

I am pretty sure Salesforce doesn't support this in Apex -or does it?! If not then does that mean I have to use the Streaming API? But that would involve Visualforce, and I'm hoping to find a solution only in Apex.

 

Thanks!

Hi,

 

Can we add method block inside the Trigger file? We got a scenario of executing the common block of statements for two set of records, which run serially. Can anyone assist me?

 

Regards,

SuBaa