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
Venkateswarlu BVenkateswarlu B 

I want to open a popup window (Window is not a vf page) with select list values to give input and create record using given input values total functionality to be done by using custom button onclick javascript. I have to write code in bellow shown box..

User-added image
sravan velamasravan velama
Hi Venkateswarlu,

Example code: 

{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}
var accnt = new sforce.SObject("Account");
accnt.Name = prompt('Enter new Account Name','{!Account.Name}'); var result = sforce.connection.update([accnt]);
if(result[0].getBoolean("success"))
{ alert('Account updated successfully');
window.location.reload();
}
else{
alert('Error : '+result);
}

By using above code as reference, I think you will be able to create record through java script