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
RavitejaRaviteja 

Dynamic Query

Hi I am getting vf page error saying that id Not specifeid in update call. i got the record values using dynamic query into vf as inputfeild.when try to update the values on click of UpdateBarcode  geting the  error.

 

Vf :

===========================

<apex:page controller="Cls_Update_Size" sidebar="false" showHeader="false" >
<apex:form >
<apex:pageBlock id="repeat" >
<div style="margin:10px 300px 10px 400px"><h3 style="margin:10px 10px 10px 2px">Enter Barcode</h3><br/>
<apex:inputText value="{!Barcode}" size="40"/>
<apex:pageMessages />
</div><br/><hr/>
<apex:panelGrid >
<apex:facet name="header">Select the Feilds to Update</apex:facet>
<table style="margin:0px 0px 0px 0px">
<apex:repeat value="{!Warpmthd}" var="c" id="table" >
<td><apex:inputCheckbox value="{!c.selected}"/>
<apex:outputlabel value="{!c.fl.Label}"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
</apex:repeat><br/><br/><br/>

</table>
<table>
<apex:repeat value="{!fields}" var="f">
<tr>
<td>
<strong> <apex:outputlabel value="{!f.label}" /></strong> </td> <td> <apex:inputField value="{!feildvalue[f.fieldPath]}" />
</td>
</tr>
</apex:repeat>
</table>
<apex:commandButton action="{!UpdateEntered}" value="Update" style="margin:30px 0px 10px 100px" />
</apex:panelGrid>
<div style="margin:10px 0px 30px 1100px" ><br/><br/>
<apex:commandButton action="{!Find}" value="Find" rerender="repeat"/>&nbsp;&nbsp;
<apex:commandButton action="{!Oknext}" value="Ok and Next"/>&nbsp;&nbsp;
<apex:commandButton action="{!Close}" value="Close"/>
</div>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Class:

======================================================================================

public class Cls_Update_Size {

public boolean updateButton { get; set; }

public String inputSection { get; set; }

public PageReference UpdateEntered(){
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+feildvalue);
update feildvalue;
return null;
}


public Samples_Mgmt__c feildvalue{ get; set; }
Public Id SamId=null;
Public Id OffId=null;
public Samples_Mgmt__c sample;
public string size;
list<Samples_Mgmt__c> lstsam= new list<Samples_Mgmt__c>();
list<offer__c> lstoff= new list<offer__c>();
public String Barcode { get; set;}
public list<wrap> lstwrap {get; set;}
List<Schema.FieldSetMember> lstFieldSetMember =new List<Schema.FieldSetMember>();
List<Schema.FieldSetMember> selectedFeilds = new List<Schema.FieldSetMember>();

public Cls_Update_Size(){


lstsam=[select id,Bar_Code__c from Samples_Mgmt__c];
lstFieldSetMember.addall(SObjectType.Samples_Mgmt__c.FieldSets.Search_Barcode.getFields());
lstwrap=new List<wrap>();
}

public PageReference Find(){
updateButton =true;
selectedFeilds.clear();
for(wrap w: getWarpmthd()) {
if(w.selected == true) {
selectedFeilds.add(w.fl);
}
}
feildvalue=new Samples_Mgmt__c();
system.debug('******************************'+getFeildvalues());
feildvalue=getFeildvalues();
lstwrap.clear();

return null;
}


public Samples_Mgmt__c getFeildvalues(){
SamId='a0UK0000001jFOz';

String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Samples_Mgmt__c where id=:SamId';
return Database.query(query);
}

public List<Schema.FieldSetMember> getFields(){

return selectedFeilds;
}

public List<wrap> getWarpmthd(){

for(Schema.FieldSetMember mem :lstFieldSetMember){
lstwrap.add(new wrap(mem));
}
return lstwrap;
}
Public class Wrap{
public Boolean selected{get; set;}
public Schema.FieldSetMember fl{get; set;}
public Wrap(Schema.FieldSetMember m){
selected = false;
fl=m;
}
}

}

 

Thanks in advance...

Chaten Raghav 9Chaten Raghav 9
Hi,

I checked for the issue and would like to share a help link on which customer posted the similar issue and got the resolution.

Please check :- http://salesforce.stackexchange.com/questions/4258/missing-argument-id-not-specified-in-an-update-call

Please Mark it as "Best Answer" if it helps you.

Thanks.
Chaten Raghav