• Noor Fazli
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Software Engineer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 7
    Replies
Hello System Integrators,

We are trying to achieve 2 way SSL Callout to third Party WebService. But getting the error "could not find client dev certificate :''certificate_Name" on Post.
What I have done so far;
1) Added third party site to remote site settings.
2) Uploaded third party Certificate (.cert) through mutual authentication certificate.
3) created global class with @future (callout=true) that set client Certificate Name defined in 2)

Not sure whats the issue here as I can see the Certificate under the list of certificate.


 
Hello Experts,

I'm rigorously trying to achieve some basic functinality which is when the value in a field is added,that why it needs to be sent via trigger  that we want to send the email with attachment of visualforce page pertaining to a particular id. Using getcontent is not a good idea so I opted for creating a site that send the attachment for the trigger, but to my surprise i'm getting no data and only static values are getting displayed in the attachment.

Any help would be appreciated.
I have followed Jitendra's following link to attach visual force page as attachment to the sent email via trigger. But there is one exception my visual force page is linked to standard controller and needs id as parameter to display data.
So far I'm able to get the email with blank attachment.
 
PageReference ref = Page.Detail;
ref.getParameters().put('id',id);

http://www.jitendrazaa.com/blog/salesforce/apex/send-email-with-generated-pdf-as-attachment-from-trigger/

Is there anything else that needs to be done to pull the data into attachment?
 
We are trying to retrieve value from grand parent's name field and parent field using dot notation. We can successfully retrieve fields from both parent and grandchild but need some fields from grand parent also.
 
Select  PA__r.Customer_Name__r.Name,PA__r.Name,PA__r.Id,PA__r.GCompany__c,PA__r.Customer_Name__c,PA__r.JobNo__c,
 PA__r.Project_Manager__c,Name,Billing_Amount_Per_Period__c,Total_Value__c from bills__c
We are unable to get results from hihlighted field, grand parent field. Any pointers will be highly appreciated.
 
We are using actionsupport to  make database changes and we want to display those changes on the rerendering of the form.
Rerendering is working in the sense that its doing the page refresh but it does not reflect the database changes. When we do manual refresh than we are able to see the changes. What should be done.(actually I have tried using outputPanels also, but it looks like database update and page refresh are disconnected events). How to display new values on page refresh?

-- Here is the Visual force code
 
<apex:form id="mainFormId">
 <apex:pageBlock id="NR" >
 <apex:pageBlockButtons location="Top">
 <apex:commandButton value="Notification to Invoice" action="{!processSelected}" immediate="false">
 <apex:actionSupport event="onclick" reRender="mainFormId"/>
 </apex:commandButton>
 </apex:pageBlockButtons>
 <apex:pageBlockSection title="Non Recurring Billings" id="NRbill"/> 
<apex:commandButton action="{!NewBillNR}" value="New Non Recurring Billings" immediate="false">
 <apex:param name="type" value="Non Recurring"/>
 </apex:commandButton>
 <apex:pageBlockTable value="{!wrapRecords_NR}" var="Rec">
 <apex:column > <apex:facet name="Action">Action</apex:facet> 
<apex:inputCheckbox value="{!Rec.selected}" id="inputId"/> 
<apex:outputText value="{!Rec.bill.billingLink__c}" escape="false" styleClass="actionLink"/>&nbsp;|&nbsp; <apex:commandLink onclick="return DeleteBill('{!Rec.bill.Id}');" value="Del" id="theCommandLink"/> </apex:column>
 <apex:column > <apex:facet name="header">Description</apex:facet> <apex:outputText value="{!Rec.bill.Name}"></apex:outputText> </apex:column>
 <apex:outputLabel value="{!Rec.bill.Name}" id="RecId" /> <apex:outputLink value="{!Rec.bill.billingLink__c}" >Your Hyperlink Text</apex:outputLink>
 <apex:column > <apex:facet name="header">Billing Amount per Period(USD)</apex:facet> <apex:outputText value="{!Rec.bill.Billing_Amount_Per_Period__c}"/> </apex:column>
 <apex:column headerValue="NTI"> <apex:outputField value="{!Rec.bill.Notification_to_Invoice__c}"/> </apex:column> 
