function getVendor()
{

var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(‘Vendor’);
var query = SP.CamlQuery.createAllItemsQuery();
query.set_viewXml(‘<View><Method Name=”Read List”/> <ViewFields><FieldRef Name=”VendorId” /><FieldRef Name=”VendorName” /><FieldRef Name=”LinkToVendorDashBoardPage” /></ViewFields></View>’);
allItems = list.getItems(query);
context.load(allItems);
context.executeQueryAsync(Function.createDelegate(this, this.vendorSuccess), Function.createDelegate(this, this.failed));
}
var val=””;
var newOption=””;
var vendorPageHtml=””;
function vendorSuccess()
{
var ListEnumerator = this.allItems.getEnumerator();
while (ListEnumerator.moveNext()) {

var currentItem = ListEnumerator.get_current();
val=””;
val=currentItem.get_item(‘VendorName’);

}

}

Advertisements