• Lawrence-Accenture
  • NEWBIE
  • 35 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 26
    Replies

Hello,

 

Am using PHP toolkit 20.0 to perform some queries on Salesforce Contact object but all empty field values on the record, return the value "true".

 

The queryresult below show the values returned for the query. The fields Phone and Birthdate are both empty for this contact. But the value "true" is returned.

 

$result = $crmHandle->query('SELECT Id, Phone,Birthdate FROM Contact LIMIT 1');
QueryResult Object ( [queryLocator] => [done] => 1 [records] => Array ( [0] => SObject Object ( [type] => Contact [fields] => stdClass Object ( [Phone] => true [LastName] => ContactName [Birthdate] => true ) [Id] => 003M0000006YESuIAO ) ) [size] => 1 ) 

 

Why is the result of the query for empty fields not a blank string or null ? Is there something I must change in the query or when processing the results ? 

 

Thank you for your help

This idea: https://success.salesforce.com/ideaView?id=08730000000BrGFAA0 -- "isClone() within trigger" -- was posted seven years ago and was recently closed as being delivered in Winter '16. Does anyone know how it was delivered? Does anyone know how to do what the asker was asking for?

I'm aware there is a new sObject.isClone() method that was delivered in Winter '16, however that doesn't appear to work with records cloned in the UI, just records cloned within Apex using the sObject.clone() method. Same thing for the sObject.getCloneSourceId() method -- works if cloned via Apex, but not within the UI even though the documentation explicitly states "You can use it for objects cloned through the Salesforce user interface."

Or am I missing something? My trigger is using the latest Apex version (37.0). Has anyone been able to get this to work for records cloned in the UI?

Thanks,

-L
Is there a way to tell if an org is/is not on the "Government Cloud"? Is there a specific instance (na1, na2, ... other?) dedicated to the Government Cloud?

Is this article still valid?
Login tips and considerations for the Salesforce Government Cloud
https://help.salesforce.com/apex/HTViewSolution?id=000229902&language=en_US

If so, can I assume that if we *can* log in via login.salesforce.com that our org is *not* on the Government Cloud?
 
