• Sankalp Jhingran
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 12
    Replies
I have a very simple Lightining component included in Chatter of a case record, and I am trying to get the recordId of the case, but its coming as 'undefined'. As per the docs, I have implemented force:hasRecordId marker interface. 

Component:
<aura:component implements="force:lightningQuickAction,force:hasRecordId">
    <!-- recordId is always empty here -->
    Record Id is =====> {!v.recordId}
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>

Controller:
({
    doInit: function(component, event, helper) {
        console.log(component.get("v.recordId"));  //debug console shows 'undefined' here
    } 
})
Is there anything I am missing here? Thanks in advance.
 
Hi All,

I have generated an apex class from a WSDL and I am making callouts to a third party webservice. It has a edit method which accepts 3 arguments, 1st username, 2nd password and 3rd accepts an XML within CDATA tags.

Callout is working fine when the request is generated using SOAP UI, however from salesforce all less than signs(<) in the 3rd parameter are getting converted to "&lt;" in the final request.

Here is the line I am passing for the 3rd parameter in CDATA tag:
String xml = '<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>';

XmlStreamWriter xsw = new XmlStreamWriter();
xsw.writeCData(xml);
String xmlString = xsw.getXmlString();

Here is the resulting string printed with CDATA tags:
00:04:24.047 (47225666)|USER_DEBUG|[73]|DEBUG|############## <![CDATA[<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>]]>

Here is the debug for the request object:
00:16:20.067 (67571169)|USER_DEBUG|[312]|DEBUG|#######################1 edit_element:[apex_schema_type_info=(http://xmlns.enlighta.com/WebService, true, false), field_order_type_info=(in0, in1, in2), in0=sankalp@someemail.com, in0_type_info=(in0, http://xmlns.enlighta.com/WebService, null, 1, 1, false), in1=password, in1_type_info=(in1, http://xmlns.enlighta.com/WebService, null, 1, 1, false), in2=<![CDATA[<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>]]>, in2_type_info=(in2, http://xmlns.enlighta.com/WebService, null, 1, 1, false)]

Now, when I saw the complete SOAP request in the debug log, I found &lt; signs in the request for the 3rd parameter as below:
00:16:20.071 (71082584)|CALLOUT_REQUEST|[314]|<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header /><env:Body><edit xmlns="http://xmlns.enlighta.com/WebService"><in0>sankalp@someemail.com</in0><in1>password</in1><in2>&lt;![CDATA[&lt;Contract id="Contract-6765031">&lt;ContractName>1000 CRM Subscriptions2&lt;/ContractName>&lt;ContractId>2320&lt;/ContractId>&lt;Division>6749812&lt;/Division>&lt;SubDivision>6749934&lt;/SubDivision>&lt;Vendor>6749092&lt;/Vendor>&lt;Description>1000 CRM Subscriptions2&lt;/Description>&lt;/Contract>]]&gt;</in2></edit></env:Body></env:Envelope>

So, the xml reaching to the third party is incorrect.
Any help is appreciated.

Thanx,
Sankalp
Hi All,

I have generated an apex class from a WSDL and I am making callouts to a third party webservice. It has a edit method which accepts 3 arguments, 1st username, 2nd password and 3rd accepts an XML within CDATA tags.

Callout is working fine when the request is generated using SOAP UI, however from salesforce all less than signs(<) in the 3rd parameter are getting converted to "&lt;" in the final request.

Here is the line I am passing for the 3rd parameter in CDATA tag:
String xml = '<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>';

XmlStreamWriter xsw = new XmlStreamWriter();
xsw.writeCData(xml);
String xmlString = xsw.getXmlString();

Here is the resulting string printed with CDATA tags:
00:04:24.047 (47225666)|USER_DEBUG|[73]|DEBUG|############## <![CDATA[<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>]]>

