You need to sign in to do that
Don't have an account?
Hiteshkumar Chaudhari 2
fetch 15 digit record id to update perticular record
i like to update a perticular account number's balence in my bank application for that purpose i need to fetch 15 digit record id and i am unable to fetch it.. kindly help ..
Query
Integer id = [SELECT b1.Id FROM BankApplication__c WHERE b1.Account_Number__c =: accnum ];
Error :
Error: Compile Error: Didn't understand relationship 'b1' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 12 column 25
Query
Integer id = [SELECT b1.Id FROM BankApplication__c WHERE b1.Account_Number__c =: accnum ];
Error :
Error: Compile Error: Didn't understand relationship 'b1' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 12 column 25
string id=[select id from bankapplication__c where account_number__c=:accnum];
this what you need to do
why beacuase you getting error
IN soql you only search with object field name only
but you are trying to modify account balance so you do one thing
bankapplication__c b=[select id,account_balance__c from bankapplication__c where account_number__c=:accnum];
b.account_balance__c=5000;
update b;
All Answers
string id=[select id from bankapplication__c where account_number__c=:accnum];
this what you need to do
why beacuase you getting error
IN soql you only search with object field name only
but you are trying to modify account balance so you do one thing
bankapplication__c b=[select id,account_balance__c from bankapplication__c where account_number__c=:accnum];
b.account_balance__c=5000;
update b;
thnx for the quick reply but after updating query when i try to update balence of my customer it gives error
"b1.Amount__c = b1.Amount__c + Decimal.valueof(damount); "
the above statement wont work for me
can you suggest something ...
<h1>Account Holder Name</h1><apex:inputText id="dname" value="{!dname}" />
System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: BankApplication__c.Amount__c
Error is in expression '{!deposit}' in component <apex:commandButton> in page createaccount: Class.BankAppDemo.deposit: line 23, column 1
Class.BankAppDemo.deposit: line 23, column 1