• SoCal Admin
  • NEWBIE
  • 75 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 17
    Replies
Does anyone know what might cause this?
I'm using SOAP and the result clearly shows SUCCESS.  I've also updated the NAME of the item in the same update, so I know that the request works - but it appears to be silently dropping the update for IsPrivate.

I've verified that I can manually update the IsPrivate field for any individual record using WorkBench, but multiple (i.e. CSV file) updates also fail using the WorkBench.  Here is says that the value of 'false'  is an XSD:Boolean type which must be '0','1','true', or 'false'.

I've tried every variation I can think of.
Solves missing Salesforce feature...

 

Are there any methods to capture the Govenor limit / summary info from custom apex methods and classes?

 

i.e.

 

1) Class created

2) Methods Created

3) Trigger is executed -> Code and Queries evaluated -> Written to Debug logs

 

But I need to write the Govenor Limit info to some other target using Code inside the method

 

Are there any object/variable/properties or run-time data structures(objects/variables/properties) that contain the information for the resulting queries/api calls, etc...

Anyone know how to download the debug logs programmatically?

 

Are they stored in a specific object or are they only accessible from a GUI?

 

I'd like to download them and review them automatically using PHP and create internal exception reports.

Eclipse is broken and will not start up.  I've been using it for months but today I received a big window that basically lists the eclipse.ini paramteters obtained from whereever eclipse pulls them from.

 

Originally I had java sdk  1.7 and I saw many posts that said 1.7 would cause problems.  But I uninstalled all java Updates and Java and installed 1.6u39 and it still fails.

 

Java and javac are working fine and are correct versions 1.6.  I have other Java apps which will not run without Java and they work fine with 1.6.

 

Of course the Failure popup message is a GUI window - not a TEXT window - where I could copy and paste the error here.

 

Of course the Force.Com IDE app does have an uninstall utility.

 

Any re-installation works fine until AFTER the Pulse updates are downloaded after which it shows the failure window and forces an exit.

 

I've already re-installed the Force.Com IDE and JDK 1.6 on another PC successfully, so I know the install files are fine. (both machines are 32 bit)

 

Does anyone know how to completely remove every file and registry entry (if any) that the Force.Com IDE installs?  As it is, it is completely unusable and unstartable.  I've also tried Command Line launch methods that fail the same way found from google searches.

 

 

 


Anyone know what this error means?  I really need one working example of an upsert to a custom object using the Partner wsdl - but I can't find one.  I see all kinds of examples of inserts to Standard Objects - but not custom objects.


The login is fine, but the upsert fails.

        $sObject = new stdclass();
        $sObject->CustomerName__c = $Cust;
        $sObject->Title__c = $title;
        $sObject->Info__c = $data;
        $sObject->Type = 'mycustomobject__c';  // Is this correct?

        $result = $conn->upsert($Logid,array($sObject),'Mycustomobject__c');
        print("<HR>");
        print_r($result);
        print "<hr>";
    } catch (exception $e) {
        print "<hr>ERROR:";
        print_r($e);
        print "<hr>";
    }

 

