• sagar jogi
  • NEWBIE
  • 35 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 15
    Replies
Ajax call is not stopping by itself . The counter still keeps on incrementing. Can someone please let me know what am I doing wrong here?

VF page code:
<apex:page controller="polarExampleClass">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionPoller action="{!incrementCounter}" reRender="counter" interval="5" timeout="10000"/>
    </apex:form>
</apex:page>

Apex class code:
public class polarExampleClass {
Integer count = 0;
            
    public PageReference incrementCounter() {
        count++;
        return null;
    }
            
    public Integer getCount() {
        return count;
    }
}
Hi amazing admins,
We have recently fixed some apex code within our system that puts people in regions and areas as instructed to do so via a separate API.
I tried to do a dataloader, uploading the same postal addresses to the contact record, which I thought would trigger the apex code to run on individual records. Will it run if I change one small thing about the address? Or will I have to write some new code?
Many thanks, Will, London - UK
I have the following trigger that is obviously working (I checked the log), But no email is being sent out.
I check that the deliveribility is set to 'all emails' 
Please advice

This is the code

trigger NewFileAlert on ContentDocument (after insert) 
{

  List<Messaging.SingleEmailMessage> mails = 
  new List<Messaging.SingleEmailMessage>();
  
  for (ContentDocument newDoc : Trigger.new) 
  {
      
      Messaging.SingleEmailMessage mail = 
      new Messaging.SingleEmailMessage();
    
      
      List<String> sendTo = new List<String>();
      sendTo.add(allthepeople@everybody.com);
       ...
      mail.setToAddresses(sendTo);
    
      mail.setReplyTo('me@gmail.com');
      mail.setSenderDisplayName('Aidel Bruck');
   
      mail.setSubject('New Document Added');
      String body = 'Please note: A new document has been added/n  ';
      body += 'File name: '+ newdoc.title+'/n' ;
      body += 'Created By: '+ newdoc.createdbyid+ '/n';
      body += 'Created Date: '+ newdoc.CreatedDate+ '/n';
      body += 'link to file: '+ System.URL.getSalesforceBaseUrl().getHost()+newdoc.id;
      mail.setHtmlBody(body);

      mails.add(mail);
    }
  Messaging.sendEmail(mails);
}
Hi Community,
i am new to the community cloud and also i need to learn about community cloud.can any one suggest urls,pdf and also any kind of materials,links where i can get detailed information of community cloud.How to we work with community cloud and how to assign users to this cloud.
regards,
GS
  • November 13, 2018
  • Like
  • 0
Hi everybody,

Since the Winter'19, there are some things I really don't understand with "Flows" and Test corevage.

From Salesforce's doc here : https://sforce.co/2PqALZw

"For example, if you have 10 active autolaunched flows and processes, and 8 of them have test coverage, your org’s flow test coverage is 80%."

How can we test "Flows", or the real question is : How Salesforce test flow ?. How can I visualize if my flow is coreved.

This query below is used to know which of my flows are not covered.
SELECT Definition.DeveloperName
FROM Flow
WHERE Status = 'Active' 
   AND (ProcessType = 'AutolaunchedFlow' 
      OR ProcessType = 'Workflow' 
      OR ProcessType = 'CustomEvent' 
      OR ProcessType = 'InvocableProcess') 
   AND Id NOT IN (SELECT FlowVersionId FROM FlowTestCoverage)

When executing this query, Salesforce tells me that I have some flow not covered, but how can I cover them?
How Salesforce decide if my flow is covered or not ?

Thanks for your help :)
Ajax call is not stopping by itself . The counter still keeps on incrementing. Can someone please let me know what am I doing wrong here?

VF page code:
<apex:page controller="polarExampleClass">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionPoller action="{!incrementCounter}" reRender="counter" interval="5" timeout="10000"/>
    </apex:form>
</apex:page>

Apex class code:
public class polarExampleClass {
Integer count = 0;
            
    public PageReference incrementCounter() {
        count++;
        return null;
    }
            
    public Integer getCount() {
        return count;
    }
}
Hi All,

Can we write SOQL inside button scripting to fetch child records. I tried something like below.
var reocrds = sforce.connection.query(here parent to child query) but it doesn't seem to be working.
Please help me know how can i do this.
 Thanks.
 
  • October 16, 2018
  • Like
  • 0

Hi, I have a query regarding the Date field functionality. I have created a few custom fields as "Date" and also using the standard Apttus Fields for instance "Agreement Start Date" in my visualforce pages. However, when clicked on to the date field it does not show up the calendar. The calendar shows up in the PageLayouts correctly.

Can you suggest a workaround to fix this issue.

Thanks,
Neha

Hello,


As my requirement i have a create a vf page,now instead of using command button i am trying to use search icon,as i achieved ,but how to make it as functional as same like command button.

 <!-- <apex:inputText value="{!}"   /> -->
                <input type="{!selected}"  id="text" placeholder="Search.." class="style1"/>
                <!-- <apex:commandButton value="Search Name" action="{!myRecords}" /> -->
                <apex:image url="{!$Resource.searchIcon}" width="20" height="15" />
 
Requirement: For a day only 5 passport bookings should be created by the users for a particular Passport Slot. On the same day when the 6th user is trying to create another passport booking for the same passport slot as that of 5 users, error message should be thrown. But on the next day the user should be able to create a new passport booking for that same passport slot if available.
trigger Booking_5Appointments_perDay on Passport_Booking_Appointment__c (before insert) {
     if (Trigger.isBefore && Trigger.isInsert) {
         List<Id> passportSlotAvailabilities_ids = new List<Id>();
         for(Passport_Booking_Appointment__c j:Trigger.new)
         {
             passportSlotAvailabilities_ids.add(j.Passport_Slot_Availability__c);
         }
         
         List<Passport_Booking_Appointment__c> other_bookings = [SELECT Id, CreatedDate, CreatedById,Passport_Slot_Availability__c FROM Passport_Booking_Appointment__c WHERE Passport_Slot_Availability__c IN : passportSlotAvailabilities_ids];
         for (Passport_Booking_Appointment__c j : Trigger.new) {
            for (Passport_Booking_Appointment__c existent_record : other_bookings) {
                if (j.Passport_Slot_Availability__c == existent_record.Passport_Slot_Availability__c && j.CreatedById == UserInfo.getUserId()) {
                    Date existent_record_created_date = existent_record.CreatedDate.date();

                    if (existent_record_created_date == Date.today()) {
                        j.addError('Cannot create Booking Appointment because limit has exceeded for today.');
                    }
                }
            }
        }
    }

}