• Dan Vega
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 5
    Replies
I have a publicly available page through salesforce sites. It was working before our sandbox got upgraded to Spring 2020 release. In order to replicate the problem a salesforce site needs to be created. The LWC will be embedded within salesforce site VFP.

I gave the external user access to Case object (read/edit) and visibility of fields to be displayed.

I get identical issue with aura component "lightning:recordEditForm" and LWC "lightning-record-edit-form".

I could replace the lightning-record-edit-form with input fields, however, it makes things complicated with dependent picklists.


VFP:
<apex:page standardStylesheets="false" applyBodyTag="false" sidebar="false" showHeader="false">
    <apex:includeLightning />
    <div id="container"></div>
    
    <script>
    $Lightning.use("c:Site_LWC_Viewer_App", function()
    {
        $Lightning.createComponent(
            "c:testLWC",
            {'greeting':'Somnath'},
            "container",
            function(cmp)
        {
            console.log('component created');
        });
    });
    </script>
</apex:page>

AURA APP - "Site_LWC_Viewer_App":
<aura:application extends="ltng:outApp" access="GLOBAL" implements="ltng:allowGuestAccess">
</aura:application>

LWC - "testLWC":
<template>
    <lightning-record-edit-form object-api-name="Case">
        <lightning-messages></lightning-messages>

        <lightning-input-field field-name="Subject"></lightning-input-field>
        
        <lightning-button   class="slds-m-top_small"
                            type="submit"
                            label="Create new">
        </lightning-button>
    </lightning-record-edit-form>
</template>

​​​​​​​ERROR:
Error Message
Hi there

Salesforce does not allow you to create PDF attachments in batch job.

This is work around to that.
https://developer.salesforce.com/forums/?id=906F0000000AlGoIAK

It works!

But As of Summer 15, Salesforce have implemented a critical update "PageReference getContent() and getContentAsPDF() Methods Treated as Callouts". Once enabled, you may get the rather uninformative error "(304497466)|FATAL_ERROR|System.CalloutException: Callout loop not allowed".

And so I have the problem described in this blog: http://codrspace.com/gwickman/callout-loop-not-allowed-error-when-using-getcontent-and-getcontentaspdf/

Can someone please help me get around this error or help with another way to create PDF attachments for emails in a batch job?

Thank you very much


 

Hi I need so expert help...

 

I have an APEX REST POST method that is being called from an external system 'A'.

 

Processing this POST I need to callout to another external system 'B' and based on its response continue with my application logic, eventually returning the result to system 'A'.

 

The problem is that I'm getting an Error:  "System.CalloutException: Callout loop not allowed"

 

This is really important.

Any suggestion how can I achieve the flow I described?

 

Many thanks

 

Kruvi

  • February 15, 2012
  • Like
  • 0
Hi there

Salesforce does not allow you to create PDF attachments in batch job.

This is work around to that.
https://developer.salesforce.com/forums/?id=906F0000000AlGoIAK

It works!

But As of Summer 15, Salesforce have implemented a critical update "PageReference getContent() and getContentAsPDF() Methods Treated as Callouts". Once enabled, you may get the rather uninformative error "(304497466)|FATAL_ERROR|System.CalloutException: Callout loop not allowed".

And so I have the problem described in this blog: http://codrspace.com/gwickman/callout-loop-not-allowed-error-when-using-getcontent-and-getcontentaspdf/

Can someone please help me get around this error or help with another way to create PDF attachments for emails in a batch job?

Thank you very much


 
Requirement:- is Generate the PDF and and send email notification and insert new related record to keep track of the pdf and attachment to the record.