ERROR:SoapFault Object ( [message:protected] => SOAP-ERROR: Encoding: object has no 'type' property [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\wamp\www\soapclient\SforceBaseClient.php [line:protected] => 514 [trace:Exception:private] => Array ( [0] => Array ( [file] => C:\wamp\www\soapclient\SforceBaseClient.php [line] => 514 [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => upsert [1] => Array ( [0] => stdClass Object ( [externalIDFieldName] => SoapVar Object ( [enc_type] => 101 [enc_value] => a1BE0000002WlLnMAK [enc_stype] => string [enc_ns] => http://www.w3.org/2001/XMLSchema ) [sObjects] => Array ( [0] => stdClass Object ( [ID] => a1BE0000002WlLnMAK [Project__c] => a1DE0000000yrqwMNA [Subject__c] => Casting Corner  [Detail__c] => Q2222 3/12/2013 Boom Box Corporation 1.000000 DOOR (Boom) 2471.630000 16'2" x 14'1" [Type] => mycustomobject__c ) ) ) ) ) ) [1] => Array ( [file] => C:\wamp\www\soapclient\SforceBaseClient.php [line] => 514 [function] => upsert [class] => SforceSoapClient [type] => -> [args] => Array ( [0] => stdClass Object ( [externalIDFieldName] => SoapVar Object ( [enc_type] => 101 [enc_value] => a1BE0000002WlLnMAK [enc_stype] => string [enc_ns] => http://www.w3.org/2001/XMLSchema ) [sObjects] => Array ( [0] => stdClass Object ( [ID] => a1BE0000002WlLnMAK [Project__c] => a1DE0000000yrqwMNA [Subject__c] => Casting Corner  [Detail__c] => Q2222 3/12/2013 Boom Box Corporation 1.000000 DOOR (Boom) 2471.630000 16'2" x 14'1" [Type] => mycustomobject__c ) ) ) ) ) [2] => Array ( [file] => C:\wamp\www\soapclient\SforcePartnerClient.php [line] => 194 [function] => _upsert [class] => SforceBaseClient [type] => -> [args] => Array ( [0] => stdClass Object ( [externalIDFieldName] => SoapVar Object ( [enc_type] => 101 [enc_value] => a1BE0000002WlLnMAK [enc_stype] => string [enc_ns] => http://www.w3.org/2001/XMLSchema ) [sObjects] => Array ( [0] => stdClass Object ( [ID] => a1BE0000002WlLnMAK [Project__c] => a1DE0000000yrqwMNA [Subject__c] => Casting Corner  [Detail__c] => Q2222 3/12/2013 Boom Box Corporation 1.000000 DOOR (Boom) 2471.630000 16'2" x 14'1" [Type] => mycustomobject__c ) ) ) ) ) [3] => Array ( [file] => C:\wamp\www\porog\library.inc [line] => 32 [function] => upsert [class] => SforcePartnerClient [type] => -> [args] => Array ( [0] => a1BE0000002WlLnMAK [1] => Array ( [0] => stdClass Object ( [ID] => a1BE0000002WlLnMAK [Project__c] => a1DE0000000yrqwMNA [Subject__c] => Casting Corner  [Detail__c] => Q2222 3/12/2013 Boom Box Corporation 1.000000 DOOR (Boom) 2471.630000 16'2" x 14'1" [Type] => mycustomobject__c ) ) [2] => mycustomobject__c ) ) [4] => Array ( [file] => C:\wamp\www\porog\testfile.php [line] => 203 [function] => UpsertLog [args] => Array ( [0] => SforcePartnerClient Object ( [sforce:protected] => SforceSoapClient Object ( [trace] => 1 [compression] => 32 [_encoding] => utf-8 [_features] => 1 [_user_agent] => salesforce-toolkit-php/20.0 [_soap_version] => 1 [sdl] => Resource id #11 [__last_request_headers] => POST /services/Soap/u/27.0/00DE0000000KMbe HTTP/1.1 Host: na9-api.salesforce.com Connection: Keep-Alive User-Agent: salesforce-toolkit-php/20.0 Accept-Encoding: gzip, deflate Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 612 [__last_response_headers] => HTTP/1.1 200 OK Date: Wed, 20 Mar 2013 00:21:35 GMT Content-Type: text/xml;charset=UTF-8 Content-Encoding: gzip Content-Length: 370 [location] => https://na9-api.salesforce.com/services/Soap/u/27.0/00DE0000000KMbe [httpsocket] => Resource id #16 [_use_proxy] => 0 [httpurl] => Resource id #19 [__default_headers] => Array ( [0] => SoapHeader Object ( [namespace] => urn:partner.soap.sforce.com [name] => SessionHeader [data] => Array ( [sessionId] => 00DE0000000KMbe!AR8AQCyz2KQ5ZArk9BpZcwSSxH55VH_r8Qh5w3HKS6swXluzsxSSniRr0_lunxMOEsIOslVw8oBM5GmhqcrzhZpy97ln1QIR ) [mustUnderstand] => ) ) [__soap_fault] => SoapFault Object *RECURSION* ) [sessionId:protected] => 00DE0000000KMbe!AR8AQCyz2KQ5ZArk9BpZcwSSxH55VH_r8Qh5w3HKS6swXluzsxSSniRr0_lunxMOEsIOslVw8oBM5GmhqcrzhZpy97ln1QIR [location:protected] => https://na9-api.salesforce.com/services/Soap/u/27.0/00DE0000000KMbe [version:protected] => 20.0 [namespace:protected] => urn:partner.soap.sforce.com [callOptions:protected] => [assignmentRuleHeader:protected] => [emailHeader:protected] => [loginScopeHeader:protected] => [mruHeader:protected] => [queryHeader:protected] => [userTerritoryDeleteHeader:protected] => [sessionHeader:protected] => SoapHeader Object ( [namespace] => urn:partner.soap.sforce.com [name] => SessionHeader [data] => Array ( [sessionId] => 00DE0000000KMbe!AR8AQCyz2KQ5ZArk9BpZcwSSxH55VH_r8Qh5w3HKS6swXluzsxSSniRr0_lunxMOEsIOslVw8oBM5GmhqcrzhZpy97ln1QIR ) [mustUnderstand] => ) [allowFieldTruncationHeader:protected] => [localeOptions:protected] => [packageVersionHeader:protected] => [client_id:protected] => ) [1] => a1BE0000002WlLnMAK [2] => a1DE0000000yrqwMNA [3] => Casting Corner  [4] => Q2222 3/12/2013 Boom Box Corporation 1.000000 DOOR (Boom) 2471.630000 16'2" x 14'1" ) ) ) [previous:Exception:private] => [faultstring] => SOAP-ERROR: Encoding: object has no 'type' property [faultcode] => Client [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/ [xdebug_message] => ( ! ) SoapFault: SOAP-ERROR: Encoding: object has no 'type' property in C:\wamp\www\soapclient\SforceBaseClient.php on line 514 Call Stack #TimeMemoryFunctionLocation 10.0016169000{main}( )..\testfile.php:0 20.8622836952UpsertLog( )..\testfile.php:203 30.8622838104SforcePartnerClient->upsert( )..\library.inc:32 40.8622838968SforceBaseClient->_upsert( )..\SforcePartnerClient.php:194 50.8623839104SforceSoapClient->upsert( )..\SforceBaseClient.php:514 )

 

Does anyone see anything wrong with this?  This is bizarre.  If I replace the field "id" with "Name", it works fine.  ID is clearly listed in the return results.  But I cannot assign or read the value using standard syntax.  Originally, I had one PRINT statement with 2 references ( ->Name and -> Id), Trying to figure it out, I created the top 2 variable assignments hoping that the failure was related to PRINT and not to ASSIGNMENT - but no - it fails everywhere.

 

The query works fine and any reference to the returned record set using NAME works fine - but I can't access the ID field.

 

 $query = "SELECT Id,Name from MycustomObject__c where somevalue=something;  // Query works FINE -> Don't look here

 

            $id = $r->records[0]->fields->Id;       // This DOESN'T WORK     ***
            $id = $r->records[0]->fields->Name;     // This works fine.

 

            print "<ul>Found Job Number " . $arr[8] . " in Project " . $r->records[0]->fields->Name . " / id=" . $id . "</ul>";

 

 

Here is the result from print_r:

 

QueryResult Object ( [queryLocator] => [done] => 1 [records] => Array ( [0] => SObject Object ( [type] => MycustomObject__c [fields] => stdClass Object ( [Name] => Samptom Excelite ) [Id] => a1DE0000000yRAINAM ) ) [size] => 1 )

I've been using the Enterprise WSDL for a while and am now switching to the Partner wsdl.  I generated a new partner wsdl and copied it to my config.

 

But I'm missing fields in my query using the Partner WSDL.   I originally created a php script that worked fine using the Enterprise wsdl, but once I switched to the Partner wsdl, several fields are missing from the query.

 

I have already verified that the fields and query are correct by copying and pasting the same exact query to the Force.com explorer and the custom field is definitely there.  And -> Using "print_r" in php -> it's definitely *not* there.   And iw *was* there when I was using the Enterprise wsdl.  I'm being forced to migrate to the partner wsdl to obtain added functionality that we can't get using the Enterprise wsdl.

 

Is there some sort of API setting I need to set somewhere to see the custome field using the Partner wsdl?

 

Dear Salesforce Development Team:   Please fix the Deployment / Unit Testing process.

 

We do NOT need to recompile every line of Unit Testing code for a single class update.

 

This results in 98% Wasted compiler time and a 15 minute wait time for every minor change - which could be completed in 30 seconds.

 

Contact me if you need ideas - I have many.

 

Why do we need to perform unit testing for classes that were compiled yesterday, and the day before that, and the day before that, and every day for the last 2 months - for a class that doesn't reference them?

 

This is the biggest waste of time by **far**.  There are client-side and server-side solutions to address this.

 

This is a nightmare.

Can someone please forward this to development:

 

There is no reason to test UNRELATED classes when deploying Apex classes and triggers.

 

If I use Eclipse to deploy ONE FREAKING class - there is no reason to TEST the entire metadata.

 

Is there any way to disable tests for UNRELATED CLASSES?


Salesforce is ***INCREDIBLY*** slow (15 minutes) for EACH deployment which should be done in 30 seconds. (or 10...)

 

Are there any OVERRIDE features to get past this poor design?  Or is it Working as Designed to waste time?

 

Please take the Unnecessary Elements out of your design work.

 

I developed a Chart from a custom salesforce object, but I'm trying in vain to assign a value to a public class variable.

 

I'm trying to add String data from a LIST<>[Select] output (which works correctly) to a class variable so the TITLE of the chart in the Visualforce page can access it, but I can't seem to SET the value to the public variable.

 

Obtaining the actual value from the List<>[Select] is easy and works (as tested in Execute Anonymous query}.  SETTING the value appears impossible.  Is there a special notation when assigning values to variables that are defined by "{ get;set;}?

 

 

I have the following:

 

public class zchartController {

        public String RecentDate { get ; set; }   //  This is where the Controller added the reference.

        //  I also tried putting the LIST<>[Select] here.

...

public static List<Data> getChartData() {

        List<MyObj__c> CurrentDates = [Select OrderDate__C from MyObj__c order by OrderDate__c Limit 1];
        //    RecentDate = CurrentDates.get(0).OrderDate__c;
...

}

...

}

 

 

 

 

Anyone know how to get Charting to use math instead of concatenation?  The Chartclass is concatenating decimal variables instead of adding them.

 

I'm trying to create a stacked bar graph of 5 different products.  DeveloperConsole output shows the queried values are correct.

 

But when I try to SUM to values to create the Y Axis, it ends up like this: (see highlight)

 

from DeveloperConsole:

 

VCur: 3433.23

lmonth:    1222.32

lqtr:   454.34

lsales:  887.34

lprod: 232.23

vTotal:  3433.231222.32454.34887.34232.23

 

(this is a defined as a Decimal variable - how is this possible)?

 

I also tried casting each value - but no luck.

 

 

Here is the code:
 Decimal VCur;
        Decimal lmonth;
        Decimal lqtr;
        Decimal lsales;
        Decimal lprod;
     
        
        List<AggregateResult> qCur = [Select Sum(salesAmt__c) Sum from CTest__c where... ];
        List<AggregateResult> qmonth = [Select sum(salesAmt__c) Sum from CTest__c where ... ];
        List<AggregateResult> qqtr = [Select sum(salesAmt__c) Sum from CTest__c where ...];
        List<AggregateResult> qsales = [Select sum(salesAmt__c) Sum from CTest__c where ...];                
        List<AggregateResult> qprod = [Select sum(SalesAmt__c) Sum from CTest__c where...];                
       
        for (AggregateResult ar : Cur) {
            vCur = (Decimal)ar.get('Sum');
        }
                System.Debug('VCUR = ' + vCur);

        for (AggregateResult ar : qmonth) {
            lmonth = (Decimal)ar.get('Sum');
        }
                System.Debug('lmonth = ' + lmonth);

        for (AggregateResult ar : qqtr) {
            lqtr = (Decimal)ar.get('Sum');
        }
                System.Debug('lqtr = ' + lqtr);

        for (AggregateResult ar : qqtr) {
            lsales = (Decimal)ar.get('Sum');
        }
                System.Debug('lsales = ' + lsales);

        for (AggregateResult ar : qprod) {
            lprod = (Decimal)ar.get('Sum');
        }
                System.Debug('lprod = ' + lprod);

        Decimal vTotal = vCur + lmonth + lqtr + lsales + lprod;
        System.Debug('vTotal = ' + vCur + lmonth + lqtr + lsales + lprod);         

Does anyone know if there is a comprehensive reference guide for charts and graphs?  I've already gone through and completed the simple tutorials for adding 1,2,3 line series to a a simple graph.

 

I need to find detailed information on creating a stacked bar chart i Apex / Visual force such as "all" the options, background colors, etc...

I'm used to using re-entrant code in single php web pages.  It's simpler in a lot of ways, but can someone confirm if VisualForce pages can be used re-entrantly?  (Yes - that's a word - I just made it up).

 

I used to use PHP SESSION variables to maintain the state of the user process to show or bypass each step of a process and I could do everything in one PHP file (small company)

 

Very common structure (one php file)

================================

1) if USER/PWD variables NOT set, show login screen form and die

2) if SEARCH variable not set, show search screen form and die

3) if SELECTED options not set then display Options Form and die

4) Process Selected Option, Show toolbar for related tasks, next steps and die

 

If I have a VF form with a text search/lookup feature,  what is the best

way to perform the next step in the process?  (step 3)?

 

Store the results in a class variable?

Pass the results to a separate, unique Visual Force page?

Use the same VF page re-entrantly with conditional / variable processing?

 

I'm a little confused since the ACTION of a submission button is a Class Method instead of a target web page.  Do I simply include a PageReference in the method and return to the same page and access the variables from the class?

 

 

 

Hi Everyone!

 

I'm a newbie to apex code and I'm tryng out a new user-based SOSL query in a visual force page. But  I don't understand the resulting LIST or how to iterate over it using a FOR statement.

 

I perform a SOSL query with the following:

List<List<Myobject>> searchList = [FIND '*00*' IN ALL FIELDS RETURNING Myobject];

 

it seems to work correctly based on the logs from the DeveloperConsole.

 

I get this data back (from DeveloperConsole System.Debug):

USER_DEBUG   [34][DEBUG] Items Found: 1

USER_DEBUG   [34][DEBUG] ITEM: (Myobject:{Id=01tE0000000MKAYIA4}, Myobject:Id=01tE0000000MKAUIA4}, Myobject:Id=01tE0000000MKASIA4}, Myobject:Id=01tE0000000MKATIA4}, Myobject:Id=01tE0000000MKANIA4}, Myobject:Id=01tE0000000MKAQIA4},...)

 

