function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tdevmantdevman 

Fomula field Problem- urgent

I have 2 record types on the task record. One called "Custom" and another called "Standard".  The default record type for all users is Standard. I created 2 formula fields (Custom and Standard)  that are images in the documents folder. Depending which is clicked, it should auto land on that page layout. It works for the standard but how can i make it for the custom?

 

How can I make this work?

 

Stanard(this works)

HYPERLINK('/00T/e?who_id='& Id & '&retURL=' & Id, IMAGE('/servlet/servlet.FileDownload?file=01540000000xKUQ', 'Standard)) 
& ' ' &

 

Custom(fails and says missing ')'

HYPERLINK('/00T/e?who_id='& Id & '&retURL=' & Id&RecordType=01240000000UWKG, IMAGE('/servlet/servlet.FileDownload?file=01540000000xKUB', 'Custom'))
& ' ' &

Best Answer chosen by Admin (Salesforce Developers) 
phiberoptikphiberoptik

Very very interesting. I replicated your link in my Dev org and it worked perfectly. The only difference was I did it on the Account object so I used what_id. I used my own non-default Record Type ID and my own image ID. Clicked the image on the Account and it took me to a create Task page with the correct Record Type.

 

HYPERLINK('/00T/e?what_id='& Id & '&retURL=%2F' & Id & '&RecordType=012E00000005U3P', IMAGE('/servlet/servlet.FileDownload?file=015E0000001HEP9', 'Custom'))

 

All Answers

Sridhar BonagiriSridhar Bonagiri

Hi,

 

Can you try with below code which I modified.

 

HYPERLINK('/00T/e?who_id='& Id & '&retURL=' & Id & '&RecordType=01240000000UWKG', IMAGE('/servlet/servlet.FileDownload?file=01540000000xKUB', 'Custom'))
& ' ' &

 

 

Let me know if it is not working.

 

Regards,

Sridhar Bonagiri

tdevmantdevman

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Incorrect parameter type for function 'and()'. Expected Boolean, received Text

 
phiberoptikphiberoptik

You get that error message by using the first replier's fixed formula?

 

I am trying to follow the single quote marks in BSridhar's response and it appears correct to me.

tdevmantdevman

I was able to fix the syntax and it saved. However, when I click on this link it keeps going to the "Standard" record type and not "Custom" although the record type id is associated to the "Custom" one.  Right now the default record type is "Standard" for all profiles but both record types are available for all profiles too....getting close - will accept solution for u guys once i can fix this thing

 

 

HYPERLINK('/00T/e?who_id='& Id & '&retURL=' & Id & '&RecordType=01240000000UWKG', IMAGE('/servlet/servlet.FileDownload?file=01540000000xKUQ', 'Custom'))

phiberoptikphiberoptik
HYPERLINK('/00T/e?who_id='& Id & '&retURL=%2F' & Id & '&RecordType=01240000000UWKG', IMAGE('/servlet/servlet.FileDownload?file=01540000000xKUQ', 'Custom'))

 

Give that a try...

tdevmantdevman

Still doesn't work! eek! what's interesting is, i created a new profile and did not make this record type available for that profile and when that icon was clicked for the user associated to that profile, it said insuffcient privledges which leads me to belive it's directing to the correct url. problem is, when i try with a profile that does have access to it, it goes to the task page but the default record type = 'Standard'....ummm

phiberoptikphiberoptik

Very very interesting. I replicated your link in my Dev org and it worked perfectly. The only difference was I did it on the Account object so I used what_id. I used my own non-default Record Type ID and my own image ID. Clicked the image on the Account and it took me to a create Task page with the correct Record Type.

 

HYPERLINK('/00T/e?what_id='& Id & '&retURL=%2F' & Id & '&RecordType=012E00000005U3P', IMAGE('/servlet/servlet.FileDownload?file=015E0000001HEP9', 'Custom'))

 

This was selected as the best answer
tdevmantdevman

I wll try this out again. There must be an issue wit the record type setting some where. Also for the first link do you know if there is to directly route to the standard log a call page that sfdc has when log a call is clicked