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
TinaMillerTinaMiller 

PrePopulate from one field to another

I am having a bit of a time prepopulating a field from my account screen to the exact field in my contract screen. When the information is entered in the account screen I want it to autofill in my contract screen. The code I am using is this:

 

<code>

accounts.provider_id_number = contracts.provider_id_number

</code>

 

Can anyone direct me on what I am doing wrong?

Ben EllingtonBen Ellington

Can you be a little more specific about what you're trying to do?  Is this a situation where you want the Provider Id number on the Contract to always match that on the Account?  If so, use a Formula field on the Contract object.

 

Or, are you creating a new Contract on the Account, and you want that field pre-populated with the value on the Account?  If that's the case, you can add a URL parameter to the button that creates the new contract to autopopulate certain fields. 

TinaMillerTinaMiller

The information is entered in the system by our contracting or sales team and when they enter a new account right now they put in the provider_id and I want that number to pre-populate to the provider_id on the contract screen.

TinaMillerTinaMiller

And I am on the formulafield page but the formula I am entering isn't correct because sometimes I get an error that the code is wrong or it takes when I play with it but doesn't populate. Which tells me I am more than likely using the wrong code. But I can't find code examples to help.

Ben EllingtonBen Ellington

Use the Insert Field button, and then on the Contract field list, look for

 

Account>

 

Then click on that, and another field list for the Account will appear.  Follow that down to the field you want.

 

It will insert something like:

 

Account.Provider_Name__c

 

And that's all you need.