The output was doctored because I didn't spend time to find a text export of the logs,

 

But the SIZE property returns "1" as indicated in the logs and a FOR loop does not work as expected.  It seems I may have a Single List of a multi-valued List (as indicated in the code above).

 

How do I get this to work in FOR loop to iterate over the the returning values?

How can I bypass the List<List<myobject>> to replace it with List<MyObject>?

 

Why do I need to use the List<List<>> syntax at all?  It was the only way I could get it to return the list set.

 

Here is the For Loop:

 

for (List<MyObject> s1 : searchList) {
        System.Debug('Item: ' + s1);
        i++;
  }

 

 

 

 

 

 

I received the following exception message after I moved the following code to production:

       System.LimitException: Too many SOQL queries: 101

 

I want to compare a value in the current record being saved against the top 5 values in the accounts table.  I should only be running ONE query per update - but somehow it's running a lot more.

 

It works fine when *testing* DEV and PRODUCTION, so I think some periodic process in Salesforce is sending a *batch* of records to the trigger instead of just one and it appears to be a lot of records at once.  Additionally, I only want the SOQL query to run if the user types a '?' in the custom field..

 

Anyone have any suggestions?  Perhaps if I move the SELECT statement into the IF statement.  I'm very familiar with queries in general - just not familiar with Apex syntax.

 

 

