You need to sign in to do that
Don't have an account?
Kbhaskar
sample custom form err
hi,
i trying to create a custom form using vf page .can you correct this code .
Error: Compile Error: Invalid type: myObj at line 8 column 38
vf page
i trying to create a custom form using vf page .can you correct this code .
public with sharing class myClass { public String thetextInput1 {get;set;} public String thetextinput2 {get;set;} public void saveObject(){ myObj regestration_form= new myObj(); myObj.Name__c = thetextInput1 ; myObj.roll_num__c = thetextInput2; insert myObj; } }
Error: Compile Error: Invalid type: myObj at line 8 column 38
vf page
<apex:page title="reg form" controller="myclass" showHeader="false" sidebar="false" > <apex:form> <apex:OutputLabel value="Name" for="thetextInput1"/> <apex:inputText value="{!thetextInput1 }" id="thetextinput1"/> <apex:OutputLabel value="roll no" for="thetextInput2"/> <apex:inputText value="{!thetextinput2}" id="thetextinput2"/> <apex:commandButton value="Save" action="{!saveObject}" /> </apex:form> </apex:page>
Did you create the myObj on your salesforce instance ?
Try to replace myobject with myobj__c or the object in which you want to create record .
Try with above code and let me know if it helps .
Thanks
Manoj
You can try like below which will help you with less variable .
Let me know if it heps .