• gonzalol
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
In our integration we bring over sales orders (Master Relationship) and sales order lines (Child) both are different objects, we also bring credits and returns into the same objects. 
When we right a credit or return we bring over the original sales order number and it lands on the child record (line).  What I need is to convert that original sales order number into an ID so that I can link the credit or return to the original sales order.  I need the ID to land in a lookup field using some type of apex code.
Any help is appreciated, new to apex coding.
 

I have configured Live agent for the org, created skills, assigned the System Admin Profile to all the skills. Created a button and deployment.

 

I create a Sites VF page using the code from the deployment guide.

 

No matter what I do, the Offline element always shows. I cannot get the online element to show despite two live agents being logged into the live agent console and the status as available.

 

Anyone have any ideas? btw, this is in sandbox.

 

here is the VF code, very basic, right now just trying to get the ONLINE element to display.

 

<apex:page >
  <h1>Welcome</h1>
   Thank you for contacting customer support
   <!-- START Button code -->
      <a id="liveagent_button_online_573W00000004CAL" href="javascript&colon;//Chat" style="display: none;" onclick="liveagent.startChat('573W00000004CAL')">ONLINE</a><div id="liveagent_button_offline_573W00000004CAL" style="display: none;">OFFLINE</div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('573W00000004CAL', document.getElementById('liveagent_button_online_573W00000004CAL'));
liveagent.showWhenOffline('573W00000004CAL', document.getElementById('liveagent_button_offline_573W00000004CAL'));
});</script>

   <!-- END Button code -->
   
   <apex:outputtext value="TEST TEXT"/>
   
   <!-- Deployment code -->
<script type='text/javascript' src='https://c.la2cs.salesforceliveagent.com/content/g/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la2cs.salesforceliveagent.com/chat', '572W00000004C9X', '00DW0000000IRe9');
</script>
</apex:page>

 

I have spent a few days trying to get the custom sort to work on Quote Line Items on multiple fields.   I googled and searched the forums and found lots of helpful code that got me started.   I created a global class for sorting and have a webservice function that correctly works.   I added the custom javascript button like the forum says and that works.  The problem with this is when the user clicks the sort button, it brings up a screen with the product names in the sorted order.  So if the user clicks save.  It all good.  But the user sees a screen with a list with only product names and not the other fields that are being sorted.  So I created a custom page which almost works.  It shows the sort fields in the list.  The arrows work but the save and cancel button are broken.   

Get this error: Unable to Access Page
You are missing information needed by the page you have attempted to access. If you believe this is an error, please refresh your screen. If the error persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information.

Not sure how to debug to find out what fields is missing and if this approach that I am doing will work.  ANY CLUES??
---------------------------------------------------------------------------------------------------------------------------------------------------------

<apex:page standardController="Quote">
 
<apex:variable var="QuoteName" value="{!Quote.Name}"/>
<apex:variable var="QuoteNumber" value="{!Quote.QuoteNumber}"/>
<apex:variable var="QuoteID" value="{!Quote.ID}"/>

<!-- <apex:pageBlock title="Sort Line Items for Quote {!Quote.Name}" mode="edit"> -->
<apex:pageBlock mode="edit">

<apex:sectionHeader title="Quote" subtitle="{!Quote.Name}"/>

<apex:outputText value="Custom Sort: Use the arrows to sort the products into the desired order."/>

<table cellpadding="0"  cellspacing="0" border='1'>

<form action="/oppitm/lineitemsort.jsp" id="editPage" method="post" name="editPage"
      onsubmit="javascript&colon;saveAllSelected([ document.editPage.duel_select_0 ], [ document.editPage.duel0 ], ',', '\\', '--None--');if (window.ffInAlert) { return false; }" >

<input type="hidden" name="id"     id="id"     value="{!QuoteID}" />
<input type="hidden" name="duel0"  id="duel0"  value="" />
<input type="hidden" name="retURL" id="retURL" value="/{!QuoteID}" />
<input type="hidden" name="save"   id="save"   value=" Save " />