Here is the debug for the request object:
00:16:20.067 (67571169)|USER_DEBUG|[312]|DEBUG|#######################1 edit_element:[apex_schema_type_info=(http://xmlns.enlighta.com/WebService, true, false), field_order_type_info=(in0, in1, in2), in0=sankalp@someemail.com, in0_type_info=(in0, http://xmlns.enlighta.com/WebService, null, 1, 1, false), in1=password, in1_type_info=(in1, http://xmlns.enlighta.com/WebService, null, 1, 1, false), in2=<![CDATA[<Contract id="Contract-6765031"><ContractName>1000 CRM Subscriptions2</ContractName><ContractId>2320</ContractId><Division>6749812</Division><SubDivision>6749934</SubDivision><Vendor>6749092</Vendor><Description>1000 CRM Subscriptions2</Description></Contract>]]>, in2_type_info=(in2, http://xmlns.enlighta.com/WebService, null, 1, 1, false)]

Now, when I saw the complete SOAP request in the debug log, I found &lt; signs in the request for the 3rd parameter as below:
00:16:20.071 (71082584)|CALLOUT_REQUEST|[314]|<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header /><env:Body><edit xmlns="http://xmlns.enlighta.com/WebService"><in0>sankalp@someemail.com</in0><in1>password</in1><in2>&lt;![CDATA[&lt;Contract id="Contract-6765031">&lt;ContractName>1000 CRM Subscriptions2&lt;/ContractName>&lt;ContractId>2320&lt;/ContractId>&lt;Division>6749812&lt;/Division>&lt;SubDivision>6749934&lt;/SubDivision>&lt;Vendor>6749092&lt;/Vendor>&lt;Description>1000 CRM Subscriptions2&lt;/Description>&lt;/Contract>]]&gt;</in2></edit></env:Body></env:Envelope>

So, the xml reaching to the third party is incorrect.
Any help is appreciated.

Thanx,
Sankalp

 

Hi All,

I have a Requirement to Create a Custom Button on record detail page for Copying data from Custom Object with some Record Type to create a record on a Standard Object with Record Type and Map their fields?




 

There is a table:
http://akiradio-developer-edition.na9.force.com/

 

Value Portfolio Revenue Run Rate and IPT Revenue Target for your line of business are set by default. Requires that by clicking on the field could change the value, and perform calculations.


Sorry for my English.

 

 

 


code:

public class DecimalController
{
    public Decimal Portfolio {get; set;}
    public Decimal Revenue_Target {get; set;}
    public Decimal Estimated {get; set;}
    public Decimal Estimated_Revenue {get; set;}
    public Decimal Market {get; set;}
    public Decimal Net_Annualized {get; set;}
    
    
    public string Portfolio_name {get; set;}
    public string Revenue_Target_name {get; set;}
    public string Estimated_name {get; set;}
    public string Estimated_Revenue_name {get; set;}
    public string Market_name {get; set;}
    public string Net_Annualized_name {get; set;}
    
    public string Error {get; set;}
    
    
    public DecimalController ()
    {
        Portfolio = 1500000;
        Revenue_Target = 1600000;
        Portfolio_name = 'Portfolio Revenue Run Rate';
        Estimated_Revenue_name = 'Estimated Revenue Attrition Rate';
        Revenue_Target_name = 'IPT Revenue Target for your line of business';
        Market_name = 'Market Effect';
        Estimated_name = 'Estimated Gross Annualized Revenue Target';
        Net_Annualized_name = 'Net Annualized Revenue Target';
        
    }
    
    public PageReference reckoning ()
        {
            if (Estimated_Revenue> = 0 && Market> = 0)
            {
                decimal result = Portfolio * Estimated_Revenue/100 + (Revenue_Target - Portfolio) * 2 - ((Market/100) * Portfolio);
                Estimated = result;
                Net_Annualized = result / 2;
            }
            else
            {
            
                Error = 'Error, enter values> 0 or = 0';
                

            }
           return null;
         }

        

}