public static void checknumber(Account[] rur) {

 

for(Account m:rur) {
            

              Account[] acc = [Select inbr__c from Account where inbr__c > 35000 order by inbr__c desc limit 5

 

             if (myfield == '? ') {

                   //do_stuff_here

            }

 

}

 

How are unpopulated fields handled in the PHP/WSDL framework?

 

I'm querying all records in a custom object.  The records with unpopulated fields return:

 

PHP Notice:  Undefined property: SObject::$Project_Manager__c in /var/www/testing/test.php on line 25

 

It ends up with some records being read correctly, but others have 1 error message like the above for every field that is blank (or null).

In this case, it's not possible to check if a field (or property) is null, because the property is not "in the record"(or object) if it is null.  This is like having variant records:  If an object has 20 fields, then there are potentially 18 factorial layouts.

 

Are we supposed to check for the existence of a field property before we access the value?  This doesn't make sense when the property is specified in the query string.

 

I just verifiied that - that is exactly how it is working.  If I edit the SalesForce record and populate the field.  The error goes away, but if I delete the value after that and re-submit, the error returns.

 

This appears to be a bug - the very least is incorrect error message.  The error message should be: "NULL Value processising not supported" or something to that effect - not "Undefined Property".

 

Here are 3 records from the same object.  Note the missing fields from 52 and 54.

 

[52] => SObject Object
(
[type] =>
[fields] =>
[Name] => Stonson Plaid
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a1D3433d0008dznMAA
)

[53] => SObject Object
(
[type] =>
[fields] =>
[Account_List__c] => 27628
[Account__c] => 003434343434338VhqIAF
[Job_Location__c] => 232323
[Location__c] => a10454343430L2nEIAS
[Name] => Ring Filler
[Order_List__c] => 1
[Salesman__c] => Jonman
[Id] => a1DE00000008bCvMAI
)

[54] => SObject Object
(
[type] =>
[fields] =>
[Name] => Bill Thompson
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a3DE00000008345MAI
)

Hi everyone.

 

I'm new to Salesforce Toolkit 20.  Looking for info on accessing Custom fields in custom objects.

 

Query works fine in Force.com explorer and in PHP script, but output is not showing field names.  I've updated the enterprise.wdsl.xml file and clearly see the Correct custom field info in the xml file, but query looks like this:

 

$query = "Select Id, NameInfo__c, data__c from customobject"

 

and output looks like this:

 

SObject Object

(  

 [type] =>    

 [fields] =>    

  [Id] => a1eE0000000LABcIAO

)

 

SObject Object

(

[type] =>    

[fields] =>    

[Id] => a1eE0000000LABdIAO

)

 

SObject Object

(    

[type] =>    

[fields] =>    

[Id] => a1eE0000000LABeIAO

)

 

The ID can be printed with $record->ID.  How do I reference the custom fields?  Any attempt ends with "Undefined property: SObject::$NameInfo or   ...NameInfo__c     

 

Any suggestions or recommendations for where to look next?

Solves missing Salesforce feature...

I've been using the Enterprise WSDL for a while and am now switching to the Partner wsdl.  I generated a new partner wsdl and copied it to my config.

 

But I'm missing fields in my query using the Partner WSDL.   I originally created a php script that worked fine using the Enterprise wsdl, but once I switched to the Partner wsdl, several fields are missing from the query.

 

I have already verified that the fields and query are correct by copying and pasting the same exact query to the Force.com explorer and the custom field is definitely there.  And -> Using "print_r" in php -> it's definitely *not* there.   And iw *was* there when I was using the Enterprise wsdl.  I'm being forced to migrate to the partner wsdl to obtain added functionality that we can't get using the Enterprise wsdl.

 

Is there some sort of API setting I need to set somewhere to see the custome field using the Partner wsdl?

 

Dear Salesforce Development Team:   Please fix the Deployment / Unit Testing process.

 

We do NOT need to recompile every line of Unit Testing code for a single class update.

 

This results in 98% Wasted compiler time and a 15 minute wait time for every minor change - which could be completed in 30 seconds.

 

Contact me if you need ideas - I have many.

 

Why do we need to perform unit testing for classes that were compiled yesterday, and the day before that, and the day before that, and every day for the last 2 months - for a class that doesn't reference them?

 

This is the biggest waste of time by **far**.  There are client-side and server-side solutions to address this.

 

This is a nightmare.

Hi,

 

I just want to send a single mail with an attachment, I have written something like this

Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
        String toAddresses = 'ashishborate@xyz.com';
        List<String> addr = new List<String>();
        addr.add(toAddresses);
        String subject ='Account CSV';
        email.setToAddresses(addr);
        email.setSubject(subject);
        email.setPlainTextBody('Account CSV');
        email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
        email.emailPriority='low';
        System.debug('Sending Email @@ '+email);
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
        System.debug('SendEmailResult @@ '+r);

 Where, debug gives me, but I am not getting any mail. Kindly help.

SendEmailResult @@(Messaging.SendEmailResult[getErrors=();isSuccess=true;]

 Thanks,

Ashish.

 

I developed a Chart from a custom salesforce object, but I'm trying in vain to assign a value to a public class variable.

 

I'm trying to add String data from a LIST<>[Select] output (which works correctly) to a class variable so the TITLE of the chart in the Visualforce page can access it, but I can't seem to SET the value to the public variable.

 

Obtaining the actual value from the List<>[Select] is easy and works (as tested in Execute Anonymous query}.  SETTING the value appears impossible.  Is there a special notation when assigning values to variables that are defined by "{ get;set;}?

 

 

I have the following:

 

public class zchartController {

        public String RecentDate { get ; set; }   //  This is where the Controller added the reference.

        //  I also tried putting the LIST<>[Select] here.

...

public static List<Data> getChartData() {

        List<MyObj__c> CurrentDates = [Select OrderDate__C from MyObj__c order by OrderDate__c Limit 1];
        //    RecentDate = CurrentDates.get(0).OrderDate__c;
...

}

...

}

 

 

 

 

Anyone know how to get Charting to use math instead of concatenation?  The Chartclass is concatenating decimal variables instead of adding them.

 

I'm trying to create a stacked bar graph of 5 different products.  DeveloperConsole output shows the queried values are correct.

 

But when I try to SUM to values to create the Y Axis, it ends up like this: (see highlight)

 

from DeveloperConsole:

 

VCur: 3433.23

lmonth:    1222.32

lqtr:   454.34

lsales:  887.34

lprod: 232.23

vTotal:  3433.231222.32454.34887.34232.23

 

(this is a defined as a Decimal variable - how is this possible)?

 

I also tried casting each value - but no luck.

 

 

Here is the code:
 Decimal VCur;
        Decimal lmonth;
        Decimal lqtr;
        Decimal lsales;
        Decimal lprod;
     
        
        List<AggregateResult> qCur = [Select Sum(salesAmt__c) Sum from CTest__c where... ];
        List<AggregateResult> qmonth = [Select sum(salesAmt__c) Sum from CTest__c where ... ];
        List<AggregateResult> qqtr = [Select sum(salesAmt__c) Sum from CTest__c where ...];
        List<AggregateResult> qsales = [Select sum(salesAmt__c) Sum from CTest__c where ...];                
        List<AggregateResult> qprod = [Select sum(SalesAmt__c) Sum from CTest__c where...];                
       
        for (AggregateResult ar : Cur) {
            vCur = (Decimal)ar.get('Sum');
        }
                System.Debug('VCUR = ' + vCur);

        for (AggregateResult ar : qmonth) {
            lmonth = (Decimal)ar.get('Sum');
        }
                System.Debug('lmonth = ' + lmonth);

        for (AggregateResult ar : qqtr) {
            lqtr = (Decimal)ar.get('Sum');
        }
                System.Debug('lqtr = ' + lqtr);

        for (AggregateResult ar : qqtr) {
            lsales = (Decimal)ar.get('Sum');
        }
                System.Debug('lsales = ' + lsales);

        for (AggregateResult ar : qprod) {
            lprod = (Decimal)ar.get('Sum');
        }
                System.Debug('lprod = ' + lprod);

        Decimal vTotal = vCur + lmonth + lqtr + lsales + lprod;
        System.Debug('vTotal = ' + vCur + lmonth + lqtr + lsales + lprod);         

Hi all,

 

Is it possible to iterate through records in visualforce and place them into parallel columns?

 

For example, instead of it being:

Name    Number     Location
Name    Number     Location

 

It would be:

Name   Number    Location       Name    Number    Location

Name   Number    Location       Name    Number    Location

 

It would fill the first column going down, then continue of the top of the second column.

 

Thanks for your help.

Hi Everyone!

 

I'm a newbie to apex code and I'm tryng out a new user-based SOSL query in a visual force page. But  I don't understand the resulting LIST or how to iterate over it using a FOR statement.

 

I perform a SOSL query with the following:

List<List<Myobject>> searchList = [FIND '*00*' IN ALL FIELDS RETURNING Myobject];

 

it seems to work correctly based on the logs from the DeveloperConsole.

 

I get this data back (from DeveloperConsole System.Debug):

USER_DEBUG   [34][DEBUG] Items Found: 1

USER_DEBUG   [34][DEBUG] ITEM: (Myobject:{Id=01tE0000000MKAYIA4}, Myobject:Id=01tE0000000MKAUIA4}, Myobject:Id=01tE0000000MKASIA4}, Myobject:Id=01tE0000000MKATIA4}, Myobject:Id=01tE0000000MKANIA4}, Myobject:Id=01tE0000000MKAQIA4},...)

 

