Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Element Ids in Custom Object javascript

JeffLamb
Contributor II


I have a very fundamental question regarding javascript in custom objects. How do I determine the element id of a field I want to reference in the javascript?

 

I have a simple requirement where we need to clear the contents of a text field when the record is opened for editing. Seems like it should be easy to implement this with a custom object, but I don't know how to get the element id of the field so I can reference it within the custom object.

 

If it matters, I'm using Archer 5.2 but we will be moving to 5.3 SP1 soon.

31 REPLIES 31

Anonymous
Not applicable

Hi David,

 

 

 

For example, I want to create a customized object to pop-up a new IE

window. The window’s url is composed by some filed value from Archer.

In that case you would use a calculated field instead.

 

concatenate("<a herf=""myurl",[Field With value],"" target=""_blank"">Text to hyperlink</a>")

 Advisory Consultant

Anonymous
Not applicable

Hi David,

 

 

 

And concatenate function didn’t allow us to make single quotation mark.

 

For example, Concatenate(“[Link | http://www.w3schools.com]” generated an error.

 

 

 

 

 

Thanks,

 

 

 

Zhao

 

 

 

 

 

 

 

 

 

From: David Petty

Sent: December-12-13 9:09 AM

To: zhaoice

Subject: Re: - Re: Element Ids in Custom Object javascript

 

 

ECN <https://community.emc.com/?et=watches.email.thread>

 

 

Re: Element Ids in Custom Object javascript

 

reply from David

Petty<https://community.emc.com/people/DjPetty?et=watches.email.thread>in

*RSA

Archer* - View the full

discussion<https://community.emc.com/message/781709?et=watches.email.thread#781709>

Can you post the entire calculation?  The you posted above is incomplete.

 Advisory Consultant

Anonymous
Not applicable

Hi Davide,

 

 

 

"[Text to hyperlink | https:]"

 

 

 

It passed the formula validation. But it generated errors when we click

this link.

 

Thanks,

 

 

 

Zhao

 

 

 

From: David Petty

Sent: December-12-13 12:02 PM

To: zhaoice

Subject: Re: - Element Ids in Custom Object javascript

 

 

ECN <https://community.emc.com/?et=watches.email.thread>

 

 

Element Ids in Custom Object javascript

 

reply from David

Petty<https://community.emc.com/people/DjPetty?et=watches.email.thread>in

*RSA

Archer* - View the full

discussion<https://community.emc.com/message/781720?et=watches.email.thread#781720>

The calculation has to be in this format to work,

concatenate("<a herf=""https://www.google.com?",[Field With value],"" target=""_blank"">Text to hyperlink</a>")

 Advisory Consultant

Anonymous
Not applicable

Hi David,

 

 

 

But in this format (concatenate), we couldn’t pass the formula validation.

It keep giving us invalid syntax message.

 

 

 

Thanks,

 

 

 

Zhao

 

 

 

From: David Petty

Sent: December-12-13 12:26 PM

To: zhaoice

Subject: Re: - Re: Element Ids in Custom Object javascript

 

 

ECN <https://community.emc.com/?et=watches.email.thread>

 

 

Re: Element Ids in Custom Object javascript

 

reply from David

Petty<https://community.emc.com/people/DjPetty?et=watches.email.thread>in

*RSA

Archer* - View the full

discussion<https://community.emc.com/message/781722?et=watches.email.thread#781722>

I was missing a extra double-quote,

CONCATENATE("<a href=""https://www.google.com?",[Field With value],""" target=""_blank"">Text to hyperlink</a>")

 Advisory Consultant

Anonymous
Not applicable

Hi David,

 

 

 

Problem solved. I’ve re-checked the formula to make sure it correct.

 

 

 

Thanks so much for your help.

 

 

 

Zhao

 

 

 

From: David Petty

Sent: December-12-13 12:26 PM

To: zhaoice

Subject: Re: - Re: Element Ids in Custom Object javascript

 

 

ECN <https://community.emc.com/?et=watches.email.thread>

 

 

Re: Element Ids in Custom Object javascript

 

reply from David

Petty<https://community.emc.com/people/DjPetty?et=watches.email.thread>in

*RSA

Archer* - View the full

discussion<https://community.emc.com/message/781722?et=watches.email.thread#781722>

Anonymous
Not applicable

I was trying to follow this example and create a simple jquery alert that would display the text in a field, but it does not seem to work.

My field id is 20223 and it is a text field (which I'm a little unsure the formatting in the jquery for other field types - btw)

 

script type="text/javascript"

Sys.Application.add_load(function(){

alert($('div[id*="f20223c"]').text());

alert($('div[id*="f20223c"]').val());

});

/script

 

Instead of div, I tried input, as well.