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
Eoin BlacklockEoin Blacklock 

scontrol to pass Billing address in account to billing address in invoices

Hi All,

I am creating an scontrol to pass information from 1 object to another.. basically I want to have a "create invoice" button in an account that sends the account name and address to the invoice.. The problem i'm having is that the "billing address" field has 3-4 lines in it, therefore when the scontrol redirects to the URL https://salesforce....{account.name} + .. {account.Billingaddress} it errors as there are multiple lines on the billing address..

Does anyone know how I can send this billing address to the invoice billing address?? I've got team/group edition

Many thanks

Eoin
Dublin
Ireland
JohanLiljegrenJohanLiljegren
Hi Eoin,

I haven't tried it on this very issue, but I'd suggest looking at the individual address lines instead, i.e.
  • Billing Address Line 1
  • Billing Address Line 2
  • Billing Address Line 3

Also, you might get some ideas from looking at [ this ] free Salesforce Labs S-Control.

Regards
//Johan
j_wennerj_wenner

Can you please post your s-control code for this?   I am new to s-controls and am trying to do something very similiar.

thx

Jeanette

Eoin BlacklockEoin Blacklock
Many thanks for your reply Johan,

Unfortunately the mass update contacts is not available for the edition we have.. I have noticed that when running reports I can extract the individual lines from the billing address(i.e line 1,line 2, line 3). However I cannot figure out how to extract the individual lines in the scontrol..

Maybe theres an easier way of doing what I need to do .. basically I need to create an invoice where I choose the account and the address goes into the billing address of the invoice..

Kind Regards

Eoin
Eoin BlacklockEoin Blacklock
Hi Jeanette,

I'm very new to it too but heres my code..

My simple example, scontrol to pass account name to invoice..

1)Go to New Invoice
2)View source of new invoice page to find out what salesforce calls the fields in the html code, in this case my new invoice field calls Account Name(CF00N20000001DW4S)

Regards

Eoin

<script language="JavaScript">
function redirect() {
var url = "https://emea.salesforce.com/a03/e?retURL={!Account.Id}&CF00N20000001DW4S={!Account.Name};
parent.frames.location.replace(url);
}
redirect();
</script>
j_wennerj_wenner
Maybe I wasn't clear on what I was trying to accomplish.   I have two set of custom address fields on the Account object ("Mailing Address" and "Physical Location Address").   I want to create a s-control button to copy the values in the various "Mailing Address" fields to the various "Physical Location Address" fields, all within the Account object.
rickmerolerickmerole
Same problem here, however I am not trying to create an S-Control but a JavaScript button.

When I run a report, I can call individual address lines, however when I want to merge a field into my JavaScript, then I can only access the address as a whole, and the line feeds break my script.

I tried a CDATA section - didn't work. I called customer support - no ideas either. Now I am thinking that I should maybe create a custom field that extracts individual address lines, so I can reference them from the "Custom Button or Link Edit" page?