• NicolaiP
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi,

 

I have an odd problem with a SELECT string, trying to get data from Salesforce.

 

If I use "SELECT Unit_Price__c FROM Equipment_Data__c", it perfectly returns the Unit_Price__c

 

If I use "SELECT Deal_Type__c  FROM Equipment_Data__c", it perfect returns the Deal_Type__c

 

But if I use "SELECT Unit_Price__c, Deal_Type__c FROM Equipment_Data__c", it only receives the Deal_Type__c correct, but return a "null" value for Unit_Price__c

 

Unit_Price__c is a "Number(16,2)" and Deal_Type__c is a Picklist (single).

 

What is wrong?

 

Any help really appreciated.

 

Best regards,

Nicolai 

 

 

Hi,

 

I have an odd problem with a SELECT string, trying to get data from Salesforce.

 

If I use "SELECT Unit_Price__c FROM Equipment_Data__c", it perfectly returns the Unit_Price__c

 

If I use "SELECT Deal_Type__c  FROM Equipment_Data__c", it perfect returns the Deal_Type__c

 

But if I use "SELECT Unit_Price__c, Deal_Type__c FROM Equipment_Data__c", it only receives the Deal_Type__c correct, but return a "null" value for Unit_Price__c

 

Unit_Price__c is a "Number(16,2)" and Deal_Type__c is a Picklist (single).

 

What is wrong?

 

Any help really appreciated.

 

Best regards,

Nicolai 

 

 

Hi,

 

I have a simply query in my apex class to return a record from a custom object, code below:

 

userIncentivePlan = [select name, isActive__c, owner.name, Target__c, Growth_Incentive_Rate__c from Incentive_Plan__c where user__c =:UserId and isActive__c='True'];

 With the "isActive__c = 'True'" where criteria, the query fails to return any results, therefore I am assuming it  always evaluates to false. (also confirmed this by printing it out to a visual force page)

 

the formula on the field contains some nested if statements but always equates to 'True' or 'False', code below:

 

if (User__r.Profile.Name = 'System Administrator',  Incentive_Rate__r.isActive__c , 
if (User__r.Profile.Name = 'Corporate Sales Manager', Incentive_Rate__r.isActive__c, 
if (User__r.Profile.Name = 'Corporate Account Developer', Growth_Incentive_Rate__r.isActive__c, 
if (User__r.Profile.Name = 'Corporate Account Manager', Growth_Incentive_Rate__r.isActive__c, 
if (User__r.Profile.Name = 'Corporate Sales Super User', Incentive_Rate__r.isActive__c, 
if (User__r.Profile.Name = 'Account Development Manager', 
  if ( AND ( Incentive_Rate__r.isActive__c ='True',  Growth_Incentive_Rate__r.isActive__c ='True'), 'True', 'False'), 'False')
))))) 

The isActive__c field reference on the incentiveRate object is also a formula field [could that be the cause of the problem??]

 

Strangely, when I view the custom object record through salesforce, it evaluates correctly to 'True'

 

Having seen this forum posing, it suggests what I have done is correct : link

.... however it is not working. 

 

Any suggestions on how I can go about trying to resolve this would be appreciated.

 

Thanks in advance.

  • June 27, 2012
  • Like
  • 0