• KierenJameson
  • NEWBIE
  • 30 Points
  • Member since 2014
  • Digital Solutions Manager
  • ETR | Salesforce MVP


Badges

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 13
    Replies
I'm curious if someone can clear up a confusion of mine about Apex primitive data types. I understand in Java that what makes something a primitive data type is a couple of things:
  1. That it can't be broken down into a smaller unit (e.g., array = non-primitive, long = primitive)
  2. That primitives are passed by value rather than passed by reference (e.g., boolean = primitive, object reference = non-primitive. )
This is where I get stuck translating this to Apex, because according to the Force.com Apex Code Dev Guide in Apex, Object is a primitive value (https://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm), and I don't think that it abides by either of the rules above.

Does Apex have a different definition of what makes something primitive than Java? If so, what is it?

I would be super grateful for someone to help clear this up for me :)
 
I'm trying to find a plain english example of when to use double vs decimal as a data type. I understand that by default all currencies are decimal and I've looked at a bunch of the online documentation (and the apex workbook which has pretty good definitions), but it's still not clear to me. 

Can anyone give me some examples?  Thanks! Kieren
I'm trying to find a plain english example of when to use double vs decimal as a data type. I understand that by default all currencies are decimal and I've looked at a bunch of the online documentation (and the apex workbook which has pretty good definitions), but it's still not clear to me. 

Can anyone give me some examples?  Thanks! Kieren
I have two objects that I mainly use in my org. I would like to know if there is anyway to have the two communicate.
To make it easy, I'll use object A and B. Some examples of what I'm trying to do:
When A meets a particular criterai, create a new record in B auto-update some of the fields.
During the B approval process, send out an email template that refers to A fields.
Hi All, I have a validation rule that I would like to create on the campaign stating that a particular field cannot be changed if the campaign has more than 0 leads or opportunities created from it. It wasn't letting me use the standard fields on the campaign so I created my own custom formula adding leads and  opportunities together but I still keep getting the same error.

This is my what seems to be very simple validation rule that will not work.

Total_Inquiries_and_Proposals__c >0

The following is the error I receive:

Error: Error in referenced formula Total_Inquiries_and_Proposals__c, Field NumberOfLeads may not be used in this type of formula
I have a multi-select country picklist with 150 entries. I want to know if the value of the field includes one of the 141 countries (let's call this Group 1). Note that the user might include values from the Group 2 countries as well. I can't write a big formula (INCLUDES(field,country1) || includes(field, country2) .....INCLUDES(field, country141)).

There is no ability to convert a multi-select picklist to a text value - If I could convert the picklist to a text value, I could use the SUBSTITUTE where there the 9 Group 2 country values and ";" are substituted by blank. If the remaining string is non-empty, I know I have a Group1 value exists.

Any other thoughts before I create a "tracking field" which is a text field and copies the multi-select field via a trigger? Even with that, I will have to assume the tracking field does not exceed 255 characters, it can't be a long text field either.

Any additional thoughts?


 
I'm curious if someone can clear up a confusion of mine about Apex primitive data types. I understand in Java that what makes something a primitive data type is a couple of things:
  1. That it can't be broken down into a smaller unit (e.g., array = non-primitive, long = primitive)
  2. That primitives are passed by value rather than passed by reference (e.g., boolean = primitive, object reference = non-primitive. )
This is where I get stuck translating this to Apex, because according to the Force.com Apex Code Dev Guide in Apex, Object is a primitive value (https://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm), and I don't think that it abides by either of the rules above.

Does Apex have a different definition of what makes something primitive than Java? If so, what is it?

I would be super grateful for someone to help clear this up for me :)
 
I'm trying to find a plain english example of when to use double vs decimal as a data type. I understand that by default all currencies are decimal and I've looked at a bunch of the online documentation (and the apex workbook which has pretty good definitions), but it's still not clear to me. 

Can anyone give me some examples?  Thanks! Kieren

Hi.

We are trying to get a case age formual to work like one that we currently have in an excel spreadsheet.

Custom Date Fields:
Date Opened - 1/3/2012 9:43am
Date Resolved - 1/18/2012 8:42am

Excel Formula: =IF(C5654="",0,(NETWORKDAYS(B5654,C5654,holidays)-1)*(end-start)+IF(NETWORKDAYS(C5654,C5654,holidays),MEDIAN(MOD(C5654,1),
end,start),end)-MEDIAN(NETWORKDAYS(B5654,B5654,holidays)*MOD(B5654,1),end,start))

EXCEL Age in Business Hours: 120:17

Salesforce Formula:
If(IsNull(Date_Resolved__c ),

CASE(MOD( DateValue(Date_Opened__c ) - DATE(1985,6,24),7), 0 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1), 1 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1), 2 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1), 3 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1), 4 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1), 5 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0), 6 ,
CASE( MOD( Today() - DateValue(Date_Opened__c ) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0), 999)
+ (FLOOR(( Today() - DateValue(Date_Opened__c ) )/7)*5-1)*11,