<input type="hidden" name="_CONFIRMATIONTOKEN" id="_CONFIRMATIONTOKEN" value="yQN58ySIY4QOYgFqpKp7921vvbV7VYmaQ5EoYKczxj5dNazdime9nNepdEnPMDabtWtrxQDk38.EWXdTnHtzykYF0rEp4.1AyPH2wH4b2bLTFxF5eYqkkGO5karLiujBR4sYwu.vOvDCJVC.2wHWAmRr.0Y=" />
<input type="hidden" name="cancelURL"    id="cancelURL"    value="/{!QuoteID}" />
<input type="hidden" name="save_new_url" id="save_new_url" value="/oppitm/lineitemsort.jsp" />
    <tr>
        <td>
            <div class="duelingListBox" id="duel">
                <div class="errorMsg" id="editPage_duel_errorMsg" style="display:none">&nbsp;</div>          
                <table class="layout">
                    <tr>
                        <td class="selectCell">
                            <div class="selectTitle">
                                <label for="duel_select_0">Products</label>
                            </div>
                            <select id="duel_select_0" multiple="multiple" name="duel_select_0" size="25">
                                <apex:repeat var="lines" value="{!Quote.QuoteLineItems}">       
                                    <option value="{!lines.Id}">
                                       <!-- <apex:outputText value=" {2}  (Qty={0}   BeginDate={1,date, MM-dd-yyyy}) "> -->
                                       <apex:outputText value=" Qty={0, number, ###,###,###}   BeginDate={1,date, MM-dd-yyyy}   Prd={2}">
                                            <apex:param value="{!lines.Quantity}"/>
                                            <apex:param value="{!lines.BeginDate__c}"/>
                                            <apex:param value="{!lines.ProductName__c}"/>
                                        </apex:outputText>                                                                      
                                    </option>
                                </apex:repeat>
                            </select>
                        </td>
                        <td class="buttonCell">
                            <div class="text">Top</div>
                            <div class="text">
                                <ahref="javascript&colon;window.editPage_DLBEInstance.instMoveTop(document.editPage.duel_select_0,'editPage_duel_errorMsg');">
                                    <img src="/s.gif" alt="Top"  class="doubleArrowUp" title="Top"/>
                                </a>
                            </div>
                            <div class="text">Up</div>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveUp(document.editPage.duel_select_0, null, null, null,'editPage_duel_errorMsg');" id="duel_select_0_up"><img src="/s.gif" alt="Up"  class="upArrowIcon" title="Up"/></a>
                            </div>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveDown(document.editPage.duel_select_0, null, null, null,'editPage_duel_errorMsg');" id="duel_select_0_down"><img src="/s.gif" alt="Down"  class="downArrowIcon" title="Down"/></a>
                            </div>
                            <div class="text">Down</div>
                            <div class="text">
                                <a href="javascript&colon;window.editPage_DLBEInstance.instMoveBottom(document.editPage.duel_select_0,'editPage_duel_errorMsg');"><img src="/s.gif" alt="Bottom"  class="doubleArrowDwn" title="Bottom"/></a>
                            </div>
                            <div class="text">Bottom</div>
                        </td>
                    </tr>
                </table>
            
                <script  type="text/javascript">window.editPage_DLBEInstance=new DuelingListBoxesElement(['duel_select_0'],'editPage_duel_errorMsg');
                </script>
            </div>
        </td>
    </tr>
    <tr>
        <td align="center">
            <input value=" Save "  class="btn" name="save"   title="Save"   type="submit"/>&nbsp;&nbsp;&nbsp;
            <input value="Cancel"  class="btn" name="cancel" title="Cancel" type="submit"/>
        </td>
    </tr>
</form>
</table>
</apex:pageBlock>

</apex:page>

 

 

 

 

 

Hello

 

I have made an Email template with a pdf attachement to send a quotes to the customer from the Salesforce Quotes application. In this application the products can be sorted to easy the reading. That make me a trouble. Because I want to get exactly the same order as I have in the quotes in my email. Actually I get back all the products but the order seems to be random.

 

See my email template code:

 

 

<messaging:emailTemplate subject="Offre de Red Lion Controls - {!relatedTo.QuoteNumber}-{!relatedTo.Name}"
                         recipientType="Contact"
                         language="fr"
                         relatedToType="Quote">
<messaging:plaintextEmailBody >
Cher(e) {!relatedTo.Contact.Name}, 

Veuillez trouver, comme convenu, notre offre ci joint .

