• Ricky Martin
  • NEWBIE
  • 29 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 13
    Questions
  • 34
    Replies
Hi,

Please help me to correct my code below:

if(AssumptionList.size() > 0){
String strAssumptionFloodOnlyUrl = objArkCampaign.Domain_Name__c + '/Assumption?AssumptionId=' + AssumptionList[0].Assumption_ID__c;
PageReference newFloodOnlyUrl = new PageReference(strAssumptionFloodOnlyUrl);
newFloodOnlyUrl.setRedirect(true);
return;
}
According to the above code it has to redirect to another page(objArkCampaign.Domain_Name__c + '/Assumption?AssumptionId=' + AssumptionList[0].Assumption_ID__c) and display the content of this but it is not doing so. It is printing this page content in the old page itself( The Url in the address bar is also not changing)

Thanks in advance
I would like to create the report based on 3 object.

I have tried the joint report but unable to create the bucket field.So, how to create the table/summary report based on that 3 object.

Report view:

  
OppName || OppStage || Productname || Custom_Object_Field ||

I have used the following code but the page shows as the blank.

Code:

<apex:page renderAs="pdf">
  <apex:iframe height="300" width="180" src="https:www.google.com"  scrolling="true"  /> 
</apex:page>

Note: If we remove the render as pdf. the page shows the webpage. So, how to view teh website as pdf?
I have tried the following cod to render as PDF, but website is not render when using the render as PDF.
If I remove the PDF, the webpage is loading.

    Code:
   
     <apex:page render="pdf">
I jsut use the fram to laod the page here.
    // external webstie link (ex: bing.com)
    </apex:page>
Hi Experts,
How to send the email alert by using the workflow when adding the solution into the case.

Thanks in Advance
I have the three filed like below and I want to calculate the number of out of office hour.

Office hour is : 9:00 to 18:00

Fields :

In Time : date time filed Out Time : date time filed

No. of Out of Office Hour : ?

ex: In time : 1-1-2014 19:00 Out time : 1-2-2014 07:00

No. of Out of Office Hour : 12 hrs.

Kindly let us know, how to calculate in apex trigger / class
Hi Stuffs,

I am tring to uplaod more then 3 MB zip file in to workbench, but I cant upload due to the large size of file so how to overcome this?

Thanks in advance.
I am trying to create web2prospect by using with propertybase app but I got following error. kindly let me know if you know the solutions.

My Code:
<form name="web2prospect" onSubmit="return checkSubmit();" method="get" action="http://box-farbman.cs14.force.com/pba__WebserviceListingsQuery?token=13af2859a8bee90ab97992512aeaaaf2f0d228fa&fields=name;price__c;pba__description_pb__c;bedrooms__c;bathrooms__c;pba__totalarea_pb__c&price__c=[1000000;1500000]&pba__totalarea_pb__c=[2500;]&orderby=Price__c;ASC&getvideos=true&itemsperpage=25&page=1">
<input type="hidden" name="successpage" value="http://www.google.com" />
<input type="hidden" name="errorpage" value="http://www.puthuvannam.com" />
<h1>Lead information</h1>

Error : There was an error. Please try again.Contact data is missing;
Hi,
I have connect and create the new lead by using php but unable to update so how to update the fileds.

When click the submit button: (create lead).

//Creating the Lead Object
     $lead = new stdClass;
     $lead->type = 'Lead';
     $lead->fields = array(
          'FirstName' => $leadFirstName,
          'LastName' => $leadLastName,
          'Company' => $leadCompany,
          'Email' => $leadEmail,
    'Country' => $leadCountry
     );

     //Submitting the Lead to Salesforce
     $result = $connection->create(array($lead), 'Lead');

When CLick Second Button:
Have to update?

Thanks.
Hi,
How to create the Lead using usin classic asp page.
Thanks.
Hi,
I am using clasic asp and I would like to create the lead using that asp page along with vbscript so how to create the lead using VBSCRIPT.

I am beginer. Thanks in advance.
Add the lead in first page, when submitted and generates a second page with some hidden inputs containing the stuff the user submitted in the first page.
Then the second page would update that existing lead.
I have use two contact form like
Step 1, Step 2.

So  if I press the submit button from Step 1, the lead should be create and go to the Step 2 page and update the value into that lead(step 1 page) whatever I give in the Step 2 form.

Hi,
I have created custom object (resumobject) and I would like to add standard fields(name, email,date) along with custom fields so how to add both fields in the custom object.

Regards,
Gobi
Hi Stuffs,