<apex:page controller="DecimalController" showHeader="false" sidebar="false">
<apex:pageBlock title="Goal calculator">
<apex:pageBlockSection>
        <apex:form>
            <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Portfolio_name}" width="300"/>
                <apex:column value="{!Portfolio}"/>
            </ Apex: pageBlockTable>
 
            <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Estimated_Revenue_name}" width="300"/>
                <apex:column>
                    <apex:inputText value="{!Estimated_Revenue}"/>
                </ Apex: column>
            </ Apex: pageBlockTable>

            <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Revenue_Target_name}" width="300"/>
                <apex:column value="{!Revenue_Target}"/>
            </ Apex: pageBlockTable>

             <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Market_name}" width="300"/>
                <apex:column>
                    <apex:inputText value="{!Market}"/>
                </ Apex: column>
            </ Apex: pageBlockTable>
            <apex:commandButton action="{!reckoning}" value="reckoning"/>
            
             <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Estimated_name}" width="300"/>
                <apex:column value="{!Estimated}"/>
            </ Apex: pageBlockTable>
            
             <apex:pageBlockTable value="{!Portfolio}" var="i">
                <apex:column value="{!Net_Annualized_name}" width="300"/>
                <apex:column value="{!Net_Annualized}"/>
            </ Apex: pageBlockTable>
            {! Error}
    
                               
        </ Apex: form>
</ Apex: pageBlockSection>
</ Apex: pageBlock>
    
</ Apex: page>

Hi,

 

I hope you all are doing well.Here i have one requirement.I have to set displayname for to address in email. can anyone help me in this problem.Below is the example that i have given:-

 

in to address it si displayed as :- "minkesh.patel@gmail.com" <Minkesh.patel@gmail.com>

I want to show like :- "Minkesh Patel" <Minkesh.patel@gmail.com>

 

Thanks,

Minkesh Patel

i want to create a method (via PUT) of the Apex REST web service  to receive a list of string and also the code to invoke it from java.

  • December 06, 2011
  • Like
  • 0

Hi,

 

I am trying use the SOAP login call for portal user. With the user credentials, I could login through portal login page in browser. I am trying to login the same user using SOAP call (portal id and organization id are provided in request). But the call is failing with error message "INVALID_LOGIN: Invalid username, password, security token; or user locked out.".

 

Can you please help me in handling this. Do We need to have some settings for the user so that soap login is allowed?

Hi, I am trying to implement the dynaimic search as found on Jeff Douglass' page (http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/) but i've run into a problem...

 

What is supposed to happen is when you type into the input box the results are filtered out letter by letter - this is the bit that's not working, i'm not sure if the problem is in the SQL on the controller, i have a feeling its in the sql but i have tried almost everything and i've hit a blank so i thought i'd ask for some help!!!

 

If someone could give me a bit of help / guidance i would be very thankful!

 

Apex Class

 

