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
Ajay LAjay L 

sforce.one.createRecord in LEX Unable to save the record

I am trying to create a related list button with default values with sforce.one, however when I try to click Save button I am getting this error "Review the errors on this page". But no errors listed, and all the required fields have been filled properly.

VF Page:

<apex:page standardController="Opportunity" recordSetVar="opps"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <apex:includeScript value="/soap/ajax/28.0/connection.js"/> <apex:includeScript value="/soap/ajax/28.0/apex.js"/> <script type="text/javascript"> sforce.connection.sessionId = "{!$Api.Session_ID}"; $( window ).ready(function() { createOpportunity(); }); var recordId = '{!$CurrentPage.parameters.Id}'; var OBJECT_NAME_HERE ='Opportunity'; var RECORDTYPE_NAME_HERE ='Internship Seats'; var url ='/006/e?retURL=%2F&' try{ //Query the record type var RecordTypeIds = sforce.connection.query("SELECT Id FROM RecordType WHERE SObjectType='" + OBJECT_NAME_HERE + "' AND Name='" + RECORDTYPE_NAME_HERE + "' LIMIT 1"); var rtTypes= RecordTypeIds.getArray("records"); var RecordTypeId = rtTypes[0].Id; //Query the parent record var cons = sforce.connection.query("SELECT Id,Name FROM Account WHERE Id = '" + recordId + "'"); var stats= cons.getArray("records"); //Internship Seats Opportunity url +='RecordType='+RecordTypeId; url +='&CF00N50000001oGFd='+stats[0].Name; url +='&CF00N50000001oGFd_lkid='+stats[0].Id; url +='&opp11=Open'; //Default values var defaultValues = { 'AccountId':stats[0].Id, 'Corporate_Account__c' : stats[0].Id, 'StageName':'Open', 'retURL':'/006', 'nooverride':'1' } } catch(e){ alert('An Error has Occured. Error:' +e); } function createOpportunity(){ if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) { sforce.one.createRecord('Opportunity',RecordTypeId,defaultValues); }else{ window.location='{!URLFOR($Action.Opportunity.New, null, [RecordType='+RecordTypeId+',save=1], true)}'; } } </script> </apex:page>

User-added image
NagendraNagendra (Salesforce Developers) 
Hi Ajay,

Sorry for this issue you are encountering.

May I suggest you please give a try by removing  " 'retURL':'/006', 'nooverride':'1'" which should probably do the trick.

Hope this helps.

Kindly mark this as solved if it's resolved.

Thanks,
Nagendra
 
Saranyan V NarayananSaranyan V Narayanan
did anything turn up on the dev console?