• Gleb Gawriljuk
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hey everyone,

we are building a Lightning Component with the user of the lightning:recordEditForm  to create a record.
 
<lightning:recordEditForm aura:id="input_placementRecordEditForm" 
                                      recordTypeId="{!v.placementRecordTypeId}" 
                                      objectApiName="cxsrec__Placement__c"
                                      onsubmit="{!c.handleSubmit}" 
                                      onsuccess="{!c.handleSuccess}" 
                                      onload="{!c.handleLoad}"
                                      onerror="{!c.handleError}">
<lightning:inputField aura:id="gulp_Sales_Consultant__c" fieldName="gulp_Sales_Consultant__c" value="{!v.placement.gulp_Sales_Consultant__c}"/>


Within this form with have a lookup that we are prefilling in the handleLoa()d method/event:
//component.set("v.placement.gulp_Sales_Consultant__c",  component.get("v.position").cxsrec__Sales_consultant__c);
                   component.find("gulp_Sales_Consultant__c")[0].set("v.value", component.get("v.position").cxsrec__Sales_consultant__c);
However, after the handleLoad() method is run and the field is successfully prefilled, the compontent scrolls down to the fields and the field and the field is focused (highlighted with a blue border).

AM I doing the prefilling of the lookup wrong or how can I stop the component from focusing on the field after it is set by the controller?

Regards,
Gleb
Hey everyone,

we have a flow which we invoke by a Visualforce page to redirect it to an opportunity record after the flow finishs:
<apex:page standardController="Opportunity">   
    <flow:interview name="Opportunity__Flow" finishLocation="/{!Opportunity.Id}">
        <apex:param name="recordId" value="{!Opportunity.Id}"/>
    </flow:interview>   
</apex:page>

Now, this does not work in the Salesforce mobile app. Salesforce hinted me to:
https://developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/salesforce1/vf_dev_best_practices_navigation.htm

Now my Visualforce page looks like:
<apex:page standardController="Opportunity">   

    <flow:interview name="Opportunity_Flow" finishLocation="sforce.one.navigateToSObject(\'' + {!Opportunity.Id} + '\')';">
        <apex:param name="recordId" value="{!Opportunity.Id}"/>
    </flow:interview>
    
    <script type="text/javascript">
        function getRecordURL() {
            var recordURL = 'sforce.one.navigateToSObject(\'' + '{!Opportunity.Id}' + '\')';
            return recordURL;
        }
    </script>   
</apex:page>

I tried it both as a function and dirctly in the finishLocation-parameter. Both lead to the error:
Invalid Page Redirection
The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance. For more information, see Insufficient Privileges Errors. 

Click here to return to the previous page.

Does anyone have experience with flow redirections in the Salesforce mobile app? 

Kind regards,
Gleb