I am tring to uplaod more then 3 MB zip file in to workbench, but I cant upload due to the large size of file so how to overcome this?

Thanks in advance.
I am trying to create web2prospect by using with propertybase app but I got following error. kindly let me know if you know the solutions.

My Code:
<form name="web2prospect" onSubmit="return checkSubmit();" method="get" action="http://box-farbman.cs14.force.com/pba__WebserviceListingsQuery?token=13af2859a8bee90ab97992512aeaaaf2f0d228fa&fields=name;price__c;pba__description_pb__c;bedrooms__c;bathrooms__c;pba__totalarea_pb__c&price__c=[1000000;1500000]&pba__totalarea_pb__c=[2500;]&orderby=Price__c;ASC&getvideos=true&itemsperpage=25&page=1">
<input type="hidden" name="successpage" value="http://www.google.com" />
<input type="hidden" name="errorpage" value="http://www.puthuvannam.com" />
<h1>Lead information</h1>

Error : There was an error. Please try again.Contact data is missing;
Add the lead in first page, when submitted and generates a second page with some hidden inputs containing the stuff the user submitted in the first page.
Then the second page would update that existing lead.
I have used the following code but the page shows as the blank.

Code:

<apex:page renderAs="pdf">
  <apex:iframe height="300" width="180" src="https:www.google.com"  scrolling="true"  /> 
</apex:page>

Note: If we remove the render as pdf. the page shows the webpage. So, how to view teh website as pdf?
Hi Experts,
How to send the email alert by using the workflow when adding the solution into the case.

Thanks in Advance
<apex:page action="{!init}" controller="mainControllerV1" showHeader="false" standardStylesheets="true">


<apex:outputPanel id="the_outputpanel_00">
    <p>
    Consecutivo: {!current_factura.Consecutivo__c}
    </p>
    <p>
    Fecha: {!current}
    </p>
</apex:outputPanel>

<apex:outputPanel id="the_outputpanel_0">
Método de Pago
    <apex:form >
    <apex:pageMessages />
        <apex:pageBlock >
       
        <p>
        <apex:inputCheckbox value="{!current_factura.Efectivo__c}">
         <apex:actionSupport event="onchange" action="{!toogle_a}" rerender="the_outputpanel_0"/> 
        </apex:inputCheckbox> Efectivo <br/>
        <br/>
        <apex:inputText value="{!Efectivo}" rendered="{!(!current_factura.Efectivo__c == false)}"/>
        
        </p>
        <p>
        <apex:inputCheckbox value="{!current_factura.Tarjeta__c}">
        <apex:actionSupport event="onchange" action="{!toogle_b}" rerender="the_outputpanel_0"/> 
        </apex:inputCheckbox> Tarjeta
        </p>
       
        <br/>
        <apex:commandButton value="Pagar" >
                       <apex:actionSupport event="onclic"  action="{!Pagar}"/>
                        
                       </apex:commandButton>
                       <br/>  
                                         
        </apex:pageBlock>
    </apex:form>
</apex:outputPanel>

Busqueda de productos

<apex:outputPanel id="the_outputpanel">

    <apex:pageBlock >
                <apex:form >
                <div><h4>Búsqueda por código</h4>  <apex:inputText value="{!STR_SRCH}"  >
                       </apex:inputText>
                       <apex:commandButton value="BUSCAR!" >
                       <apex:actionSupport event="onclic" rerender="the_outputpanel2"/> 
                       </apex:commandButton>
                   </div>
                </apex:form>
    </apex:pageBlock>
</apex:outputPanel>

<apex:outputPanel id="the_outputpanel_dec">

    <apex:pageBlock >
                <apex:form >
                <div><h4>Descuento</h4>  <apex:inputText value="{!STR_DESC}"  > %
                       </apex:inputText>
                       <apex:commandButton value="ACTUALIZAR!" >
                       <apex:actionSupport event="onclic" rerender="the_outputpanel3"/> 
                       </apex:commandButton>
                   </div>
                </apex:form>
    </apex:pageBlock>
</apex:outputPanel>

<apex:outputPanel id="the_outputpanel2">
    <apex:pageBlock >
        <apex:pageBlockTable id="srch_id" value="{!ListaSRCH}" var="o">
                               
            <apex:column value="{!o.CantidadExistencia__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Codigo__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Descripcion__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Precio__c}"> <apex:facet name="header"></apex:facet> </apex:column>
            <apex:column headerValue="Opciones" >
                <apex:form >
                    <apex:commandLink value="AGREGAR" action="{!add2carrito}">
                            <apex:actionSupport event="onclic" rerender="the_outputpanel3"/>    
                            <apex:param name="idz"   assignTo="{!current_prod}" value="{!o.id}"  />                               
                    </apex:commandLink>
                </apex:form>   
            </apex:column>
           
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:outputPanel>


