• dawntr uetesas
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
I have a visualforce page that renders without problem using an iframe to create the table. This was created by a colleague that no longer works with us. We have developed an issue when using the print button in that it no longer renders all items in the iframe repeat, only the first. 
rendered lists:User-added imageUser-added imageon click of print
User-added image
<apex:page lightningStylesheets="false" showHeader="false" standardController="Apprentice__c" >
 <style>
      @media print
      {    
      .no-print, .no-print *
      {
      display: none !important;
      }
      }
   </style>
   <apex:slds />

   <apex:form >
      <div class="no-print slds-align_absolute-center slds-m-top_small slds-m-bottom_medium">
         <apex:commandButton value="Print" Onclick="window.print();"/>
      </div>
      <div class="slds-grid slds-wrap slds-align_absolute-center slds-text-body_small slds-box">
         <div class="slds-col slds-small-size_1-of-3 slds-large-size_1-of-3">
            <B>
               <apex:outputText >Apprentice: </apex:outputText>
            </B>
            <br/>
            <span>
               <apex:outputtext value="{!Apprentice__c.Apprentice_name__c}" style="width:95%"/>
            </span>
         </div>
         <div class="slds-col slds-small-size_1-of-3 slds-large-size_1-of-3">
            <B>
               <apex:outputText >Employer: </apex:outputText>
            </B>
            <br/>
            <span>
               <apex:outputtext value="{!Apprentice__c.Employer_name__c}" style="width:95%"/>
            </span>
         </div>
         <div class="slds-col slds-small-size_1-of-3 slds-large-size_1-of-3">
            <B>
               <apex:outputText >Apprenticeship: </apex:outputText>
            </B>
            <br/>
            <span>
               <apex:outputtext value="{!Apprentice__c.Apprenticeship_Title__c}" style="width:95%"/>
            </span>
         </div>
      </div>
     <div class="slds-grid slds-wrap slds-text-body_small slds-box">
         <div class="slds-col slds-small-size_1-of-1 slds-large-size_1-of-1 slds-m-bottom_medium">
            <b>Skillscan Scoring Instructions:-</b>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 1 - Novice</B><br/>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 2 - Emerging</B><br/>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 3 - Developing.</B><br/>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 4 - Competent</B><br/>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 5 - Proficient</B><br/>
         </div>
         <div class="slds-col slds-small-size_1-of-2 slds-large-size_1-of-2 slds-m-bottom_small">
            <B> 6 - Expert</B><br/>
         </div>
      </div>
      <apex:repeat value="{!Apprentice__c.Apprentice_KSB__r}" var="SkillscanKSB">
         <iframe frameBorder="0" scrolling="no" height="200px" id="Hybrid_AppComponent_Details" name="Hybrid_AppComponent_Details" src="/apex/Skillscan_KSB_Details?id={!SkillscanKSB.Id}" width="100%"></iframe>
      </apex:repeat>
   </apex:form>
</apex:page>
Any advice as to why this has changed would be appreciated
 
I am doing a pretty basic Order Management implementation and I've been struggling to get voids to process correctly.  Even just using the bundled Cancel Items Flow, with no changes, cancelling items does not lead to any void on the authorization.

For example:  Someone orders 2 products, $500 a piece.  The total authorization is $1000.  We have an open (uncaptured) authorization for $1000.  Then the customer cancels one of the two items using a 100% verbatim copy of the bundled Cancel Items Flow.  The item shows as cancelled on the Order Summary, but no Auth Reversal or Pending Auth Reversal amount shows up on the Order Payment Summary.  Checking with Stripe, no void call was received.  I have tried this on our other custom payment methods and the apex classes themselves are never even instantiated.

Noticing this, I tried to add the auth reversal directly to my own code:

    @future
    public static void processVoid(Id orderSummaryId, Id authorizationId,  Id accountId, Double authReversalAmount) {

        ConnectApi.AuthorizationReversalRequest req = new ConnectApi.AuthorizationReversalRequest();
        req.amount = authReversalAmount;
        req.accountId = accountId;
        ConnectApi.AuthorizationReversalResponse arr = ConnectApi.Payments.reverseAuthorization(req, authorizationId);
        

However this really doesn't work consistently and I don't know why.  Sometimes the void will make it through to the payment processor - particularly with my own payment adapters this seems to work at least some of the time.  Sometimes it won't.  Sometimes it actually happens twice (this happened with the Stripe OM adapter) and we end up voiding more than we are supposed to.  I have closely monitored the debug logs and made sure to do all my clicks through the flow extra slowly to make sure I don't have duplicate clicks / etc - there really is no rhyme or reason to it.  When it doesn't work, I'll usually get the error:

13:40:49.22 (392714288)|VARIABLE_ASSIGNMENT|[23]|inErrorCode|"ALREADY_IN_PROCESS"

This is using the Salesforce-provided Stripe OM Async adapter - which to me is almost a reference implementation so it really ought to work properly, I have seen it with my payment adapters as well.  There is really no further context - there is an expanded error message on the next line but it doesn't tell you anything else, it just repeats that.


My next work around is going to be to just skip over the whole commerce payments system and make my own direct API calls to execute the voids as normal callouts.  However, I think we all know that's a terrible kludge.  What is the right answer here?  We can't just leave these authorizations open and pending forever.  In the case of one of my payment adapters, if you don't void the authorization the customer could start receiving bills to pay off their loan when you haven't even captured yet.  The void has to be made to ensure the payment is actually cancelled.  We also get calls from customers who complain the authorization hasn't left their transaction history.  So far we have been manually voiding on the payment processors' websites which is definitely not ideal.  I would prefer that the void be made by Salesforce during the ensureRefundsAsync call (or maybe we need an ensureAuthReversalAsync call or something) and then reflect properly in the order payment summary - that would be ideal.
Hello,

I have created a custom field (checkbox) under the opportunity object. I would like to prevent any files from being uploaded to the opportunity if the box is checked. I am having trouble creating the apex trigger.