• Paul F-2
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
I'm following the Google map example in the Salesforce 1 App Developer Guide.  As in the example, I want to wrap the marker infoWindow in an anchor tag so clicking on the infoWindow contents will redirect to the approriate Salesforce object.  The guide has the code shown below, which works in Salesforce 1 but not in Salesforce.  In Salesforce, I get the following errors:

Refused to display 'https://na15.salesforce.com/a03i0000006qClnAAE' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Uncaught SecurityError: Sandbox access violation: Blocked a frame at "https://c.na15.visual.force.com" from accessing a frame at "https://c.na15.visual.force.com".  The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.

What is the proper URL for redirecting from a Google map infoWindow in a Visualforce page to a standard Salesforce object details page?

Thanks for any help that you can provide.


Salesforce 1 App Developer Guide sample code:

try{
if(sforce.one){
warehouseNavUrl =
'javascript:sforce.one.navigateToSObject(
\'' + warehouse.Id + '\')';
}
} catch(err) {
console.log(err);
warehouseNavUrl = '\\' + warehouse.Id;
}
var warehouseDetails =
'<a href="' + warehouseNavUrl + '">' +

I created a VF page that renders as PDF and a simple VF UI page that generates then attaches the PDF to my custom object when the user clicks a 'Create' button.  This is based on Jeff Douglas's excellent article from July 2010.  Everthing works fine in Salesforce web.  The PDF size is 7 KB. I can view the PDF from the 'Notes and Attachments' related list in Salesforce and Salesforce1.  However, when I generate the PDF from Salesforce1 for Android, everything executes without issue but the PDF size is 111 KB instead of 7 KB. In Salesforce1, the PDF will not display - the new window opens but the body is black. In Salesforce web (IE), Adobe Reader says the file is unsupported or damaged.  

My 'Create' button invokes the method below.  Are there any special requirementst for PDF generation from Salesforce1?
Thanks for any assistance.

public PageReference attachReceipt() {
        /* Get the page reference and set the Id */
        PageReference pdfPage = Page.ReceiptPDF;
        pdfPage.getParameters().put('id', shmtId);
       
        /* get the pdf blob */
        Blob pdf;
        try {
         pdf = pdfPage.getContent();
        } catch (VisualforceException e) {
         System.debug('exception');
        }
        /* add the pdf attachment */
        Attachment a = new Attachment(ParentId = shmtId, Body = pdf, contentType = 'pdf', Name = 'Delivery Receipt.pdf');
        try {
            insert a;
        }
        catch (Exception e) {
            System.debug('EXCEPTION:' + e);
        }
              
        return new PageReference('/'+shmtId);
    }
I have a Visualforce page that use navigator.getUserMedia to display video and grab pictures from the device camera.  It works in SF1 on Chrome - Window 8.1 laptop, Nexus 7 tablet and Razr M phone.  However, in SF1 on Andoid, getUserMedia is undefined.  I think it might be an issue with the SF1 app not having permission to use the camera.  For example, the RedLaser app has permission to 'take pictures and videos' but the SF1 app doesn't have this permission.  If it is a permissions issue, what's the process to submit this as an enhancement to the SF1 app?

On my tablet and phone, getUserMedia uses the front facing camera.  Does anyone know how to make it use the rear facing camera?

Thanks.

I have a VF form with one input field and an 'Enter' command button. Since the input value is almost always the same length, I want to automatically submit the form when the input field is filled.  I'm using jQuery to determine when the field is filled but I cannot figure out how to submit the form. Eventually I want to convert this page to use AJAX so just the form and message are rerender then create a mobile version of the UI. Any suggestions are greatly appreciated.

Here's the code:

<apex:page docType="html-5.0" controller="MyController" standardStylesheets="true" showHeader="true" sidebar="false">
<apex:includeScript value="{!URLFOR($Resource.Mobile_Design_Templates, 'Mobile-Design-Templates-master/common/js/jQuery2.0.2.min.js')}"/>
<script>
    j$ = jQuery.noConflict();
    j$(document).ready( function() {
        j$("input[id$='lu']").keyup( function() {
            if (j$(this).val().length == 20) {
                alert( "Len = 20" );  // this fires
                j$("form[id$='form']").submit();  // form not submitted, input field retains entered value
            }
        });
    });
</script>

<apex:form id="form">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputLabel value="LU"/ >
            <apex:input id="lu" type="text" value="{!inputLU}" html-maxlength="20" />
        </apex:pageBlockSection>
        <apex:pageBlockSection >
            <apex:commandButton action="{!updateLU}" value="Enter"/>
        </apex:pageBlockSection>  
    </apex:pageBlock>
    <apex:pageMessages />
</apex:form>
</apex:page>

I have a flow that initially does a Record Lookup using an Id input field then display a confirmation Screen with a checkbox and the record Name and Status fields. If the update is confirmed by the user (checkbox checked), a Record Update is used to update the Status field = Y. To handle concurrency, the Record Update uses the Id and Status = X, which is the required status for an update. This is done to handle concurrency. If the Record Update is successful, a screen is displayed with a message saying so. The normal flow execution works as expect.  However, if I get to the confirmation screen then update the record from another session, I'm expecting the Record Update to fail because the Status is now Y, instead of X as specified in the Record Update condition, but the fault is not thrown.  Furthermore, the record is not updated, which is good (I have a trigger that udpates a timestamp and the timestamp does not change from what was set by the alternative session).   However, I need the fault thown so I can provide a proper message to the user.  Any idea why the fault is not thrown?

 

Thanks.

Paul F