</apex:pageBlockTable> </apex:pageBlock> </apex:form>

 Here is the excerpt from Controller code:

 public PageReference processSelected(){ //We create a new list of Contacts that we be populated only with Contacts if they are selected
 selectedbill = new List<Billing__c>(); 
selListId = new List<String>(); //We will cycle through our list of Non Recurring and and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list 
for(wrapBilling cbill : wrapRecords_NR){
 if(cbill.selected == true)
 { selectedbill.add(cbill.bill);
 selListId.add(cbill.bill.Id); }
 } 
for(wrapBilling cbill: wrapRecords_RecVar){
 if(cbill.selected == true) {
 selectedbill.add(cbill.bill); 
selListId.add(cbill.bill.Id); } 
} // Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc
if(selectedbill != null){ System.debug('These are the selected billing records...'); 
for(Billing__c bill: selectedbill) { system.debug(bill); 
system.debug('selListId: '+selListId); } 
if(sendMail()){ for(billing__c bill2Upd : [Select Id,Notification_to_Invoice__c from billing__c where Id in : selListId]){ 
bill2Upd.notification_to_Invoice__c = true ; system.debug('bill2Upd: ' + bill2Upd); update bill2Upd; } 
} 
} // wrapRecords_NR = null; // we need this line if we performed a write operation because getContacts gets a fresh list now 
selectedbill.clear(); 
return null;
 }

 
Hi,

We need to send email to all the members of a public group.  How to query emails of all the users in a public group in Apex controller. so far I have done this. Not sure how the object user can be used to get the "email of all users" in a public group.

group g = [SELECT id FROM group WHERE name = 'IT Testers'];
System.debug('g:' + g);

for (GroupMember gm : [Select UserOrGroupId from GroupMember where GroupId =: g.id]){ 
 System.debug('gm.UserOrGroupId:' + gm.UserOrGroupId); }



}
 
Hi,

Is there any example code that could be used to send Emails to a selected Profile(all the members in Profile) members with the email template(containing merged Fields) using apex Code in controller. I can find examples using hardcoded emails in code but couldn't find something relevant to my needs. Any pointer will be highly appreciated. Preferably in Java.

Thanks
I'm trying to send a parameter from Visual force page to controller to delete the row of record on pagetable via javascript using actionFunction. I'm able to get the alert messages from javascript function but not getting any error message or any required behaviour from controller. Seems like,its not getting called at all.

Any help will be highly appreciated.

Here is the visual force code:
 