CARRITO

<apex:outputPanel id="the_outputpanel3">
    <apex:form >
        <apex:commandButton value="CLEAR" action="{!clear_carr}">
            <apex:actionSupport event="onclic" rerender="srch_id2"/> 
        </apex:commandButton>  
    </apex:form>
    <apex:pageBlock >
        <apex:pageBlockTable id="srch_id2" value="{!ListaCARR}" var="o" >
                               
            <apex:column value="{!o.CantidadExistencia__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Codigo__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Descripcion__c}"> <apex:facet name="header"> </apex:facet> </apex:column>
            <apex:column value="{!o.Precio__c}"> <apex:facet name="header"></apex:facet> </apex:column>
           
        </apex:pageBlockTable>
    </apex:pageBlock>
    <apex:pageBlock >
    <h1>
    <p>
    Subtotal: {!total_str}</p> colones
    </h1>
    <h1>
    <p>
    Descuento: {!total_dstr} colones
    </p>
    </h1>
    <h1>
    <p>
    Total: {!total_final} colones
    </p>
    </h1>
    </apex:pageBlock>
</apex:outputPanel>


</apex:page>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Controller method ;

public void Pagar(){
   
   
    if(current_factura.Efectivo__c=true && total_str > '0'){
      /*  
        calcular_total();
                     
        current_factura.Descuento__c == ;
        current_factura.Efectivo__c == ;
        current_factura.Estado__c == 'Pagado';
        current_factura.Fecha_y_Hora_de_Factura__c == system.now().addHours(-6);
        current_factura.Forma_de_Pago__c == ;
        current_factura.Porcentaje__c == ;
        current_factura.Subtotal__c == ;
        current_factura.Tarjeta__c == ;
        current_factura.Total__c == ;
        current_factura.Vuelto__c == ;
        
        insert(current_factura):
        */
       
    }
       
    else if (current_factura.Tarjeta__c=true && total_str > '0')
   
    {
   
    }
   
    else
   
    {
    ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Por favor seleccione un metodo de pago'));
   
    }

}

I know i have to add the functionallity, but im unable to understand how to set all the parameters coming from the visualforce page i am really new to sales force and web programming.

Thanks
I know you can set up validation rules to make the billing address required but is there any way to add the red line or some other indicator to show the billing address is required before the record can be save?
  • April 11, 2014
  • Like
  • 0
i have a commandlink in a pbtable, that should change color conditionally. I am doing something like below but it complains about "Error Error: Syntax error. Missing ')'". any ideas?

<apex:commandlink value="test" action="{!testaction}" style="{!IF(testMap.get(rowId).size > 0, 'background:red;color:white', '')}">
  • April 11, 2014
  • Like
  • 0
I recently wrote my first trigger and I'll just say now that I'm not a formally trained software developer.  By researching online I was abe to bulkify my code and it seems to be working great in Sandbox with either a singular update or with Data Loader, however I'm sure that I've done something wrong, so I wanted to throw my work to the sharks and see what I have done incorrectly before I start trying to learn how to write test classes and push to Production.  Thank you very much for your time.

trigger MyCaseCustomerStatusUpdate on Vertical__c (after insert, after update) {
 
// create a set of related account IDs
 
set <ID> accountIDs = new set <ID>();
 
//create set of all verticals
 
set <Vertical__c> verticals = new set <Vertical__c>();
 
//create list of accounts to update at end of code
 
list <Account> accountList = new list <Account>();
 
//create Account object for later reference
 
Account accountRecord;
 
// for every Vertical, add its related to account to the set and create set of Verticals for later reference


for(Vertical__c v: Trigger.new){
accountIDs.add(v.account__c); 
verticals.add(v);

}
 
// create a Map to match the Vertical related to Account IDs to their corresponding account
 
Map<ID, Account> accountMap = new Map<ID, Account> ([Select ID FROM Account WHERE ID in :accountIDs]);   

//loop through all accounts added to account map

for(Account a:accountMap.values()){

//add account to list to update

accountList.add(a);

//loop through verticals

for(Vertical__c v : verticals){
  
   //if the ID on the account and the account ID on the vertical match, update the status field.
  
   if (a.Id == v.account__c){
  
   // update Account object
  
   accountRecord = a;
   
   // update the status on the account object
   
     accountRecord.MyCase_Status__c = v.Status__c;
   }
  }
}
  
update accountList;
 
}

