Sample Code:
function onsamplecreate() {
var record = {new_oname: 'samplerecord', //Single Line of Text
new_oclass: 'MCA', //Single Line of text
new_des: 'This is a sample test record', //Multiple Lines of Text
new_gender: { Value: 100000000 }, //Option Set
new_salary: { Value: '5000.0' }, //Currency
new_dateofjoin: new Date(2014,07,28), //Date
new_phc: false, // Two Options
new_idnumbr: '123', //Whole Number
new_fee : '4500.50',
new_contact: { //Lookup
Id: '5FCA5A3C-F612-E411-9166-D89D6764B7B4',
LogicalName: "new_mncontact"
};
};
XrmSvcToolkit.createRecord({
entityName: "mtctb_studentinfo", //Name of the entity
entity: record, // Json Object
async: true, //Asynchronous operation
successCallback: function (result) {
alert("Record Created successfully...");
},
errorCallback: function (error) {
alert("Failed to create record..");
}
});
}
No comments:
Post a Comment