public with sharing class ContactSearchController {

        

  // the soql without the order and limit
  private String soql {get;set;}
  // the collection of contacts to display
  public List <Account> accounts {get;set;}

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to last name
  public String sortField {
    get  { if (sortField == null) {sortField = 'Name'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 60'; }
    set;
  }

  // init the controller and display some sample data when the page loads
  public ContactSearchController() {
    soql = 'select Name,  fl_buy__c, fl_sell__c  from account where name != null';
    runQuery();
  }

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {
      accounts = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 60');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }

  }

   // runs the search with parameters passed via Javascript
  public PageReference runSearch() {
  
    String Name = Apexpages.currentPage().getParameters().get('Name');
    String fl_buy = Apexpages.currentPage().getParameters().get('fl_buy__c');
    String fl_sell = Apexpages.currentPage().getParameters().get('fl_sell__c');

    
    soql = 'select Name from account where Name != null';
    if ( (null!= Name) && (!''.equals(Name)) )
      soql += 'and Name LIKE \''+String.escapeSingleQuotes(Name)+'%\'';
    if ( (null!= fl_buy) && (!''.equals(fl_buy)) )
      soql += ' and fl_buy CONTAINS \''+String.escapeSingleQuotes(fl_buy)+'%\'';
    if ( (null!= fl_sell) && (!''.equals(fl_sell)) )
      soql += ' and fl_sell CONTAINS \''+String.escapeSingleQuotes(fl_sell)+'%\'';
      
        

    // run the query again
    runQuery();

    return null;
  }

  

}

 

 

VF Page

 

<apex:page controller="ContactSearchController" sidebar="false">
  <apex:form >
  <apex:pageMessages id="errors" />
<br/>
  <apex:pageBlock title="Find Me An Account!" mode="edit">
<table width="100%" border="0">
    <tr>
        <td width="200" valign="top">

              <apex:pageBlock title="Search" mode="edit" id="criteria">

              <script type="text/javascript">
                  function doSearch() {
                        searchServer(
                              document.getElementById("Name").value,
                              document.getElementById("fl_buy__c").value,
                              document.getElementById("fl_sell__c").value
                        );
                  }
              </script> 

          <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results">
              <apex:param name="Name" value="" />
              <apex:param name="fl_buy__c" value="" />
              <apex:param name="fl_sell__c" value="" />
           </apex:actionFunction>
           
<table cellpadding="2" cellspacing="2">

    <tr>
        <td style="font-weight:bold;">Account Name<br/>
            <input type="text" id="Name" onkeyup="doSearch();"/>
        </td>
    </tr>
    
    <tr>
        <td style="font-weight:bold;">Buy Currency<br/>
            <input type="text" id="abuy" onkeyup="doSearch();"/>
        </td>
    </tr>
    
    <tr>
        <td style="font-weight:bold;">Sell Currency<br/>
            <input type="text" id="asell" onkeyup="doSearch();"/>
        </td>
    </tr>

    
 
    <tr>

    </tr>
</table>

      </apex:pageBlock>
</td>
<td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!accounts}" var="account">

<apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputLink value="/{!account.id}">{!account.Name}</apex:outputLink>
            </apex:column>

         <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Buy Currency" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="fl_buy__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputLink value="/{!account.id}">{!account.fl_buy__c}</apex:outputLink>
            </apex:column>
            
         <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Sell Currency" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="fl_sell__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputLink value="/{!account.id}">{!account.fl_sell__c}</apex:outputLink>
            </apex:column>

           

        </apex:pageBlockTable>

    </apex:pageBlock>
</td>
</tr>
</table>

  

  </apex:pageBlock>

  </apex:form>

</apex:page>

 

Hi All,

 

I have written an apex controller and created a visual force page and i had used datatable for this.The master object is Order__c and child is Job__c. Suppose if there are 5 jobs related to an Order.I display this in visual force page by using dataTable.

 

I am not able to get alternate colours for all the 5 jobs.For example if there is 5 jobs and i user green and blue colour for even and odd.Then jobs in data table should display as blue,green ,blue,green,

 

Here is the Visual force page which i had used.

<apex:page standardController="Order__c"  showHeader="false" extensions="PopulateOrderValues" >
  <html>
<head>
<title>Order Received</title>
</head>
<style type="text/css">
c1 { color: #fae1c3; }
c2 { color: #FF0000; }
</style>


<body>


<table width="600" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="https://c.cs5.content.force.com/servlet/servlet.ImageServer?id=015O00000008wm7&oid=00DO0000000CqOz&lastMod=1320735422000"/></td>
  </tr>
  <tr>

    <td height="70" align="center" valign="top"><font color="#646464" size="5" face="Helvetica, Arial, sans-serif"><Center>THANK YOU FOR YOUR ORDER!</center></font><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">We will send you a notification once your order is ready for shipment.</font></td>
  </tr>
  <tr>
    <td height="30" align="center" valign="top"><img src="" width="600" height="1"/></td>
  </tr>
  <tr>
    <td><table width="600" border="0" cellpadding="0" cellspacing="0">
      <tr>

        <td width="25">&nbsp;</td>
        <td width="550" height="30" valign="top"><font face="Helvetica, Arial, sans-serif" color="#646464" size="3" style="font-size:19px">ORDER INFORMATION</font></td>
        <td width="25">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><table width="550" border="0" cellspacing="0" cellpadding="0">
          <tr>

            <td width="95"><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Order number</font></strong></td>
            <td width="180"><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!Order__c.Order_ID__c}</font></td>
            <td width="95" rowspan="5" valign="top"><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Deliver to</font></strong></td>
            <td width="180" rowspan="5" valign="top"><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!currentOrder.Account__r.PersonMailingStreet}, {!currentOrder.Account__r.PersonMailingCity},
             {!currentOrder.Account__r.PersonMailingState},{!currentOrder.Account__r.PersonMailingPostalCode},{!currentOrder.Account__r.PersonMailingCountry}, </font></td>
          </tr>
          <tr>
            <td><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Cost centre</font></strong></td>
            <td><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!Order__c.Cost_Center__c}</font></td>
            </tr>
          <tr>

            <td><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Employee</font></strong></td>
            <td><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!currentOrder.Contact__r.Name}</font></td>
            </tr>
          <tr>
            <td><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Phone</font></strong></td>
            <td><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!currentOrder.Account__r.Phone}</font></td>
            </tr>

          <tr>
            <td><strong><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">Email</font></strong></td>
            <td><font face="Helvetica, Arial, sans-serif" color="#646464" size="2" style="font-size:12px">{!Order__c.Contact_Email__c}</font></td>
            </tr>
        </table></td>
        <td>&nbsp;</td>
      </tr>     
     <tr>
        <td>&nbsp;</td>
        <td height="20">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      nasir
     <style type="text/css">

     .h { width:1000px;
      height:200px;}
      
      </style>

    <apex:form >
    <apex:pageBlock >
    <apex:dataTable value="{!job}" var="j" columns="5"  style="Helvetica, Arial, sans-serif" bgcolor="#fae1c3"  >
    
    <apex:column styleClass="h"  >
                <apex:facet name="header" >Item #</apex:facet>
                <p><apex:outputText value="{!j.Job_ID__c}" styleClass="mystyle"/></p>
    </apex:column>
    <apex:column styleClass="h" >
                <apex:facet name="header">Date</apex:facet>
                <apex:outputField value="{!Order__c.Order_Date__c}"  styleClass="mystyle"/>
    </apex:column>
    <apex:column styleClass="h">
                <apex:facet name="header">Quantity</apex:facet>
                <apex:outputText value="{!j.Quantity__c}"  styleClass="mystyle"/>
    </apex:column>
    <apex:column styleClass="h" >
                <apex:facet name="header">Product</apex:facet>
                
                <Strong><apex:outputText value="EMC Business Card Front"/></Strong>                
                <apex:outputField value="{!j.Front_Template_Name__c}"  styleClass="mystyle"/> 
                
                <Strong><apex:outputText value="Delivery"/></Strong>                
                <apex:outputField value="{!j.Delivery_Country__c}"  styleClass="mystyle"/>
                
                 <Strong><apex:outputText value="Base"/></Strong>                 
                <apex:outputField value="{!j.Material_Type__c}"/>
                
                 <Strong><apex:outputText value="Lamination"/></Strong>                 
                <apex:outputField value="{!j.Lamination__c}"/>
                
                 <Strong><apex:outputText value="Printed Sides"/></Strong>                
                <apex:outputField value="{!j.Printing_Side__c}"/>
                
                 <Strong><apex:outputText value="Dimendions"/></Strong>            
                <apex:outputField value="{!j.Dimension__c}"/>
                
                <Strong><apex:outputText value="Delivery Zone"/></Strong>                
                <apex:outputField value="{!j.Delivery_State__c}"/>
                
                
    </apex:column>
 
    
    <apex:column styleClass="h" >
              <apex:facet name="header">Cost</apex:facet>
              <apex:outputText value="{!j.Item_Price__c}"  styleClass="mystyle"/>
    </apex:column>
   
   </apex:dataTable>
    </apex:pageBlock> 
    </apex:form>  
    
   
   