I'm following the Google map example in the Salesforce 1 App Developer Guide.  As in the example, I want to wrap the marker infoWindow in an anchor tag so clicking on the infoWindow contents will redirect to the approriate Salesforce object.  The guide has the code shown below, which works in Salesforce 1 but not in Salesforce.  In Salesforce, I get the following errors:

Refused to display 'https://na15.salesforce.com/a03i0000006qClnAAE' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Uncaught SecurityError: Sandbox access violation: Blocked a frame at "https://c.na15.visual.force.com" from accessing a frame at "https://c.na15.visual.force.com".  The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.

What is the proper URL for redirecting from a Google map infoWindow in a Visualforce page to a standard Salesforce object details page?

Thanks for any help that you can provide.


Salesforce 1 App Developer Guide sample code:

try{
if(sforce.one){
warehouseNavUrl =
'javascript:sforce.one.navigateToSObject(
\'' + warehouse.Id + '\')';
}
} catch(err) {
console.log(err);
warehouseNavUrl = '\\' + warehouse.Id;
}
var warehouseDetails =
'<a href="' + warehouseNavUrl + '">' +

I created a VF page that renders as PDF and a simple VF UI page that generates then attaches the PDF to my custom object when the user clicks a 'Create' button.  This is based on Jeff Douglas's excellent article from July 2010.  Everthing works fine in Salesforce web.  The PDF size is 7 KB. I can view the PDF from the 'Notes and Attachments' related list in Salesforce and Salesforce1.  However, when I generate the PDF from Salesforce1 for Android, everything executes without issue but the PDF size is 111 KB instead of 7 KB. In Salesforce1, the PDF will not display - the new window opens but the body is black. In Salesforce web (IE), Adobe Reader says the file is unsupported or damaged.  

My 'Create' button invokes the method below.  Are there any special requirementst for PDF generation from Salesforce1?
Thanks for any assistance.

public PageReference attachReceipt() {
        /* Get the page reference and set the Id */
        PageReference pdfPage = Page.ReceiptPDF;
        pdfPage.getParameters().put('id', shmtId);
       
        /* get the pdf blob */
        Blob pdf;
        try {
         pdf = pdfPage.getContent();
        } catch (VisualforceException e) {
         System.debug('exception');
        }
        /* add the pdf attachment */
        Attachment a = new Attachment(ParentId = shmtId, Body = pdf, contentType = 'pdf', Name = 'Delivery Receipt.pdf');
        try {
            insert a;
        }
        catch (Exception e) {
            System.debug('EXCEPTION:' + e);
        }
              
        return new PageReference('/'+shmtId);
    }
I have a Visualforce page that use navigator.getUserMedia to display video and grab pictures from the device camera.  It works in SF1 on Chrome - Window 8.1 laptop, Nexus 7 tablet and Razr M phone.  However, in SF1 on Andoid, getUserMedia is undefined.  I think it might be an issue with the SF1 app not having permission to use the camera.  For example, the RedLaser app has permission to 'take pictures and videos' but the SF1 app doesn't have this permission.  If it is a permissions issue, what's the process to submit this as an enhancement to the SF1 app?

On my tablet and phone, getUserMedia uses the front facing camera.  Does anyone know how to make it use the rear facing camera?

Thanks.

I have a VF form with one input field and an 'Enter' command button. Since the input value is almost always the same length, I want to automatically submit the form when the input field is filled.  I'm using jQuery to determine when the field is filled but I cannot figure out how to submit the form. Eventually I want to convert this page to use AJAX so just the form and message are rerender then create a mobile version of the UI. Any suggestions are greatly appreciated.

Here's the code:

<apex:page docType="html-5.0" controller="MyController" standardStylesheets="true" showHeader="true" sidebar="false">
<apex:includeScript value="{!URLFOR($Resource.Mobile_Design_Templates, 'Mobile-Design-Templates-master/common/js/jQuery2.0.2.min.js')}"/>
<script>
    j$ = jQuery.noConflict();
    j$(document).ready( function() {
        j$("input[id$='lu']").keyup( function() {
            if (j$(this).val().length == 20) {
                alert( "Len = 20" );  // this fires
                j$("form[id$='form']").submit();  // form not submitted, input field retains entered value
            }
        });
    });
</script>

<apex:form id="form">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputLabel value="LU"/ >
            <apex:input id="lu" type="text" value="{!inputLU}" html-maxlength="20" />
        </apex:pageBlockSection>
        <apex:pageBlockSection >
            <apex:commandButton action="{!updateLU}" value="Enter"/>
        </apex:pageBlockSection>  
    </apex:pageBlock>
    <apex:pageMessages />
</apex:form>
</apex:page>

I know there have been a few posts about Flow finish location but I'm still confused about the below. Read documentation but can't figure out how to add a field value for this.

 

My VF page code is below. I want the finish location to be "..../apex/FacilityMain?id="{{!Address_Type__c.Facility__c}

 

I'm not understanding how, or if, I can write the URLFOR statement below to accomplish what's in bold above.  I can only see how to either hardcode values in the URLFOR statement or put an entire field value, not a combination of both.

 

<!-- Calls Flow and passes variables -->
<flow:interview name="AddressSearch" buttonLocation="bottom" finishLocation="{!URLFOR('/001/o')}">  **Want to rewrite this
<apex:param name="vaentrypoint" value="EnterNewAddressType"/>
<apex:param name="vafacilityid" value="{!Address_Type__c.Facility__c}"/>
<apex:param name="vaproviderid" value="{!Address_Type__c.Provider__c}"/>
</flow:interview>
</apex:pageblock>

 

Thanks,

Darrell D