You need to sign in to do that
Don't have an account?
When i click on add button i need to display one more textbox(contoller also)
Hi, Good Morning. can any one help me to solve the following......... I have an object invoice__c. It has only one field name.i would like to add the records into object using VF page. Initiallay, In VF page I have Add button,Save button & a text box. When i click on add button i need to display one more textbox. Like this i can add any number of textboxes. But when i entered data into these textboxes and clicked on save. I would like to add all the names into object in the form of records. That means, each name will be added into object as a record. i need controller class also Can any one help me.
vfpage:
error:Error: Compile Error: Incompatible element type addTextrBox.textBoxClass for collection of SOBJECT:student__c at line 45 column 29
All Answers
Controller class
VFP
Use above I think your page is ready for adding text boxes
Please update styling for and layout arrangement as per your need.
What is your object and field api name in which you want to save it
1)object name = lineItem
2)Fields :
a) LineItemId(auto generated)
b) Lineitemnumber (textbox value)
output
LineItemId Lineitemnumber
10001 12000
10002 65378
i am waiting for ur reply . very urgent
Save Code
Compile Error: Invalid initial expression type for field student__c.stunumber__c, expecting: Decimal at line 44 column 82
Use : Decimal.valueof(Your Fields API Name) like this
Before you insert or update the record.
Error: Compile Error: Incompatible element type addTextrBox.textBoxClass for collection of SOBJECT:student__c
vfpage:
error:Error: Compile Error: Incompatible element type addTextrBox.textBoxClass for collection of SOBJECT:student__c at line 45 column 29
Hi,
Very urgent plz correct my code.
i add two text box, when i click a button,
textbox1:12345
textbox2:34567
when i click save button ,
o/p:
serialid serialnumber
s1001 12345
s1002 34567
thank u very much it works fine. plz send ur mail ID.
I am azarudeen from chennai. past 10 months i m working salesforce.
Hi,
Don't you think my answer deserved to be marked as solution. I spent 1 full hour to write that code.
Hey Extremly sorry sharma. now i iaccept your solution dnt mistake me.
your code :
Change code:
No issues :)
Do yo know which lookup you need to display or it is dynamic?
display.
o/p
productname = lookupfield
serialnumber1 = textbox
serialnumber2 = textbox
click save
i m waiting for ur reply
I am not getting your req. correctly
1) If you know what lookup you want then just create instance of the object that has the lookup and use input field and bind that lookup field and render it conditionaly
But again I will ask is your lookup is dynamic if it is then you will have to do it differently.
warehouse product object:
field = warehouse product name
serial number object
fields:
warehouse product name(master details of warehouse product)
serial number
o/p:
warehouse product name = lookup value
serial number 1-10001
serial number 2-10002
wahen i click save , all the value stored in serial number object. two serial number created.
You can use
Create an instance of warehouse product object in the class , like
Public warehouseproductName__c whpObj {
get
{
if(whpObj == null)
{
whpObj = new warehouseproductName__c ();
}
}
set;
}
In vfp add this
<apex:inputField value="{!whpObj.LookupFieldName__c}" />
i add following code only wareproductname save, serial number not saved
Public warehouseproductName__c whpObj {
get
{
if(whpObj == null)
{
whpObj = new warehouseproductName__c ();
}
}
set;
}
In vfp add this
<apex:inputField value="{!whpObj.LookupFieldName__c}" />
This is my code . only insert warehouseproductname. i want to insert serialnumber and warehouseproductname.
Mycode:
class:
Hi sharma. thanks for last 3 days help. i got a solution.
thank u very muck man
i m asking ur mail id.
How to Remove serial Number in same code?
when i click remove serial number button, one textbox is removed
HI vibration,
Please give me replay if u got solution for removing text box.