<table  ALIGN="right" face="Helvetica, Arial, sans-serif" size="2" style="font-size:12px">
<tr>
    <td style="font-size:15px"><Strong><h1>Cost Of Items</h1></Strong></td>
    <td ALIGN="right"><apex:outputText value="{!Order__c.Cost_of_Items__c}"/></td>
</tr> 
<tr>  
    <td style="font-size:15px"><Strong><apex:outputText value="Delivery"/></Strong></td>
    <td ALIGN="right"> <apex:outputText value="{!Order__c.Freight_Cost__c}"/></td>
</tr>    
<tr>
   <td style="font-size:15px"> <Strong><apex:outputText value="Total"/></Strong></td>
    <td ALIGN="right" > <apex:outputText value="{!Order__c.Total_Charges__c}"/></td>
 </tr>
</table>   
      
   
    </table></td>
  </tr> 
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td><img src="" width="600" height="1" style="display:block"/></td>
  </tr>

  <tr>
    <td height="120" ALIGN="center" valign="middle" bgcolor="#E3E3D9"><font face="Helvetica, Arial, sans-serif" color="#646464" size="3" style="font-size:19px">Best regards,The EfficientLive Team</font></td>
  </tr>
</table>


</body>
</html>

</apex:page>

 and controller is 

public  class PopulateOrderValues {
    public Order__c order;
    public Order__c currentOrder{get;set;}
    public List<Job__c> job{get; set;}

