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
David DanzigDavid Danzig 

Names for Standard Fields in Javascript custom button

How do I find out what the names of the standard fields are for this purpose? For instance on the campaign object, I know that the Name field is "cpn1" and that IsActive is "cpn16". I got that by looking in the source code for the edit page. How do I locate the rest? Is there some table for this available anywhere? What about the other objects' standard fields?

 

Thanks,

 

David.

tantotanto

The best way I have found is using the web developer tool bar plugin for Firefox. I the tool bar select Forms, Display Form Details. This will show you the field labels on the web and thus for JavaScript. But to directly answer your question, not there is not a table or anything that lists these.

David DanzigDavid Danzig

This only works for fields that you can edit directly. Also, it doesn't work for fields that need to be changed through a separate screen, ie, Record Type, Campaign Member Type, Owner, etc.

 

I'm also having touble getting input via the javascript button into a custom lookup field. I tried using the following all to no avail:

(custom field id)=(id)

(custom field id)_lkid=(id)

(custom field id)_id=(id)

(custom field id)=(name)

 

Please help.

 

Thanks,

 

David.

David DanzigDavid Danzig

I figured out the custom lookup field, but not the Owner field. Any ideas? Either I don't have the right variable name (I tried: Owner, OwnerId, Owner_id, owner_id, Owner_lkid, newOwn, newOwn_lkid), there's some combination that's required (as is the case for custom lookup field), or I can't do it from the Javascript directly because of some type of automatic assignment of the logged in User becoming the new record's owner.

 

I can do this with a Workflow Rule, I assume, but I'd prefer to not have to do that.

 

This is what I have so far, which is all working. But, no Owner field update.

 

<script language="JavaScript">
function redirect() {
parent.frames.location.replace("/701/e?retURL=%2F{!Contact.Id}&Parent=PI - Wipe a Tear Showings - 9 Av 2010&RecordType=012200000004kPd&cpn16=1&cpn1=PI - Wipe a Tear Home Film Showing - {!Contact.Name} - {!Contact.Region__c}&CF00N20000001XuuA={!Contact.Name}&CF00N20000001XuuA_lkid={!Contact.Id}&00N20000002McvE=Follow Up&00N20000002OXQo=PI Kiruv Activism&00N20000000jk4s={!Contact.Region__c}&00N20000001Y0aM={!Today}&cpn2=HFilm&00N20000001Xx4b=In Planning&cpn5=7/20/2010&save=1")
}
redirect();
</script>

tantotanto

Does the Owner need to be someone besides the current user?