I work for a nonprofit, and I've been trying to adapt a web to lead form to use reCaptcha.  

I found a suggestion here: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008sR4IAI
In summary, you modify the salesforce web-to-lead form to submit to a verify.php file you create on your web server, and then that file uses "curl" ro resubmit the data to the original POST URL for the Salesforce web-to-lead

I've done my best to merge the reCaptcha directions (https://developers.google.com/recaptcha/docs/php) with the suggestions in the form (http://malebolgia.shadowsonawall.net/code-programming/captcha-with-salesforce.html) above, but when I go to submit my web to lead form, the verify.php file shows this error:
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in D:\Hosting\4899791\html\about\verify.php on line 31

Line 31 of verify.php sets the value of a variable (for a custom Salesforce Lead field) to the one passed from the form- syntax looks like all the other fields being passed.  I'll post the full code at the end of my post

Another thing I've noticed is that the verify.php file that has the error is posting the value of these fields into the URL, so that seems to be OK.  Here's the URL
http://carolinatigerrescue.org/about/verify.php?oid=00DA0000000A32t
&retURL=http%3A%2F%2Fcarolinatigerrescue.org%2Fabout%2Fsubscribe-thanks.asp
&AccountType=Individual
&company=Self
&first_name=Barack
&last_name=Obama
&street=
&city=Washington
&state=DC
&zip=10018
&country=United+States
&email=AmandaByrne%40CarolinaTigerRescue.org
&emailOptOut=0
&00NA000000A0fWR=Subscribed+by+Request
&00NA000000A0fWH=Subscribed+by+Request
&recaptcha_challenge_field=(removed for security)
&recaptcha_response_field=asnomic+Hig
&submit=Subscribe

Can someone help me figure out where my syntax has gone wrong?

Verify.PHP code
<?php
  require_once('../includes/recaptchalib.php');
  $privatekey = "(removed for security)";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {

    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
         "(reCAPTCHA said: " . $resp->error . ")");
  } else {
// CTR curl code to resubmit to Salesforce web to lead
//set POST variables
  $url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
  $fields = array(
     'oid'=>urlencode($oid),
     'recordType'=>urlencode($recordType),
     'retURL'=>urlencode($retURL),
     'first_name'=>urlencode($first_name),
     'last_name'=>urlencode($last_name),
     'company'=>urlencode($company),
     'street'=>urlencode($street),
     'city'=>urlencode($city),
     'state'=>urlencode($state),
     'zip'=>urlencode($zip),
     'country'=>urlencode($country),
     'email'=>urlencode($email),
     'emailOptOut'=>urlencode($emailOptOut),
     '00NA000000A0fWR'=>urlencode($00NA000000A0fWR),
     '00NA000000A0fWH'=>urlencode($00NA000000A0fWH),
    
   
    );

  //url-ify the data for the POST
  foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
  rtrim($fields_string,'&');

  //print_r($fields_string);

  //open connection
  $ch = curl_init();

  //set the url, number of POST vars, POST data
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_POST,count($fields));
  curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

  //execute post
  $result = curl_exec($ch);

  //close connection
  curl_close($ch);

  }
  ?>
Relocation assistance is available for this role.
The scope of the role "Salesforce.com Developer" is quite broad, and includes the responsibility of acting as the Tech Lead on one or more Scrum teams with a focus on Salesforce.com’s best practices as well as mentoring junior team members in Salesforce development activities.
Contact me at or cmiller@progressiveit for more information and to set up an interview time.


Hi All,
I'm trying to display JSON DATA in tree structure in my Visualforce Page.
CODE SNIPPET:
<apex:page showHeader="false" sidebar="false">

<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/libs/jquery.js')}"/>
<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/jstree.min.js')}"/>
<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/src/jstree.contextmenu.js')}"/>
<apex:stylesheet value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/themes/style.css')}"/>


