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
kminevkminev 

Prepolulate salesforce page fields

Hi,

 

I have the following setup. Two fields fildA and feildB on a salesforce custom object page.

 

I need to be able to do the following:

 

If user selects or enters any value in feildA then fieldB should get the same value momentarly.

 

I think some javascipt/ajax majic, but I don't have a design or plan so far.

 

Can anyone help?

 

Thank you.

Ben EllingtonBen Ellington

You'll need to use Visualforce to make that happen.

kminevkminev

Can you provide a starter code?

Raumil SetalwadRaumil Setalwad

In visual force page the two fields field A and field B are located in page block section where id of A = aid and ID of B = bid

Now in javascript:-

 

 

function assignValue(){
	document.getElementById('bid').value = document.getElementById('aid').value
								OR
	document.getElemenById('pageId:formId:pagblockId:bid').value = document.getElemenById('pageId:formId:pagblockId:aid').value
}

 Hope this helps