• Felipe Pinto
  • 0 Points
  • Member since 2021

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 3
There is code (that I did not originally write) that I have been digging through to try to find out how to make a field required. What this code is doing: On a case, the user can select an option to "Tag Images". This will take them to a component and they can fill out specified fields. After the select "Submit", this will create a Case File record and it will be linked to the case. On the component screen, there are about 6 fields. Two of them need to be required to move forward. One is currently required and I will provide screenshots below.
They select a photo to tag:
User-added image
They then get taken to a screen to fill out information about the image(s). Primary Reason (Return_Reason__c) and Secondary Reason (Return_Reason_Secondary__c) need to be required just like Order Line (Order_Line__c) is. I was able to add the asterisks in the code but I cannot get it to error on null. Here is the screen:
User-added image
When you leave Order Line blank, here is the error:
User-added imageI need this to happen when Primary Reason and Secondary Reason are left blank as well. After looking through all of the code, I found the component screen and added the highlighted text to show the asterisks on the two fields:
User-added imageThe only other thing I could find was in the Helper, I believe this is where the error message comes from for the Null Order Line:
} else if(state === "ERROR"){
                var errors = action.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        var toastEvent = $A.get("e.force:showToast");
                            title : 'Error',
                            message:'There is an error '+errors[0].message+'',
                            mode: 'sticky',
                            key: 'info_alt',
                            type: 'error'

But what I cannot find is the middle piece here. Where would it state in the code that IF Order Line is null - Display this error? Full Component in comments.
Thank you very much!!!!


In any mobile flow, when finishing it shows a white screen with a green check and saying '[flow_name] completed!'. However in our mobile flows, we have some field validations at first and in some cases shows a custom error message, warning the user that cannot perform the action. And right away, when doing next on the flow, it shows the message that finished with success, misleading the user with the outcome.

It's possible to remove this screen or even change it?

Hi ,

I created a edit page using visualforce using custom controller but lookup fields are not visible.
How can i get over this.

Thank You.