+ Start a Discussion
cduncombe44cduncombe44 

Task & Event Field ID's not working

Hello, 

 

     We have activated the Summer 12 option to allow multiple contacts for activities.  We had buttons and links that would prefill some of the task and event fields as seen below

 

} else if (calledFor == 'logActivity') {
			url = '/' + R.getKeyPrefix() + '/e?email=0&retURL=' + pro.id + '&saveURL=%2Fapex/saveTaskForProcess%3Fprocess_id%3D' + pro.id
			+ '%26id%3D' + step.Id +'%26retURL%3D%2F' + pro.id + '%26called%5Ffrom%3D' + calledFrom 
			+ '&tsk1=' + system.Userinfo.getName()
			+ '&tsk1_lkid=' + system.Userinfo.getUserId()
			+ '&tsk2=' + myContact.Name
			+ '&tsk2_lkid=' + myContact.id
			+ '&tsk3=' + step.Name
			+ '&tsk3_lkid=' + step.id
			+ '&what_id=' + step.id
			+ '&tsk4=' + system.today().format()
			+ '&tsk5=Call'
			+ '&tsk12=Completed'
			+ '&00Nd0000004brj5=Health+Insurance';

 

The button that uses this code still works, but the tsk2 field doesnt seem to be working.  The task2_lkid seems to work because the task is related to the contact, but the Text name of that person is not showing up, which is very confusing to the user. 

 

I can't find any documentation on any new field ID's because of the new Task and TaskRelation Object that allow this multiple contact per activity (most likely because SalesForce doesnt support this URL hacking), but does anyone know of how I can get the Name to show, not just the underlying ID to be related?  

 

Basically, does anyone know if there is a new set of Field ID's for activities?

 

Any help is greatly appreciated

 

Chris

 

 

Best Answer chosen by Admin (Salesforce Developers) 
cduncombe44cduncombe44

I finally was able to get it to work.

 

I had to set

 

who_id=contact.id

 

I don't know why this is, but this not only takes care of setting the id, but also the text of the name.

 

Hopefully this saves someone else a lot of hassle.

 

 

All Answers

cduncombe44cduncombe44

Thanks for the reply, but I don't really see the connection in the post you suggested.

 

Just to clerify, there are no errors, the page is opened and all the fields I want prepopulated are doing so correctly, with exception of the contact name (field id is tsk2).  It is still related to that Contact because the tsk2_lkid id is being set to that contact id, it is just not showing the text name of the contact.  

 

So I just am looking for a new field ID that maybe replaced tsk2 because of the summer 12 upgrade to allow for activities with multiple contacts. 

craigmhcraigmh

Well with what I posted, you can see that the functionality has changed for an sObject constructor, where just an ID is no longer enough. I'm wondering if this is semi-related, if you're just arriving at the same problem going a different route.

cduncombe44cduncombe44

Hmmm, I played around with it, and that may have something to do with it, I just can't figure out what I need to set.

 

I have tried the following and still nothing.

 

WhoId = Contact.id

Who.Name = Contact.Name

tsk2= Contact.Name

 

I just can't think of what else I could set.

 

It might be interesting to note that the name does show up for maybe 2 seconds or so when the new task screen appears, but then quickly disappears, very odd.

 

Has anyone else run into this issue???

craigmhcraigmh

try this:

 

Who = Contact;

cduncombe44cduncombe44

 

No Dice, I have tried

 

Who=Contact

Who=Contact.Id

Who=Contact.Name

WhoId=Contact

WhoId=Contact.Id

WhoId=Contact.Name

tsk2=Contact

tsk2=Contact.Id

tsk2=Contact.Name

 

even though I figured half of them didnt make much sense. 

cduncombe44cduncombe44

I finally was able to get it to work.

 

I had to set

 

who_id=contact.id

 

I don't know why this is, but this not only takes care of setting the id, but also the text of the name.

 

Hopefully this saves someone else a lot of hassle.

 

 

This was selected as the best answer