<apex:form>
 <apex:actionRegion id="AR">
  <apex:pageBlockTable value="{!NonRec}" var="Rec">
    <!--
    <apex:column headerValue="Action">
    <apex:facet name="Action">Action
    <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>

    </apex:facet>
   <apex:inputCheckbox value="{!Rec.Notification_to_Invoice__c}" id="inputId"/>
   
  <apex:column headerValue="Action" >
  <apex:facet name="Action">Action</apex:facet>
  <apex:inputCheckbox value="{!Rec.Notification_to_Invoice__c}" id="inputId"/>
    <apex:outputText value="{!Rec.billingLink__c}" escape="false" styleClass="actionLink"/>&nbsp;|&nbsp;  
  
  <apex:commandLink onclick="DeleteBill('{!Rec.Name}');" value="Del" id="theCommandLink"/>   </apex:column>
   <apex:column >
     <apex:facet name="header">Description</apex:facet>
     <apex:outputText value="{!Rec.Name}"></apex:outputText>
     </apex:column>
     <apex:outputLabel value="{!Rec.Name}" id="RecId" />
  <apex:outputLink value="{!Rec.billingLink__c}" >Your Hyperlink Text</apex:outputLink>

  
    <apex:column >
     <apex:facet name="header">Billing Amount per Period(USD)</apex:facet>
     <apex:outputText value="{!Rec.Billing_Amount_Per_Period__c}"/>
     </apex:column>
   <apex:column headerValue="NTI">
     <apex:inputCheckbox value="{!Rec.Notification_to_Invoice__c}"/>
   </apex:column>
       </apex:pageBlockTable>
     
 <apex:pageBlockSection title="Recurring Billings - Variable"/>
  <apex:commandButton action="{!NewBillRecV}" style="btn" value="New Recurring-Variable Billings" immediate="false"/>
     <apex:pageBlockTable value="{!Records_Recurring_Var}" var="Record_Rec_var">
   <apex:column headerValue="Action">
    <apex:facet name="Action">Action
    <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>

    </apex:facet>
   <apex:inputCheckbox value="{!Record_Rec_var.Notification_to_Invoice__c}" id="inputId"/>
 
  <!-- Need to create a   wrapper  for selected flag    <apex:inputCheckbox value="{!Rec.selected}" id="inputId"/>     -->
     <apex:commandLink value="Del" action="{!DeleteBill}" styleClass="actionLink"/> <!-- action="{!saveAndReturn}"/> -->
    
 
   </apex:column>

     <apex:column >
    <apex:facet name="header">Description</apex:facet>
    <apex:outputText value="{!Record_Rec_var.Name}"></apex:outputText>
    </apex:column>
    <apex:outputLabel value="{!Record_Rec_var.Name}" />
  <apex:outputLink value="{!Record_Rec_var.billingLink__c}" >Your Hyperlink Text</apex:outputLink>

  
    <apex:column >
     <apex:facet name="header">Billing Amount(USD)</apex:facet>
     <apex:outputText value="{!Record_Rec_var.Billing_Amount_Per_Period__c}"/>
     </apex:column>
       <apex:column headerValue="Pop Start">
     <apex:outputText value="{!Record_Rec_var.Pop_Start__c}"/>
    </apex:column>
        <apex:column headerValue="Pop Stop">
     <apex:outputText value="{!Record_Rec_var.Pop_Stop__c}"/>
    </apex:column>
    <apex:column headerValue="NTI">
     <apex:selectCheckboxes value="{!Record_Rec_var.Notification_to_Invoice__c}"/>
    </apex:column>
     <apex:column headerValue="Date Submitted">
     <apex:outputText value="{!Record_Rec_var.Notification_to_Invoice_date__c}"/>
    </apex:column>
     <apex:column headerValue="Submitted By">
     <apex:outputText value="{!Record_Rec_var.NotificationtoInvoiceUser__c}"/>
    </apex:column>
    </apex:pageBlockTable>

  </apex:pageBlock>
  </apex:actionRegion>
  <apex:actionFunction action="{!DeleteBill1}" name="Deletefunc" reRender="AR" >
  <apex:param name="billid" value="" assignTo="{!SelectedBillId}"/></apex:actionFunction>
  </apex:form>
 
  <script>
  function DeleteBill(id1){
  alert(id1);
    var x = confirm('Do you want to delete?');
    if (x){
     alert("Del");
    Deletefunc(id1); // seems like not getting called
    alert("return");
    }
 }

  </script>






Here is controller code
 
public PageReference DeleteBill1()
  {

   //   string passedparam = ApexPages.currentPage().getparameters().get('billid');
   SelectedBillId = Apexpages.currentPage().getParameters().get('billid');
   ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,SelectedBillId));

    if(SelectedBillId == null){
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'NULL'));

     }
   Billing__c billTobeDeleted= null; //ApexPages.currentPage().getParameters().get('billid');
   for(Billing__c b:NonRec){
    //   Billing__c b = [Select id from billing__c where id =:billid limit 1];
     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'selected Id' + SelectedBillId));

   if(b.Id==SelectedBillId){
     billTobeDeleted = b;
   }
   if(billTobeDeleted !=null){
    Delete billTobeDeleted;
    DisplayNonRecurring();

   }
   }
  return null;
  }

 
Hi,
I have a custom object(PA_Process__c) that has two related list(Revenue__c and Billing__c) defined in Master-child relationship.
I have added a custom button that executes javascript on click on Revenue related list. The purpose of this button is to move the selected record on Revenue related list to Billing related list in other words, user doesn't need to enter this info. if it already exists in Revenue. My code is able to create record in Billing__c but for some reason the values from !Revenue__c are empty. Below is my code, it looks like I'm missing something to get the datavalues from the source list(Revenue__c). Please help.
 