Pour toute question, n'hésitez pas à nous contacter.


</messaging:plaintextEmailBody>
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">
<html>
<head>
<style>
    table {
      width:100%;
      border-collapse:collapse;
      margin-top:1px;
      margin-bottom:2px;}
      
      .letter td, .end td{
      padding-bottom:20px;
      
      }

    p, h4 {
      margin-top: 1px;
      margin-bottom:1px;
    }
      
    .footer p{
            padding:1px;
            text-align: center;
            font-size: 6pt;
            font-color:"grey";            
            
            }
            
    .productList td,.productList th{
             border-style: solid;
            border-width: 1px;
            border-color: "black";
            }
      
  
  </style>
  </head>  
<body>
    <div id="test"></div>
  <table class="letter">
      <tr>
        <td style="text-align:right;"><img src="{!$Resource.RedLionLogo}" /></td>
      </tr>
      <tr>
        <td><strong><p>{!relatedTo.Opportunity.Account.Name}</p> 
            <p>{!relatedTo.Opportunity.Account.BillingStreet}</p>
            <p>{!relatedTo.Opportunity.Account.BillingPostalCode} {!relatedTo.Opportunity.Account.BillingCity} </p>
            <p>{!relatedTo.Opportunity.Account.BillingCountry}</p></strong>
        </td>
      </tr>
      <tr>
        <td> <strong>A l'attention de:</strong> {!relatedTo.Contact.Name}</td>
      </tr>
      <tr>
        <td><strong>Date: </strong> {!DAY(today())}/{!MONTH(today())}/{!YEAR(today())}</td>
      </tr>
      <tr>  
        <td><strong>Référence de l'offre: {!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong> </td>
      </tr>
      <tr>
        <td><apex:outputText escape="false" value="{!relatedTo.Quote_Notes_to_customer__c}" /></td>
      </tr>
  </table>
  <div style="page-break-after:always;"> </div>
  
  <h3>Products list:</h3>
    <table class="productList" style="margin-bottom:20px;margin-top:20px;">
        <tr>
            <th> Produit</th><th>Description</th><th>Quantité</th><th>Prix Net</th><th>Prix Total</th>
        </tr>
<apex:repeat var="kot" value="{!relatedTo.QuoteLineItems}">
           <tr>
               <td>{!kot.PriceBookEntry.name}</td>
               <td width="300px">{!kot.Product_Description_FR__c}</td>
               <td style="text-align:center;">{!ROUND(kot.Quantity,0)}</td>
               <td align="right"><apex:outputField value="{!kot.UnitPrice}"/> </td>
               <td align="right"><apex:outputField value="{!kot.TotalPrice}"/>  </td>
           </tr>
</apex:repeat>
       <tr>
           <td colspan="3" style="border:none;"></td> 
          <td style="text-align:right;"><strong>Grand total </strong></td><td style="text-align:right;"><apex:outputField value="{!relatedTo.GrandTotal}"/> </td>
      </tr>