The output was doctored because I didn't spend time to find a text export of the logs,

 

But the SIZE property returns "1" as indicated in the logs and a FOR loop does not work as expected.  It seems I may have a Single List of a multi-valued List (as indicated in the code above).

 

How do I get this to work in FOR loop to iterate over the the returning values?

How can I bypass the List<List<myobject>> to replace it with List<MyObject>?

 

Why do I need to use the List<List<>> syntax at all?  It was the only way I could get it to return the list set.

 

Here is the For Loop:

 

for (List<MyObject> s1 : searchList) {
        System.Debug('Item: ' + s1);
        i++;
  }

 

 

 

 

 

 

I received the following exception message after I moved the following code to production:

       System.LimitException: Too many SOQL queries: 101

 

I want to compare a value in the current record being saved against the top 5 values in the accounts table.  I should only be running ONE query per update - but somehow it's running a lot more.

 

It works fine when *testing* DEV and PRODUCTION, so I think some periodic process in Salesforce is sending a *batch* of records to the trigger instead of just one and it appears to be a lot of records at once.  Additionally, I only want the SOQL query to run if the user types a '?' in the custom field..

 

Anyone have any suggestions?  Perhaps if I move the SELECT statement into the IF statement.  I'm very familiar with queries in general - just not familiar with Apex syntax.

 

 