<script>
var jsonDataHolder;
$(document).ready(function(){
jsonDataHolder =[
       { "id" : "ajson1", "parent" : "#", "text" : "Simple root node" },
       { "id" : "ajson2", "parent" : "#", "text" : "Root node 2", },
       { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" },
       { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" },
    ];

$('#jstree_demo').jstree({
  "core" : {  
    'data' : jsonDataHolder
  } ,
   "plugins" : [ "contextmenu" ]
});
});

</script>
<div id="jstree_demo"/>
</apex:page>

Problem: The child nodes are not getting displayed.

I have downloaded the Jquery files from  "http://www.jstree.com/ ".

Any pointers/Suggestion are most welcome.
Many thanks in advance  :)
Hi,

I'm looking to hire a full time Force.com developer who has strong hands on Java skills, and has exposure to integration of Salesforce.com with other big box applications like Oracle stack as well as other cloud offerings like Callidus, ExactTarget. This is a full time position based out of Bangalore, India in a renowned US based product company's center in India.

All,


So I am putting this in just in case it benefits someone else and to blow off some steam.  I have a crazy client who has been riding my butt  because they need to launch for dreamforce and in final testing someone found that it was possible to pick up two copies of the same campaign member in a very complex set of dynamic soql queries.  I fixed this by adding a Set<Id> that prevents the same Id from being entered more than once in the List<CampaignMember> that gets sent to the final update.  Only I screwed up the patch, because I accidentally ran the data into the Set twice.  But I didn't notice because I only tested with leads, and they worked just fine.  When someone else tested in something other than the dev org, they found it was borked.  I tested again with contacts and found it was broken.  I added extra debugging that showed both leads and contacts resulted in 0 CampaignMembers added to the List<> that gets updated, yet leads were updating and contacts were not.  Doesn't inspire a lot of confidence in either my abillity or the way updates work.

  • November 14, 2013
  • Like
  • 0

Hello,

 

I'm trying to get the number of solutions attached to case (the goal is to be able to use a email template displaying the last added solution only with something like :

<apex:repeat first="{!relatedTo.nb_solutions__c-1}" value="{!relatedTo.CaseSolutions}" var="line">
<apex:outputText value="{!line.Solution.SolutionNote}" escape="false" />
</apex:repeat>).

 

Here is my code:

 

trigger CountSolution on Case (after update) {
		case.nb_solutions__c = [select casesolution.SolutionId from casesolution where caseID = :case.Id];
		update case.nb_solutions__c;
}

 

But I'm getting this error:

Save error: Invalid bind expression type of Schema.SObjectField for column of type Id CountSolution.trigger /Test Trigger/src/triggers line 2 Force.com save problem

 

I'm a "newbie", so any help or direction is appreciated. :smileyembarrassed:

  • January 23, 2012
  • Like
  • 0

Hi,

 

    My scenario is like this,

 

 When an opportunity is marked as ‘closed – won’ salesforce will send an email to the installation

 

  co-ordinator(user) with a link to the quote.  This will allow them to see quote pictures, videos, instructions, etc for the job.

                     

                                                   https://na12.salesforce.com/{!relatedTo.ID}

 

I have used the above link, but that linke merge field {!relatedTo.ID} is not being reflected in the inbox mail.

 please confirm me whether the is corrcet or not.  I have also synchronized the the quote of oppurtunity. Still it is not working.

     


 

 Thanks in advance.

 

--Regards,

  forceapp.

 

                  

Hello All,

I 'd an issue regarding sending emails using singleemailmessage class. Heard that we can send 10 * 1000 = 10000 emails per execution (10 arrays, each array to accomodate 1000 emails). Is this true?

But i am unable to send more than 10 emails. Could anyone plz clarify me how to do. PFB my code snippet:

 

            }

for(Permit__c p:permitList){
                 Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
                                    String subject = p.Name+' | '+p.Region__c+' | '+p.Full_State__c+' | '+p.Channel__c+' | Status=Expired';
                                    email.setSubject(subject);
                                    String emailadd = 'abc@xyz.com';
                                    String[] toAddresses = emailadd.split(',');
                                    email.setToAddresses(toAddresses);
                                    email.setHTMLBody( 'email body.' );
                 Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); 

 

 

An error is being thrown when 10 mails are sent and is about to send 11th email.

Plz help!

Hello All,

 

I need help to update a Custom field whenever I insert a Solution into Case. I did a lot of R&D and found that the CaseSolution object has association between Case and Solution and also it not possible write an Apex triggers on CaseSolution object, is there any other workaround to achieve this?

 

I am stuck in this issue and unable to get the solution from last 4 days. Any help regarding this will be greatly appreciated.

 

Please anyone help me regarding this.

Thank you!

 

Regards,

Lakshman

Relocation assistance is available for this role.
The scope of the role "Salesforce.com Developer" is quite broad, and includes the responsibility of acting as the Tech Lead on one or more Scrum teams with a focus on Salesforce.com’s best practices as well as mentoring junior team members in Salesforce development activities.
Contact me at or cmiller@progressiveit for more information and to set up an interview time.