You need to sign in to do that
Don't have an account?
Ramon Pereira
Capture id Account
I have a field (account.id) that opens a window to search. I would like to capture the id of the account that I selected. In my organization I have multiple accounts with the same name and perform a SOQL query passing the name as parameter end up retrieving the wrong record. Someone has gone through this problem?
I managed to solve.
It has a hidden field type that is filled when you select some information using the lookup. This field has the id of the field that has the lookup and acresenta "_lkid" at the end of your id field. Ex: field id = "accoountid" Have your lookup field will be hidden id = "accoountid__lkid."
All Answers
Can you provide more detail on exactly what you're doing or trying to do?
OK,
I have the following page:
In the field ( <apex:inputField value="{!opportunity.accountId}" required="true" id="campoConta" onchange="mover_valor();setaData();retornaContato()" />) I capture the value of it and call a javascript function to access my controller (@ remoteAction). But to capture the value of the field, he gave me the name and not the ID. My query in SOQL would be more accurate if the account ID and not the name, since I have several accounts with the same name.
One of the functions that call is this:
No lugar de (Where Account.Name =:nomeConta) gostaria de passar (Where Account.Id =: idAccounta) da conta, assim minha consulta poderar trazer o contato automatico.
Hi,
Can you share the functions where you're passing the value? (Opportunity.AccountId)
Hello,
The Account.id field is a field of research that I click on a magnifying glass and opens a window for me with the bills that I can select. When selecting an account it sets the value of the field with the account name. From this name I realize some conultas in SOQL to bring information relating to this account. However in my organization, I have several accounts with the same name and end up bringing other account information. In the image shown below is the window that I use to search for your account.
Hello,
By doing some research on the forums, I found something like customize lokup standard sales force. However in my case it will not be necessary if I can capture the ID that lokup capture internally because it captures the name and Id of the selected record, put the id is not shown to the User.
I managed to solve.
It has a hidden field type that is filled when you select some information using the lookup. This field has the id of the field that has the lookup and acresenta "_lkid" at the end of your id field. Ex: field id = "accoountid" Have your lookup field will be hidden id = "accoountid__lkid."