!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
var records={!GETRECORDIDS($ObjectType.Revenue__c)}; 
if(records[0] == null){alert("Please select atleast one row")}
else{
for (var n=0; n<records.length; n++){
try{
    var bill = new sforce.SObject("Billing__c");
    var Name = records.Name; // is empty
    bill.Name = Name; // '{!Revenue__c.Name}';
   // bill.PA__c = '{!PA_Process__c.Id}'; /
   bill.PA__c = records[n].PA__c;

  alert(records[0].Name);
  result = sforce.connection.create([bill]);

    if(result[0].success === "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " +
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An unexpected Error has Occurred. Error: " +
        e
    );
}
}
}


 
Hi,
I have a custom object(PA_Process__c) that has two related list(Revenue__c and Billing__c) defined in Master-child relationship.
I have added a custom button that executes javascript on click on Revenue related list. The purpose of this button is to move the selected record on Revenue related list to Billing related list in other words, user doesn't need to enter this info. if it already exists in Revenue. My code is able to create record in Billing__c but for some reason the values from !Revenue__c are empty. Below is my code, it looks like I'm missing something to get the datavalues from the source list(Revenue__c). Please help.
 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}

try{
    var bill = new sforce.SObject("Billing__c");
    var Name = '{!Revenue__c.Name}';
    bill.Name = '{!Revenue__c.Name}';
    bill.PA__c = '{!PA_Process__c.Id}';
if({})
alert("Name:" + Name);

  
  result = sforce.connection.create([bill]);

    if(result[0].success === "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " +
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An unexpected Error has Occurred. Error: " +
        e
    );
}




 
Hi,
Whats the right way of enforcing the datatype for a inputfield in Visualforce page?
I have a field defined as number but still can take characters.
We have another requirement where we want another input field defined as percent to accept percent only.
Please advise.
Hello,
How to control the sizing of both elements of a multiselect picklist defined in apex:inputField.We  have big description texts as option values we have tried using style="width:100px", which got applied to both "Available and "Chosen" element. However it resulted in a huge gap between Available and Chosen. Also after picking up value from Available and moving it to Chosen resulted in the size being reverted to original width(in this case style did not get applied by the system).
Need a way to  display multiselect picklist values in a elegant way inside a <apex:pageBlocksection> element.
Thanks in advance.
 
We are trying to retrieve value from grand parent's name field and parent field using dot notation. We can successfully retrieve fields from both parent and grandchild but need some fields from grand parent also.
 
Select  PA__r.Customer_Name__r.Name,PA__r.Name,PA__r.Id,PA__r.GCompany__c,PA__r.Customer_Name__c,PA__r.JobNo__c,
 PA__r.Project_Manager__c,Name,Billing_Amount_Per_Period__c,Total_Value__c from bills__c
We are unable to get results from hihlighted field, grand parent field. Any pointers will be highly appreciated.
 
We are using actionsupport to  make database changes and we want to display those changes on the rerendering of the form.
Rerendering is working in the sense that its doing the page refresh but it does not reflect the database changes. When we do manual refresh than we are able to see the changes. What should be done.(actually I have tried using outputPanels also, but it looks like database update and page refresh are disconnected events). How to display new values on page refresh?

-- Here is the Visual force code
 
<apex:form id="mainFormId">
 <apex:pageBlock id="NR" >
 <apex:pageBlockButtons location="Top">
 <apex:commandButton value="Notification to Invoice" action="{!processSelected}" immediate="false">
 <apex:actionSupport event="onclick" reRender="mainFormId"/>
 </apex:commandButton>
 </apex:pageBlockButtons>
 <apex:pageBlockSection title="Non Recurring Billings" id="NRbill"/> 
<apex:commandButton action="{!NewBillNR}" value="New Non Recurring Billings" immediate="false">
 <apex:param name="type" value="Non Recurring"/>
 </apex:commandButton>
 <apex:pageBlockTable value="{!wrapRecords_NR}" var="Rec">
 <apex:column > <apex:facet name="Action">Action</apex:facet> 