public static void checknumber(Account[] rur) {

 

for(Account m:rur) {
            

              Account[] acc = [Select inbr__c from Account where inbr__c > 35000 order by inbr__c desc limit 5

 

             if (myfield == '? ') {

                   //do_stuff_here

            }

 

}

 

How are unpopulated fields handled in the PHP/WSDL framework?

 

I'm querying all records in a custom object.  The records with unpopulated fields return:

 

PHP Notice:  Undefined property: SObject::$Project_Manager__c in /var/www/testing/test.php on line 25

 

It ends up with some records being read correctly, but others have 1 error message like the above for every field that is blank (or null).

In this case, it's not possible to check if a field (or property) is null, because the property is not "in the record"(or object) if it is null.  This is like having variant records:  If an object has 20 fields, then there are potentially 18 factorial layouts.

 

Are we supposed to check for the existence of a field property before we access the value?  This doesn't make sense when the property is specified in the query string.

 

I just verifiied that - that is exactly how it is working.  If I edit the SalesForce record and populate the field.  The error goes away, but if I delete the value after that and re-submit, the error returns.

 

This appears to be a bug - the very least is incorrect error message.  The error message should be: "NULL Value processising not supported" or something to that effect - not "Undefined Property".

 

Here are 3 records from the same object.  Note the missing fields from 52 and 54.

 

[52] => SObject Object
(
[type] =>
[fields] =>
[Name] => Stonson Plaid
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a1D3433d0008dznMAA
)

[53] => SObject Object
(
[type] =>
[fields] =>
[Account_List__c] => 27628
[Account__c] => 003434343434338VhqIAF
[Job_Location__c] => 232323
[Location__c] => a10454343430L2nEIAS
[Name] => Ring Filler
[Order_List__c] => 1
[Salesman__c] => Jonman
[Id] => a1DE00000008bCvMAI
)

[54] => SObject Object
(
[type] =>
[fields] =>
[Name] => Bill Thompson
[Order_List__c] =>
[Salesman__c] => Harry
[Id] => a3DE00000008345MAI
)

Hi everyone.

 

I'm new to Salesforce Toolkit 20.  Looking for info on accessing Custom fields in custom objects.

 

Query works fine in Force.com explorer and in PHP script, but output is not showing field names.  I've updated the enterprise.wdsl.xml file and clearly see the Correct custom field info in the xml file, but query looks like this:

 

$query = "Select Id, NameInfo__c, data__c from customobject"

 

and output looks like this:

 

SObject Object

(  

 [type] =>    

 [fields] =>    

  [Id] => a1eE0000000LABcIAO

)

 

SObject Object

(

[type] =>    

[fields] =>    

[Id] => a1eE0000000LABdIAO

)

 

SObject Object

(    

[type] =>    

[fields] =>    

[Id] => a1eE0000000LABeIAO

)

 

The ID can be printed with $record->ID.  How do I reference the custom fields?  Any attempt ends with "Undefined property: SObject::$NameInfo or   ...NameInfo__c     

 

Any suggestions or recommendations for where to look next?

Hello,

I am currently try to use the Salesforce Python toolkit (http://code.google.com/p/salesforce-python-toolkit/).
However, most of the time, I get an annoying
"Connecting to Salesforce...
URL Connection ERROR :  <urlopen error [Errno 54] Connection reset by peer>".

Here is my code extract:

print "Connecting to Salesforce..."
from sforce.enterprise import SforceEnterpriseClient
h = SforceEnterpriseClient('enterprise.wsdl.xml')
h.login('user', 'pass', 'token')
print "Connection to Salesforce OK"


Can anyone please let me know what I might be doing wrong ?

Thanks,
Boris