    public PopulateOrderValues(ApexPages.StandardController controller) {
        order=(Order__c)controller.getRecord();
        currentOrder=[Select Contact__r.Email,Contact__r.Name,Account__r.Phone,Account__r.PersonMailingCity,Account__r.PersonMailingCountry,
        Account__r.PersonMailingPostalCode,
        Account__r.PersonMailingState,Account__r.PersonMailingStreet from Order__c where id=:Order.id];
        
        job=[Select  id,Job_ID__c,Order_Date__c,Quantity__c,Item_Price__c,Front_Template_Name__c,Delivery_Country__c
        ,Material_Type__c,Lamination__c,Printing_Side__c,Dimension__c,Delivery_State__c from Job__c where Order__c=:order.id ];
        System.debug('Nasir:'+ job);
    }

 Please let me know how can i change the colour for the records.

 

Thanks

Please tell me is it possible to connect jaspersoft iReport with salesforce. If yes then please tell me the ways to connect the salesforce with jaspersoft iReport.

Thanks

Anuraj

  • November 30, 2011
  • Like
  • 0

Hi All,

 

Below is my script used for a custom button. I am unable to store the date and get error like below:

 faultstring:''0.0001823305154980938' is not a valid value for the type xsd:date', 

 

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var connection = sforce.connection;

var ex = new sforce.SObject("CustomF1__c");
ex.DateF1__c = {!DATEVALUE(TEXT(CustomF2__c.DateF2__c))};
ex.Name = "{!CustomF2__c.Name}";

var rs = connection.create([ex]);
if (rs[0].success=='false')
alert("Message"+rs[0].errors.message);

 CustomF2__c is the object where I am creating this button and CustomF1 is the object which I want to create when user hits this button.

Please help me on this. Thanks in advance!

 

Regards,

Lakshman

 

Hi to all!

I'm trying to run a simple visualforce page with JQuery Ajax request on it, to test how Apex Rest API is working. I am using current SessionId as a token, but I get a 401 Unauthorized Error. Can someone tell me what I am doing wrong?

 

Here is the code:

 

<apex:page >
<apex:includeScript value="{!$Resource.JQuery1_6}" />
<script type="text/javascript">
	var sessionId = 'OAuth {!$Api.Session_Id}';
	$(document).ready(function() {
		var url = "{!URLFOR('/services/data/v20.0/sobjects/Account')}";
		$.ajax({
			async: true,
			cache: false,			
            type: 'GET',
            url: url,       
            beforeSend: setHeader,
            success: function (result){
            	console.log(result);	
            }
        });
	});
    function setHeader(xhr) {
        xhr.setRequestHeader('Authorization', sessionId);
        xhr.setRequestHeader('X-PrettyPrint', '1');
   }	
</script>
</apex:page>

Thanks,

Denias


  • November 21, 2011
  • Like
  • 0