</table>
<table class="end">
      <tr>
          <td>
          <p><strong>Offre valide jusqu'au: </strong>  <apex:outputField value="{!relatedTo.ExpirationDate}"/></p>
          <p><strong>Prix: </strong> Les prix sont en <strong>{!relatedTo.CurrencyIsoCode}</strong>. Les prix net/prix total/grand total sont donnés après remise.</p>
          <p><strong>Frais de port: </strong> <apex:outputField value="{!relatedTo.Opportunity.Account.Transportcostweeklyshipment__c}"/>.</p>
          <p><Strong>Condition de paiement (en jours): </strong> {!relatedTo.Opportunity.Account.Paymentterms__c}.  </p>
          <p><strong>Délai de livraison: </strong> 3-4 jours en moyenne départ usine (peut varier en fonction de l’état des stocks). </p>
          <p><strong>Minimum de commande (Hors frais de port): </strong> 200 {!relatedTo.CurrencyIsoCode}.</p>
          <p><strong>Toutes les commandes sont conditionnées par l'acceptation sans limite des <a name="T&C" href="http://sellmore.redlion.net/intdist/FrenchTerms16-09-2008.pdf">conditions générales de vente </a> de Red Lion.</strong></p>
          
          </td>
      </tr>
      <tr> 
          <td>En espérant que cela correspond à vos attentes.</td>
      </tr>
      <tr>
          <td> Merci d'indiquer le numéro d'offre <strong>{!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong>
          avec votre commande ou tout autre correspondance relative à cette offre.</td>
        </tr>
        <tr>  
          <td>Cordialement,</td>
        </tr>
 </table>
 <table>    
      <tr>
        <td><p>{!$User.FirstName} {!$User.LastName}</p>
            <p>{!$User.Title}</p>
            <p>{!$User.CompanyName}</p></td>
      </tr>
      <tr>
          <td><p>Tel: {!$User.Phone}</p>
              <p>Mobile: {!$User.MobilePhone}</p>
              <p>Email: {!$User.Email}</p>
          </td>
      </tr>   
  </table>
 
</body>
</html>
</messaging:attachment>


</messaging:emailTemplate>

 

I hope you are going to help me, thank.

 

Hi All,

 

Good Day.

 

I would like to override the opportunity creation page for a particular record type.

I have 2 visual force pages "recordTypeSelect" and "opportunityPage". The below are my visual force pages.

 

recordTypeSelect :

 

<apex:page standardController="Opportunity" extensions="SaveClass" action="{!Redirect}">
<h1> Opportunity Record Type Select </h1>
</apex:page>

 

opportunityPage :

 

<apex:page StandardController="Opportunity" extensions="SaveClass">
<apex:pageBlock >
<apex:form >
<table>
<tr>
<td>Opportunity Name</td><td><apex:inputField required="true" value="{!Opportunity.Name}"/></td><td></td>
<td>CloseDate</td><td><apex:inputField required="true" value="{!Opportunity.CloseDate}"/></td>
</tr>
<tr>
<td>Account Name</td><td><apex:inputField required="true" value="{!Opportunity.AccountId}"/></td><td></td>
<td>StageName</td><td><apex:inputField required="true" value="{!Opportunity.StageName}"/></td>
</tr>
<tr><td>Inquiry Number</td><td><apex:inputField value="{!Opportunity.Inquiry_Number__c}"/></td></tr>

<tr><td>Product</td><td><apex:inputField required="true" value="{!Opportunity.Product__c}"/></td></tr>
<tr><td>Engine Model - Primary</td><td><apex:inputField required="true" value="{!Opportunity.Engine_Model_Primary__c}"/></td></tr>
<tr><td><apex:commandButton action="{!save}" value="Save"/><apex:commandButton action="{!cancel}" value="Cancel"/></td></tr>
</table>
</apex:form>
</apex:pageBlock>

</apex:page>
 

 

SaveClass:

public with sharing class SaveClass {

    public SaveClass(ApexPages.StandardController controller) {

    }

 

    public PageReference cancel() {
        PageReference pr = new PageReference('/006/o');
        pr.setRedirect(true);
        return pr;
    }
    
    public pagereference Redirect()
    {
       String rt = ApexPages.currentPage().getParameters().get('RecordType');
       if(rt.equals('012Q0000000CmCZ'))
      {
         String optyURL2 = '/apex/opportunityPage';
         pagereference pageref = new pagereference(optyURL2);
         pageref.setredirect(true);
         return pageref;
      }
      else
      {
         String optyURL2 = '/006/e?retURL=%2F006%2Fo&RecordType=012300000004ISs&ent=Opportunity';
         pagereference pageref = new pagereference(optyURL2);
         pageref.setredirect(true);
         return pageref;  
      }
      
    }
   
}

 

 

I have 6 types of recordtypes. I am overriding the "New" button in the opportunity home page with "recordTypeSelect" vf page.  So, Whenever the user selects the record type from the drop down , he will be redirected as shown in the "SaveClass". I have created a code like , whenever a user is selecting the particular recordtype he will redirected to the vf page "opportunityPage". otherwise he will redirected to a standard opportunity creation page.

 

What I need is , I am able to redirect the user to "opportunityPage" vf page , when he is selecting the particular recordtype. But I am not able to redirect him to the standard opportunity creation page when other record type is selected. The page is keep on refreshing and showing the "recordTypeSelect" vf page alone.

 

How can I fix this..?

 

Thanks in Advance.

 

Manoj.