• EllieAtWHL
  • NEWBIE
  • 40 Points
  • Member since 2016
  • Admin/Developer

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 6
    Replies
I am running a SOQL query. In it, I want to display the name of the Record Type rather than the ID number. If I create a query that includes:
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:

ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks. 

Hi Guys.

I am trying to have a formula field for the Week Number of the year. So, if opportunity is created on the 3rd January 2016, it would show "Week 1 2016".
I use the report in the Matrix format.
Currently, the field I am using for week number calculation is called "Created Date"
Format of the field is: DD/MM/YYYY (this was changed in the regional settings from the american MM/DD/YYYY format)

I have browsed forums and found many formulas... which none of them work.
One of them, for example:

MOD(FLOOR((Created_Date__c - DATEVALUE( "2016-01-01 " ) ) / 7 ), 52) + 1

It gives me the following error:
Error: Invalid custom summary formula definition: Field Created_Date__c does not exist. Check spelling.

Now, I am new in SFDC formulas, so as far as I understand, there is no such field. It should be called Crated Date. But if i use just Created Date - I get error that there is no field Created. If I use formula like this:

MOD(FLOOR(("Created Date" - DATEVALUE( "2016-01-01 " ) ) / 7 ), 52) + 1

I get error: Error: Invalid custom summary formula definition: Incorrect parameter type for operator '-'. Expected Number, Date, DateTime, received Text.

I know that I am doing mistake somewhere, but where?
Thank you for the answers!

Hi @ all,
I want to compare a date field and a datetime field in the process manager. Is this possible?

Lisa
I am running a SOQL query. In it, I want to display the name of the Record Type rather than the ID number. If I create a query that includes:
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:

ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks. 

Not really a question, but  solution I thought might be helpful to others:

 

Due to the nature of most backoffice (and frontoffice, for that matter) systems, the standard Address object in salesforce does not work well with integrations, especially if you are using Salesforce.com as the system of record for some addresses.  Most of these systems use a dedicated field for each address line.   We need our street address field to fit into our accounting system limitations, which are:

1. Maxium of 30 characters per line

2. No more than two lines

 

Anyway, the answer for me was some fairly basic Regex for the BillingStreet Field:

NOT(
OR(
REGEX(
BillingStreet,
".{0,30}"
),
REGEX(
BillingStreet,
".{0,30}\r\n.{0,30}"
)
)
)

My regex logic:

Must be:
Empty or Single line less than 31 characters:
.{0,30}
Two lines with less than 31 characters each line:
.{0,30}\r\n.{0,30}

You can also do this with negative enforcement, but the positive model is much cleaner (example shown with 60 character limit instead of 30):

NOT:
2 or more CRLFs
(.*\r\n){2,}.*
More than 60 characters on single line
.{61,}
More than 60 characters on first line of two
.{61,}\r\n.*
More than 60 characters on second line of two
.*\r\n.{61,}

I learned the following about SF regex while doing this:

1. It does not appear to operate in multi-line mode (IE the $ zero-width match does not match the end of each line, just the end of the field)

2. The dot (.) does not match EOL characters (\r and \n)

3. Your regex has to match the entire field - all lines to be true.   In other workds, .* will not match a multi-line field.

4. To match the entire field regardless of the number of lines you would use (.*\r\n){*}

5. SF Address field uses \r\n as their EOL for the purposes of regex (I think this is different than the export, which is supposed to use just \n).

 

Enjoy,

 

Brandy Peterson

Not really a question, but  solution I thought might be helpful to others:

 

Due to the nature of most backoffice (and frontoffice, for that matter) systems, the standard Address object in salesforce does not work well with integrations, especially if you are using Salesforce.com as the system of record for some addresses.  Most of these systems use a dedicated field for each address line.   We need our street address field to fit into our accounting system limitations, which are:

1. Maxium of 30 characters per line

2. No more than two lines

 

Anyway, the answer for me was some fairly basic Regex for the BillingStreet Field:

NOT(
OR(
REGEX(
BillingStreet,
".{0,30}"
),
REGEX(
BillingStreet,
".{0,30}\r\n.{0,30}"
)
)
)

My regex logic:

Must be:
Empty or Single line less than 31 characters:
.{0,30}
Two lines with less than 31 characters each line:
.{0,30}\r\n.{0,30}

You can also do this with negative enforcement, but the positive model is much cleaner (example shown with 60 character limit instead of 30):

NOT:
2 or more CRLFs
(.*\r\n){2,}.*
More than 60 characters on single line
.{61,}
More than 60 characters on first line of two
.{61,}\r\n.*
More than 60 characters on second line of two
.*\r\n.{61,}

I learned the following about SF regex while doing this:

1. It does not appear to operate in multi-line mode (IE the $ zero-width match does not match the end of each line, just the end of the field)

2. The dot (.) does not match EOL characters (\r and \n)

3. Your regex has to match the entire field - all lines to be true.   In other workds, .* will not match a multi-line field.

4. To match the entire field regardless of the number of lines you would use (.*\r\n){*}

5. SF Address field uses \r\n as their EOL for the purposes of regex (I think this is different than the export, which is supposed to use just \n).

 

Enjoy,

 

Brandy Peterson