When serializing Apex objects, JSON.serialize() still includes null class variables even though the documentation seems to claim this was fixed back in Apex version 28. (I've tested with versions up to the current version -- 36)

Example Apex class:
public with sharing class xtmp_TestJSON {
    public String SomeText;
    public String SomeOtherText;
}
and test JSON.serialize() using:
xtmp_TestJSON req = new xtmp_TestJSON();
req.SomeText = 'Hi';

System.debug('====> data: ' + JSON.serialize(req));
Output is:
====> data: {"SomeText":"Hi","SomeOtherText":null}

Any suggestions on how to "fix" this?

Thanks,

-L

 
We are trying to use dynamic components/Apex to render the following PageBlockTable with a mix of input and output fields across a list of records:

<apex:pageblock title="New">
    <apex:pageBlockTable value="{!newItemsList}" var="new">
        <apex:column value="{!new.Name}"/>
        <apex:column headerValue="Quantity">
            <apex:inputField value="{!new.Quantity__c}" Id="Quantity"/>
        </apex:column>

This VF works fine as straight VF on the page, but we need to render this as a dynamic component. The output fields work fine, and the display of the input fields works fine as well, but when we submit the page (even without changing the value in the field), we get the following error:

Unknown property 'SObjectScriptRow.Quantity__c'
Error is in expression '{!rowRec.Quantity__c}' in component <apex:page> in page listItems

I can find nothing in the documentation, or elsewhere online related to "SObjectScriptRow". I know "Quantity__c" is a valid field on our records because it is able to render it correctly.

My theory is that the VF code/dynamic component code is loosing track of the source record when the page is being submitted and doesn't know what object the "rowRec"/"SObjectScriptRow" reference refers to for that field.

I know inputFields work through dynamic components as we have other dynamic components with input fields that do work. But those are in PageBlockSections and not in PageBlockTables (which also means there is only one record that those input fields are associated with, whereas in the PageBlockTable, there may be multiple rows that the VF engine has to iterate over to generate the table).

Any thoughts on what is wrong here? Or on how I can fix it?

Anyone from Salesforce who can confirm that this is or is not a bug in the underlying VF code?

Thanks,

---Lawrence

I just installed the latest  version of Force.com IDE (version 27.0) and the interface has changed quite a bit from the previous version I've used (20?). In particular there is no 'Save All' button and no 'Save All' item in any of the menus.... (In fact, there is no "Save" under the File menu anymore either...) Am I missing something obvious... has it been moved somewhere else that I'm not seeing?

 

Do I need to switch to a different perspective or something (I don't see any perspective-related menu items anywhere... The window says "Eclipse Provisioning" at the top, so I've looked several times because something doesn't seem right.)

 

Any other workaround for Save All that I'm missing? Now I'm not sure how to make changes to both an Apex class and a Test class at the same time and push both in. Do I need to work offline and then remember to push those in together?

 

Thanks!

 

---Lawrence

 

The following is the notes on a new feature around encrypted fields from the Spring '12 release notes:

 

---

Encrypted Fields Available in Full-Copy Sandbox

Starting in Spring ’12, a full-copy sandbox can include the encryption keys for encrypted fields. This means that if there are encrypted fields in your production organization, those fields are also available for viewing and use in a full-copy sandbox. Contact your salesforce.com representative to enable this feature.


Important: With this feature enabled, everyone with access to the full-copy sandbox can see the actual value of any encrypted field.

---

 

Can someone please clarify what the last statement (in red) means? Are you telling me that encrypted data that is production is only viewable by someone with the "View Encrpyted Data" flag set on their profile... that this data is now viewable by *everyone* in the sandbox *regardless* of the "View Encrypted Data" flag? I.e. anyone logging in to the sandbox can view this data? That seems like a *huge* security issue.

 

-L

i have created trigger in sandbox that avoid duplicate record creation on account object . in sandbox it is showing 100% code coverage while deploying that trigger in production using change set it is giving code coverage error your trigger has 0% code coverage ,every trigger atleast  require 1% code coverage
This idea: https://success.salesforce.com/ideaView?id=08730000000BrGFAA0 -- "isClone() within trigger" -- was posted seven years ago and was recently closed as being delivered in Winter '16. Does anyone know how it was delivered? Does anyone know how to do what the asker was asking for?

I'm aware there is a new sObject.isClone() method that was delivered in Winter '16, however that doesn't appear to work with records cloned in the UI, just records cloned within Apex using the sObject.clone() method. Same thing for the sObject.getCloneSourceId() method -- works if cloned via Apex, but not within the UI even though the documentation explicitly states "You can use it for objects cloned through the Salesforce user interface."

Or am I missing something? My trigger is using the latest Apex version (37.0). Has anyone been able to get this to work for records cloned in the UI?

Thanks,

-L
Hello All,

I am deploying a trigger with its test class having good coverage in Sandbox, but when I am deploying it production its showing 0% code coverage.
Please give your suggestions for the same.

Thanks,
Nida
Hi Guys

when I am cloning from UI by clicking "clone" standard button, Its returning :false. On the other hand if I am doing it from APEX its returning " True".

lead c = new lead(id='00Q9000000xfFHVEA2');
lead cd = c.clone();
system.debug(cd.isclone());

USER_DEBUG|[5]|DEBUG|true

Does anyone know how to identify a new reocrds was cloned from UI in apex.
 
"Your overall code coverage is currently 0%"

HUH? I was very unpleasantly surprised to find out, when I went to deploy my first custom class from SB to PROD, that my PROD is returning 0% code coverage (without my class!). This isn't possible... is it?

I am using out-of-the-box Salesforce with only one managed package: The Foundation's Nonprofit Start Pack v3. No custom code, repeat no code, no validations... the org is new. I have run all tests and I physcially see the majority of the managed TCs pass but it makes no difference at all. I just keep staring at 0% org wide coverage. I opened a CASE with SFDC Support and they turned me away. I went out to the forums and tried everything... Developer Console, Workbench... I have cleared the ApexCodeCoverage table and the ApexCodeCoverageAggregate table. I have compiled and recompiled... no difference. My zombie org sits at 0% code coverage and despite having only ONE custom class and TC in SB at 92% coverage... my hands are tied. I can't deploy anything.

PLEASE HELP.
When serializing Apex objects, JSON.serialize() still includes null class variables even though the documentation seems to claim this was fixed back in Apex version 28. (I've tested with versions up to the current version -- 36)

Example Apex class:
public with sharing class xtmp_TestJSON {
    public String SomeText;
    public String SomeOtherText;
}
and test JSON.serialize() using:
xtmp_TestJSON req = new xtmp_TestJSON();
req.SomeText = 'Hi';

System.debug('====> data: ' + JSON.serialize(req));
Output is:
====> data: {"SomeText":"Hi","SomeOtherText":null}

Any suggestions on how to "fix" this?

Thanks,

-L

 
Our sales team will clone opportunities with the same accounts for new upsell opps, but there is a critical Checkbox Field with a Validation Rule that we need to default as "FALSE" (unchecked) however, when the SR clones the record, the checkbox defaults as 'TRUE' which "lets" the rep unwittingly bypass the correct sales step that the Checkbox/validation rule is designed to guide against.  

I am trying to create some business logic that resets a cloned Opportunity check-box field to FALSE if that Opportunity record is cloned. 

Here is what I have tried:
IF (ISCLONE(), Example_Checkbox_field1__c = FALSE, Example_Checkbox_field1__c = TRUE)
I figured out that this rule is only accepted by the syntax checker if the Eval Criteria is set to "Created, and every time it's edited.'

However, this WFR does not work (I made sure it was Activated), cloning the opportunity still results with this Checkbox defaulted as TRUE in the record edit page. 

Is there a way to create a formula that sets the 'Example_Checkbox_field1__c' field to FALSE right after 'Clone' button was clicked and BEFORE the record is actually saved for the first time?
Hi, guys.

I have a strange problem here, which really pisses me off :(

So it is very simple, just typing in execute anonymous:
Account acc;
acc.getCloneSourceId();

Gives me an error:
"Compile error at line 2 column 1
Method does not exist or incorrect signature: [Account].getCloneSourceId()"

According to this (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm)article, this method should work with any SObject, but it doesn't work with any object...
Please, tell me what am I missing.



Thanks!
  • October 16, 2015
  • Like
  • 0
I created custom field using createMetadata call, and new custom field it created is not visible.
previousely, I use v.29, the new custom field created is visible.

I just installed the latest  version of Force.com IDE (version 27.0) and the interface has changed quite a bit from the previous version I've used (20?). In particular there is no 'Save All' button and no 'Save All' item in any of the menus.... (In fact, there is no "Save" under the File menu anymore either...) Am I missing something obvious... has it been moved somewhere else that I'm not seeing?

 

Do I need to switch to a different perspective or something (I don't see any perspective-related menu items anywhere... The window says "Eclipse Provisioning" at the top, so I've looked several times because something doesn't seem right.)

 

Any other workaround for Save All that I'm missing? Now I'm not sure how to make changes to both an Apex class and a Test class at the same time and push both in. Do I need to work offline and then remember to push those in together?

 

Thanks!

 

---Lawrence

 

Hi All,

 

when I am loading a visualforce page, I want the local system IP address to be printed on the screen .Is there any way  to do this?.

 

If any example with code will much appriciated.

 

 

Hi,

After looking at the documentation for the putSObject method (part of the SObject class), I still can't get it to work.

 

I have a print_pricing__c object and a child object called pricing_discount__c.

 

the getSObject method works fine:

discounts = pricing.getSObjects('print_discounts__r');

 

However, the corresponding putSObject method, I just can't seem to get to work.  It compiles fine, but at runtime, I get the following error:

System.SObjectException: Invalid relationship print_discounts__r for Print_Pricing__c 

 

Here's my code for that:

 

 pricing.putSObject('print_discounts__r', new print_discount__c(name='blah',field2='blah2'));

 I've tried variations of this, i.e.,  pricing.putSObject('print_discount__c', new print_discount__c(name='blah',field2='blah2'));

 

But to no avail.  Any idea how to use this method?  Thanks.

 

I installed Salesforce offline today on my portable. When I try to connect, I get the following error message:

 

 

The funny thing is that a week ago I managed to connect to the offline-application without any problem. But today I deleted and re-installed it and since then the error message keeps popping up every time I try to connect.

 

Anyone knows what might be the problem?

 

 

Thanks in advance.

hi

 

can u please help me how to parse an XML.

 

Actually my requirement is create a webservice in APEX. The parameter for webservice is in the form of XML String. in that webservice i have to parse that XML. for example my input xml is in the form of

 

<?xml version="1.0" encoding="UTF-8" ?>
- <Body>
- <InvoiceRequest>
- <Item>
  <ItemName>num1</ItemName>
  <ItemPrice>$11.0</ItemPrice>
  <ItemId>01278390921098209AB872190</ItemId>
  <ItemType>NULL</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Service</ItemName>
  <ItemPrice>$23.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Service</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Product</ItemName>
  <ItemPrice>$36.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Product</ItemType>
  </Item>
  </InvoiceRequest>
  </Body>

 

for the above XML how can i parse this xml. Please help me. The above xml is related to Item Custom object. so i have to construct a List<Item__c> object for this XML.

 

 

Please help me.

  • September 16, 2009
  • Like
  • 0

Hi,

 

I am used to java development where I can use a constants file which I load when the application wakes up, from which I read in values during runtime. These are any constants that a system admin can configure.. like the email addresses to which notifications should go to, retry counts, url end points etc. In a Java application you modify a constants file and restart the application. How do you provide such functionality in APEX?  

 

thanks,

Odie

I've written an Apex Service that will be called from an inhouse application.  I have a try/catch block that catches any exceptions and returns an error type that I've defined.  I also send an email notification out.  I know you can grab the exception type and message with .getTypeName() and .getMessage(), but how do I get the exception line number?  That would be handy information to send in the error notification email.  If I don't handle the error, the service returns the exception type, exception message, class name, class method, and line number in the faultstring element.  I don't see anything in the Apex documentation that would allow you to access the line number when catching the exception though.  What gives?  Is this available?