You need to sign in to do that
Don't have an account?
Amanda Byrne- Carolina Tiger Rescue
How to fix required Apex:inputField that works on a pc, but not in Salesforce1?
Working on a ticket check-in Salesforce1 app. My relevant page code is:
This works great in my sandbox if I'm on my PC, I cannot click the Submit button without checking the box, and if I try to do so, I get the appropriate error message. However, in our demo, we discovered that in Salesforce1, the user could submit and move on without checking the box.
Does anyone know why this might be happening and what workaround I could create? (I'm pretty rough at Javascipt, so if the workaround is Javascript, extra syntax would be awesome)
I can't imagine that this issue is by design.
<apex:inputField required="true" styleClass="detail" id="agreementField" value="{!Release_Form__c.DTCI_Agreement__c}"> <apex:param name="Type" value="{!Release_Form__c.DTCI_Agreement__c}" assignTo="{!agreement}"/> </apex:inputField> <br/> <apex:commandButton styleClass="btn" action="{!saveRelease}" value="Submit" title="Submit" immediate="false" /> <br/>
This works great in my sandbox if I'm on my PC, I cannot click the Submit button without checking the box, and if I try to do so, I get the appropriate error message. However, in our demo, we discovered that in Salesforce1, the user could submit and move on without checking the box.
Does anyone know why this might be happening and what workaround I could create? (I'm pretty rough at Javascipt, so if the workaround is Javascript, extra syntax would be awesome)
I can't imagine that this issue is by design.
My ipad is a couple of years old, and was running 7.something.
The work ipads are Air2 and running iOS 8.4
But I found another, more elegant solution. Part of the reason I was having so many issues with the different apex solutions I'd been trying was because they were not re-querying my extension controller.
I had a 'well, duh' moment when I was testing a different aspect of the app, and tried a simple if-then solution in the "saveRelease" function, so the code now looks like this (I was also unfamiliar with the 'addError' option):
Page Code: and the extension Controller code looks like this:
It works beautifully.
All Answers
Is the issue that Saleforce1 is ignoring the field DTCI_Agreement__c a sa required field?
thx.
Let me know if this helps. Here is the link with more details about $Component.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_access.htm
Well, after fighting all day to try to get the Apex form validation, I tried your Javascript. (really not a js fan)
It worked! Now I just have to figure out if you can style an alert box...
Thanks! If anyone comes up with an apex method, I'd still like to know.
with this
My ipad is a couple of years old, and was running 7.something.
The work ipads are Air2 and running iOS 8.4
But I found another, more elegant solution. Part of the reason I was having so many issues with the different apex solutions I'd been trying was because they were not re-querying my extension controller.
I had a 'well, duh' moment when I was testing a different aspect of the app, and tried a simple if-then solution in the "saveRelease" function, so the code now looks like this (I was also unfamiliar with the 'addError' option):
Page Code: and the extension Controller code looks like this:
It works beautifully.