CASE(MOD( DateValue(Date_Opened__c ) - DATE(1985,6,24),7), 0 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1), 1 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1), 2 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1), 3 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1), 4 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1), 5 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0), 6 ,
CASE( MOD( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0), 999)
+ (FLOOR(( DateValue(Date_Resolved__c ) - DateValue(Date_Opened__c ) )/7)*5-1))*11


SALESFORCE Age in Business Hours: 121.00

How can I get the SFDC formula to stop rounding? I think that's what it's doing.

 

The Case Age App doesn't work for what we need. We need the age before, during and after close.
 

THANK YOU SO MUCH!
Nancy

New to the discussion boards. . . Was wondering if anyone had an idea about how to determine which chatter posts are the most popular by counting the number of likes that are received.

 

Thank you in advance for your help.

  • March 04, 2011
  • Like
  • 0

Hello,

I posted this on the Idea site (http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=087300000006xx9&returnUrl=%2Fapex%2FideaList%3Fc%3D09a30000000D9xt%26sort%3Drecent) as well, but wondered if anyone has any suggestions on how to avoid the following "issue" I'm having with a Workflow Task.

 

Basically, I am trying to create a Task to be assigned to the user in a particular Role on the Sales Team.  However, if no user is defined in that Role, the Task is still created and implicitly assigned to the Opty Owner.  I can see scenarios where I'd be glad that is the functionality, but in the current case, I am already creating a Task for the Opty Owner from the same Workflow.  So, when no user is defined for the Sales Team role I am trying to create a Task for, the Opty Owner ends up with two identical tasks and, as you can imagine, this would not sit well with our Sales folks.

 

Any advice on how to get this to work so that the Opty Owner always gets a Task and the Task for the Sales Team member is only created when the at least one user is assigned to that Role?

 

TIA...

Hi all,
 
I have created a very simple formula:
 
IF(
ISPICKVAL( Product2.Family , "Prod1"),
ListPrice > UnitPrice ,
NULL)
 
I want to use this as a workflow.  This was fine.  Now I want to add a field update based on this rule to change a record type on an Opportunity and there are no options in the Approval Process or Workflow Alerts to allow this to happen based on my criteria.  I don't understand why the Product/Opportunity are not linked to begin with....
 
Does anyone have any suggestions for a workaround?
 
L
Hi ,
Can we update the Probability% field in opportunity based on a Formula or with a Field Update.
I tried it , but its not working.
Any kind of pointers would help me.

Regards
David
Hi,
 
Starting to ask a few more questions of Salesforce now, and this had led us to deploy a training schedule / administration function for our customers.
We now want to give internal staff visibility of the class dates via a public calendar, but the class are already defined in a different custom object.
Is there a way of creating this event in the public calendar upon saving of the record in the custom object (Workflow?).
I have all the field information in the custom object and would need to map this to the public calendar?
 
Any pointers much appreciated.
 
Kind regards,
 
Leslie
I need to write a formula that will enable me to add the list price items on the product section on the opportunities tab together and total them in a field below the amount field. This is so I can track how much discount our sales team have been giving from our list price to the customer. If this is possible pleae let me know how to perform this function.

Thanks

Andrew
I have a multi-select country picklist with 150 entries. I want to know if the value of the field includes one of the 141 countries (let's call this Group 1). Note that the user might include values from the Group 2 countries as well. I can't write a big formula (INCLUDES(field,country1) || includes(field, country2) .....INCLUDES(field, country141)).

There is no ability to convert a multi-select picklist to a text value - If I could convert the picklist to a text value, I could use the SUBSTITUTE where there the 9 Group 2 country values and ";" are substituted by blank. If the remaining string is non-empty, I know I have a Group1 value exists.

Any other thoughts before I create a "tracking field" which is a text field and copies the multi-select field via a trigger? Even with that, I will have to assume the tracking field does not exceed 255 characters, it can't be a long text field either.

Any additional thoughts?