<apex:inputCheckbox value="{!Rec.selected}" id="inputId"/> 
<apex:outputText value="{!Rec.bill.billingLink__c}" escape="false" styleClass="actionLink"/>&nbsp;|&nbsp; <apex:commandLink onclick="return DeleteBill('{!Rec.bill.Id}');" value="Del" id="theCommandLink"/> </apex:column>
 <apex:column > <apex:facet name="header">Description</apex:facet> <apex:outputText value="{!Rec.bill.Name}"></apex:outputText> </apex:column>
 <apex:outputLabel value="{!Rec.bill.Name}" id="RecId" /> <apex:outputLink value="{!Rec.bill.billingLink__c}" >Your Hyperlink Text</apex:outputLink>
 <apex:column > <apex:facet name="header">Billing Amount per Period(USD)</apex:facet> <apex:outputText value="{!Rec.bill.Billing_Amount_Per_Period__c}"/> </apex:column>
 <apex:column headerValue="NTI"> <apex:outputField value="{!Rec.bill.Notification_to_Invoice__c}"/> </apex:column> 
</apex:pageBlockTable> </apex:pageBlock> </apex:form>

 Here is the excerpt from Controller code:

 public PageReference processSelected(){ //We create a new list of Contacts that we be populated only with Contacts if they are selected
 selectedbill = new List<Billing__c>(); 
selListId = new List<String>(); //We will cycle through our list of Non Recurring and and will check to see if the selected property is set to true, if it is we add the Contact to the selectedContacts list 
for(wrapBilling cbill : wrapRecords_NR){
 if(cbill.selected == true)
 { selectedbill.add(cbill.bill);
 selListId.add(cbill.bill.Id); }
 } 
for(wrapBilling cbill: wrapRecords_RecVar){
 if(cbill.selected == true) {
 selectedbill.add(cbill.bill); 
selListId.add(cbill.bill.Id); } 
} // Now we have our list of selected contacts and can perform any type of logic we want, sending emails, updating a field on the Contact, etc
if(selectedbill != null){ System.debug('These are the selected billing records...'); 
for(Billing__c bill: selectedbill) { system.debug(bill); 
system.debug('selListId: '+selListId); } 
if(sendMail()){ for(billing__c bill2Upd : [Select Id,Notification_to_Invoice__c from billing__c where Id in : selListId]){ 
bill2Upd.notification_to_Invoice__c = true ; system.debug('bill2Upd: ' + bill2Upd); update bill2Upd; } 
} 
} // wrapRecords_NR = null; // we need this line if we performed a write operation because getContacts gets a fresh list now 
selectedbill.clear(); 
return null;
 }

 
Hi,

We need to send email to all the members of a public group.  How to query emails of all the users in a public group in Apex controller. so far I have done this. Not sure how the object user can be used to get the "email of all users" in a public group.

group g = [SELECT id FROM group WHERE name = 'IT Testers'];
System.debug('g:' + g);

for (GroupMember gm : [Select UserOrGroupId from GroupMember where GroupId =: g.id]){ 
 System.debug('gm.UserOrGroupId:' + gm.UserOrGroupId); }



}
 
Hi,

Is there any example code that could be used to send Emails to a selected Profile(all the members in Profile) members with the email template(containing merged Fields) using apex Code in controller. I can find examples using hardcoded emails in code but couldn't find something relevant to my needs. Any pointer will be highly appreciated. Preferably in Java.

Thanks
Couldn’t create new Force.com project in Eclipse.Eclipse version is 3.3 .Does any one know the steps to create a force.com project in eclipse?
Hi,
I have a custom object(PA_Process__c) that has two related list(Revenue__c and Billing__c) defined in Master-child relationship.
I have added a custom button that executes javascript on click on Revenue related list. The purpose of this button is to move the selected record on Revenue related list to Billing related list in other words, user doesn't need to enter this info. if it already exists in Revenue. My code is able to create record in Billing__c but for some reason the values from !Revenue__c are empty. Below is my code, it looks like I'm missing something to get the datavalues from the source list(Revenue__c). Please help.
 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}

try{
    var bill = new sforce.SObject("Billing__c");
    var Name = '{!Revenue__c.Name}';
    bill.Name = '{!Revenue__c.Name}';
    bill.PA__c = '{!PA_Process__c.Id}';
if({})
alert("Name:" + Name);

  
  result = sforce.connection.create([bill]);

    if(result[0].success === "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " +
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An unexpected Error has Occurred. Error: " +
        e
    );
}