You need to sign in to do that
Don't have an account?

DML support in VisualForce
Hi
I come across following exception while trying to insert a record in a custom object.
DML currently Not allowed.
I want to just confirm it, whether DML is allowed or not in VisualForce pages controllers ?
Thanks.
I come across following exception while trying to insert a record in a custom object.
DML currently Not allowed.
I want to just confirm it, whether DML is allowed or not in VisualForce pages controllers ?
Thanks.
It definately does work.
If this is a component controller, take a look at the 'allowDML' property of the component tag.
Thanks for feedback.
Actually its a page controller and I didn't get such allowDML property for that.
Any other option ?
Thanks.
private String nameString;
private String cityString;
public void setNameString(String val1) {
nameString = val1!=NULL?val1:NULL;
}
public String getNameString() {
return nameString;
}
public void setCityString(String val2) {
cityString = val2 != NULL ?val2:NULL;
}
public String getCityString() {
return cityString;
}
public List<Account> getAccounts() {
return [SELECT name,BillingStreet,BillingCity,BillingState,BillingPostalcode,Phone FROM Account WHERE Account.Name LIKE :nameString AND Account.BillingCity LIKE :cityString ORDER BY LastModifiedDate LIMIT 120];
else if ( nameString == NULL )
return [SELECT name,BillingCity FROM Account WHERE Account.BillingCity LIKE :cityString ORDER BY LastModifiedDate LIMIT 120];
else if ( nameString != NULL&&cityString == NULL )
return [SELECT name,BillingCity FROM Account WHERE Account.Name LIKE :nameString ORDER BY LastModifiedDate LIMIT 120];
else
return null;
/*Account account = getAccountInfo.getAccountByName(nameString,cityString);
return account; */
}
public PageReference searchAccount() {
return Page.searchTest2;