You need to sign in to do that
Don't have an account?
Julio Hernandez
Apex:inputfield value
Hi All,
Hope everyone is doing well before the holidays.
I am having an issue trying to create a VF page to use as a Quick Action. I want to use Apex:inputfield to have a lookup field of our users so when our case managers are in a case they can use the quick action button to assign the case quickly to another user. My could works up until the part where I try to get the value of the Apex:inputfield, the user's name. Any suggestions or arrows pointing in the right direction will be greatly appreciated.
Hope everyone is doing well before the holidays.
I am having an issue trying to create a VF page to use as a Quick Action. I want to use Apex:inputfield to have a lookup field of our users so when our case managers are in a case they can use the quick action button to assign the case quickly to another user. My could works up until the part where I try to get the value of the Apex:inputfield, the user's name. Any suggestions or arrows pointing in the right direction will be greatly appreciated.
<apex:page docType="html-5.0" standardController="Case" title="Case Assign"> <apex:remoteObjects > <apex:remoteObjectModel name="Case" fields="Id,OwnerId,Status"/> </apex:remoteObjects> <script src ="/soap/ajax/35.0/connection.js"></script> <apex:form id="form"> <apex:inputField value="{!case.ownerID}" id="newOwner"/> </apex:form> <div class="mypage"> <button onclick="assignOwnership()">Assign Ownership</button> </div> <script> function assignOwnership() { var jq$ = jQuery.noConflict(); var newOwn = jQuery('[id$=newOwner]').val(); alert(newOwn); var caseObj = new sforce.SObject("Case"); caseObj.Id = "{!Case.Id}"; caseObj.OwnerId = newOwn; caseObj.Status = 'In Progress'; var result = sforce.connection.update([caseObj]); if (result[0].success=='false') { alert(result[0].errors.message); } else { location.reload(true); } } </script> </apex:page>
I changed my code a bit because it wasnt working. I am able to pull the owner ID now but I can't seem to add it to the case Owner ID.
Here is my updated code.