• Raj Vakati
  • ALL STAR
  • 17231 Points
  • Member since 2016

  • Chatter
    Feed
  • 566
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 5197
    Replies
select id,name,email from Account where createddate=today
select accountid,Account.name from Contact where account.closeddate=today and createdate=today
Hi everyone,

Hoping someone can have a look and help me identify my problem. I've been working on the code in a fragmented, few-minutes-at-a-time way and I'm kind of stuck.

Here's the class:
global class AddressableSpend  {

public static Decimal CalculateAddressableSpend(Integer employees, Integer accountSIC, Decimal revenue){
	//Create a variable to store the results of our query, Query the Addressable Spend metadata table to get the appropriate records.
	Decimal multiplierResults = new Decimal
	multiplierResults = [SELECT Addressable_Spend_Multiplier__c FROM MultiplierMetadata__mdt  WHERE (employees>=Employee_Lower_Bound__c && employees <= Employee_Upper_Bound__c && accountSIC == SIC__c) LIMIT 1]
	//Use the Addressable Spend Multiplier from the retrieved record to multiply the revenue
	Decimal finalSpendAmount = multiplierResults * revenue;
	return finalSpendAmount;
	}
}

I'm trying to call this class from a trigger, which will pass in the three variables employees, accountSIC, and revenue. The class is supposed to return the multiplied revenue value (here labeled as finalSpendAmount) to the trigger to update the Account.

I'm getting four errors on the above code. Two are "expecting ; but was )" and "expecting ; but was ]" so I'm putting them aside for the moment. The ones I'm more concerned about are "Unexpected token 'multiplierResults'" and "Unexpected token 'Employee_Lower_Bound__c'" I've declared the multiplierResults variable, and I've encapsulated the query in [], so I'm not sure why those two are throwing errors.

If anyone can point me to the probably-quite-simple fix I'd appreciate it. Thanks for the help!
Hi Everyone,

I am using bekow class to calculate business days.but when I am calling the method from anonymous window getting below error.Please let me know what mistake i m making.Thanks in advance.I am new to sfdc.

Calling from anonymous -- B2C_BusinessDays_Calculator.IsWeekendDay(11-16-2018);

Error
Line: 1, Column: 29
Method does not exist or incorrect signature: void IsWeekendDay(Integer) from the type B2C_BusinessDays_Calculator



public class B2C_BusinessDays_Calculator {

    List<Case> cases = [select Id,B2C_Pending_SME_Dt__c from Case where status in ('Pending SME','Pending Customer')];
    Id caseId = cases[0].Id;
    Date SMEDate = cases[0].B2C_Pending_SME_Dt__c;
    
    public static Boolean IsWeekendDay(Date SMEDate)
   {
      boolean result     = false;
      system.debug('SMEDate = '+SMEDate); 
      //Recover the day of the week
      Date startOfWeek   = SMEDate.toStartOfWeek();
      system.debug('startOfWeek = '+startOfWeek);
      Integer dayOfWeek  = SMEDate.day() - startOfWeek.day();
      system.debug('dayOfWeek = '+dayOfWeek);   
      result = dayOfWeek == 0 || dayOfWeek == 6 ? true : false;
      system.debug('result = '+result); 
      return result;
   } 
   
   
   public static Date AddBusinessDays(Date SMEDate, integer BusinessDaysToAdd )
   {
      //Add or decrease in BusinessDaysToAdd days 
      Date finalDate = SMEDate;
      system.debug('finaldate = '+finalDate);
      integer direction = BusinessDaysToAdd < 0 ? -1 : 1;
      system.debug('direction = '+direction);
       while(BusinessDaysToAdd != 0)
       {
           finalDate = finalDate.AddDays(direction);
           system.debug('BusinessDaysToAdd = '+BusinessDaysToAdd);            
           system.debug('finaldate = '+finalDate);
           if (!isWeekendDay(finalDate))
           {
               BusinessDaysToAdd -= direction;
               
           }
       }

       return finalDate;
   }
}

 
I need to prevent an Apex Trigger from firing during the cloning of a record.  Can I use the value of a checkbox to prevent the trigger from firing?
I'm trying to write a method that will take a date and give the fiscal year it's in. Here's my code, which compiles:
public class dateTest {

    public static string giveFY(date givenDate) {
    system.debug('givendate is ' + givenDate);    
    integer currentFiscalOrSchoolYear ;
        if (givenDate.Month() >= 7){
            currentFiscalOrSchoolYear = givenDate.Year() + 1;
        }
        else {
            currentFiscalOrSchoolYear = givenDate.Year();
        }
        system.debug('the month of givenDate is: ' + currentFiscalOrSchoolYear);
        //Get the last two digits
        string fy = (string.valueof(currentFiscalOrSchoolYear).right(2));
        system.debug('fy to be returned: ' + fy);
        return fy;
    }
	
}

But when I try to use this Execute Anonymous, I get an error "   Line: 2, Column: 16 Unexpected token '('.   "
system.debug('putting 2018-04-11 into dateTest');
dateTest.giveFY(2018-04-11);
system.debug('FY is: ' + fy);

system.debug('putting 2019-04-11 into dateTest');
dateTest.giveFY(2019-04-11);
system.debug('FY is: ' + fy);

 
Hello,

How can we deploy a dashboard and reports concerned together from one sandbox to another ?

 
Hi,

Please help me to write test class for trigger and Apex class.
trigger EmailNotify on Static_Code_Analysis_Result__c (after update) {
    MailSend.sendTemp();

}
 
public without sharing class MailSend {
        public static boolean nullcheck = true;

        public static void sendTemp()
    {
        Map<String, EmailUsers__c> vMapNameCustomSett = EmailUsers__c.getAll();
        

	List<String> theSearchResults=new List<String>();

	List<EmailUsers__c> allSearchResults=vMapNameCustomSett.values();

	for(EmailUsers__c li:allSearchResults)
	{
    		theSearchResults.add(li.U1__c);
	}	
		
	if (!Schema.sObjectType.Static_Code_Analysis_Result__c.fields.Name.isUpdateable()) {
            Integer i=0;
        }
        
        List<Static_Code_Analysis_Result__c> i = [select id,Name,Story__c from Static_Code_Analysis_Result__c order by CreatedDate DESC limit 1];

        id i1=i[0].id;
		
	if (!Schema.sObjectType.Story__c.fields.Name.isUpdateable()) {
            Integer i112=0;
        }		
		
		
		
        List<Story__c> stname = [select name from Story__c where id = :i[0].Story__c];
        string n = i[0].name;
        system.debug(n);
		
	if (!Schema.sObjectType.Static_Code_Analysis_Violation__c.fields.Name.isUpdateable()) {
            Integer i112=0;
        }			

        List<Static_Code_Analysis_Violation__c > acclist = [select Name,Static_Code_Analysis_Result__c,Rule__c,File__c,Priority__c,Message__c from Static_Code_Analysis_Violation__c where Static_Code_Analysis_Result__c = :i1];
        string header = 'Name, Ruleset,Message \n';
        string finalstr = header ;
        for(Static_Code_Analysis_Violation__c a: acclist)
        {

            string recordString = a.File__c+','+a.Rule__c+','+a.Message__c+'\n';
                            if(a.File__c == null)
                            {
                                nullcheck = false;
                            }

            finalstr = finalstr +recordString;

        }

        Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
        blob csvBlob = Blob.valueOf(finalstr);
        string csvname= 'ReviewResults.csv';
        csvAttc.setFileName(csvname);
        csvAttc.setBody(csvBlob);
        Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
        String[] toAddresses = theSearchResults;
        String subject ='Static Code Result - '+stname[0].name;
        email.setSubject(subject);
        email.setToAddresses( toAddresses );
        email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
                if(nullcheck== true)
                {
                            Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
                }
                    nullcheck= true;     
    }
    
          
}
Thanks and Regards,
Diwakar G
Hi all,

I am using office 2007, and I want to setup excel connector. Please help me with step by step flow.
Thanks in advance.
 
Hello,

I want to expose a Class as a REST Service and looking for learning materials for the same

I fould below link with well defined steps,
 
@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {
    @HttpGet
    global static Account getRecord() {
        // Add your code
    }
}

https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_webservices

Are there any other examples i could refer to learn more on this subject ?
Hello,

How can i add the "authentication oauth" for a call of webservice ?

 
Hi,

I am trying to substitute a quick action (submitting a case for account to be removed) with a lightning component.

I need to prepopulate the Case.ContactId with the id of the internal contact attached to the user.

Here's the component:
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="caseCreate">
 <!--including lightning styles-->
    <ltng:require styles="{/assets/styles/salesforce-lightning-design-system.css'}"/>
     <ltng:require styles="{/assets/styles/salesforce-lightning-design-system.min.css'}"/>
    <aura:attribute name="contact" type="Contact" 
               default="{ 'sobjectType': 'Contact' }"/>
<aura:handler name="init" value="{!this}" action="{!c.loadContact}" /> 
<!-- Preparation of case object with fields-->
    <aura:attribute name="caseObj" type="Case"  default="{'sobjectType':'Case',
                                                         'Type':'Remove/Merge Account',
                                                            'Subtype':'',
                                                          'Subject':'',
                                                         'Priority':'Medium',
                                                         'Status':'New/Not Started',
                                                       'Description':''}"/> 
   <div class="slds">
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Type">Type</label>
          <div class="slds-form-element__control">
              <ui:inputText aura:id="type" class="slds-input" value="{!v.caseObj.Type}" placeholder="Remove/Merge Account" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Subtype">Subtype</label>
          <div class="slds-form-element__control">
            <ui:inputText aura:id="subtype" class="slds-input" value="{!v.casedObj.Subtype__c}" placeholder="--None--" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Subject">Subject</label>
          <div class="slds-form-element__control">
            <ui:inputText aura:id="subject" class="slds-input" value="{!v.casedObj.Subject}" placeholder="--None--" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Email">Priority</label>
          <div class="slds-form-element__control">
            <ui:inputText aura:id="priority" class="slds-input" value="{!v.caseObj.Priority}" placeholder="Medium" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Status">Status</label>
          <div class="slds-form-element__control">
              <ui:inputText aura:id="status" class="slds-input" value="{!v.caseObj.Status}" placeholder="New/Not Started" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="Description">Description</label>
          <div class="slds-form-element__control">
              <ui:inputText aura:id="description" class="slds-input" value="{!v.caseObj.Description}" placeholder="" />
          </div>
        </div>
       <div class="slds-form-element">
          <label class="slds-form-element__label" for="ContactName">Contact Name</label>
          <div class="slds-form-element__control">
             <ui:inputText aura:id="description" class="slds-input" value="{!v.caseObj.ContactId}" placeholder="{!v.contact.Id}" />
          </div>
        </div>
       <div class="slds-form-element">        
          <div class="slds-form-element__control">
            <ui:button label="Save" press="{!c.save}"/>
          </div>
        </div>
 </div>
</aura:component>
The ContactId is internal contact attached to the user.

JS Controller:
 
({  
    
    loadContact : function(component, event, helper) {
    	var action = component.get("c.getContact");
    	action.setCallback(this, function(response) {
    		var state = response.getState();
    			if(state === "SUCCESS") {
    				component.set("v.contact", response.getReturnValue());
    				console.log(response.getReturnValue());
				}
           
		});
		$A.enqueueAction(action);
	},
    
     save : function(component, event, helper) {    
     var action = component.get("c.createCaseRecord");
            action.setParams({"caseObj":component.get("v.caseObj")});
            action.setCallback(this,function(result){
            component.set("v.isShow",true);
            var caseId = result.getReturnValue();
            var toastEvent = $A.get("e.force:showToast");
						toastEvent.setParams({
    					title: "Success!",
   						message: "You have successfully submitted the case",
   						type: "Success"
						});	
			toastEvent.fire();
        });
         $A.enqueueAction(action);
 	}
})
Apex class:
public class caseCreate {
@auraenabled
    public static Id createCaseRecord(Case caseObj){
        upsert caseObj;
        return caseObj.id;
    }
    
    @AuraEnabled
    public static Contact getContact(){
        return [SELECT id, Name FROM Contact WHERE Email=: UserInfo.getUserEmail() LIMIT 1];
    }
}
Any help/advice would be much appreciated.

Thanks!


 
Hi All,

I want to import Json file into my leads record using apex and visualforce page.
Please help.
 
Hi All,

I want to import an xml file into my lead records using the apex code and visualforce page on a single click from the page.
here is my sample xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<lead-data >
    <record>
        <FirstName>Veera</FirstName>
        <LastName>Vinnu</LastName>
        <Phone>8008997654</Phone>
        <Email>veerav@gmail.com</Email>
    </record>
    <record>
        <FirstName>Beera</FirstName>
        <LastName>Binnu</LastName>
        <Phone>9898989898</Phone>
        <Email>beeru@gmail.com</Email>
    </record>
    <record>
        <FirstName>Ceera</FirstName>
        <LastName>Cinnu</LastName>
        <Phone>8989898989</Phone>
        <Email>ceera@gmail.com</Email>
    </record>
    <record>
        <FirstName>Deera</FirstName>
        <LastName>Dinnu</LastName>
        <Phone>7878787878</Phone>
        <Email>deera@gmail.com</Email>
    </record>
</lead-data>


Please help me out.
Hello,

I want to send email from apex class:

How can i send it ?

Thank you for advise

 
Hi, 

I would like to use System.assertEquals(ANY expected, ANY actual, ANY msg) with something like that : 
    @IsTest
    static void testRecoverValue() {

        Integer val1 = 1353;
        Integer val2 = 1300;
        Integer val3 = 0; 

        String json = FranceOperation_Utility_ReloadImpressions.getjsonFranceOperationTargetingDistibution();
        Integer val = FranceOperations_TargetDistri.parse(json);
        System.assertEquals(val1||val2||val3, val, 'test for function recoverValue() suceeded');
    }
I know the syntax on my last line is not correct but I would like to know the proper way to write it. Is there a way to include many integers in my value expected. How do I do that ? Should it be more like this : 
System.assertEquals(val1, val, 'test for function recoverValue() suceeded') || 
System.assertEquals(val2, val, 'test for function recoverValue() suceeded') || 
System.assertEquals(val3, val, 'test for function recoverValue() suceeded');
(I'm a begginer, and moreover, who has not written many tests before. Thank you for your patience !)
 
Hello everyone, need some help with a trigger I created. 

As you can see, my code doesn't have an alternative to a bank selection. 

For example, if a user leaves the picklist value blank and saves the record, an Apex error code will fire off, and post the error code at the top of the page. 

Is thseir a way to have this trigger skip this record if a blank value exists? That way a user can still save a record. if a blank value is needed. 

thanks!
 
trigger CAPdataTiers on CAPdata__c (before insert, before update) {
    for (CAPdata__c CAP : Trigger.new) {s
        if(CAP.Volume_Market__c.equalsIgnoreCase('As') && 
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Midwest'))
        {    
            CAP.TierElitePreferredJobs__c = 36; 
            CAP.TierElitePreferredRV__c = 90000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 24; 
            CAP.TierPreferredRV__c = 60000;
            CAP.TierPreferredL6MosTA__c = 75;
            CAP.TierRewardsAdvantageJobs__c = 12;
            CAP.TierRewardsAdvantageRV__c = 30000;
            CAP.TierRewardsAdvantageL6MosTA__c = 75;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('B') &&
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Res/Midwest Market B
            CA sP.TierElitePreferredJobs__c = 18; 
            CAP.TierElitePreferredRV__c = 45000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 12; 
            CAP.TierPreferredRV__c = 30000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 6;
            CAP.TierRewardsAdvantageRV__c = 15000;
            CAP.TierRewardsAdvantageL6MosTA__c = 25;
        }
}

 
  • November 13, 2018
  • Like
  • 0
Hello,

- I want to develope a solution where i can communicate with a third party application.
- the communication will be in two way.

1) I should call the third party system (i suppose i should call a webservice, i have done this one before)
2) should expose the salesforce o the third party system (never tried it)

Can someone guide me he concept behind 1 & 2, what do they mean in Salesforce  ?
Also, wha are they called in salesforce, so i can find some corresponding code on inernet ?

Thank you very much in advance
 
Hi! I'm trying to make a trigger that sets a Case's status to "Open" when a FeedComment is inserted or updated. While the trigger works fine when I've tested it in real-world cases in my sandbox, I have not been able to get any test case working.

Here's the trigger:
trigger UpdateStatus on FeedComment (after insert, after update) {
    
    List<Case> caselist = new List<Case>();
    List<Case> casestoupd = new List<Case>();
    List<Id> caseids = new List<Id>();
    
    for(FeedComment f:Trigger.New) {
        if (f.ParentId.getSObjectType() == Case.SObjectType) {
            caseids.add(f.ParentId);
        }
    }
    
    try {
        caselist = [Select Id, Status from Case where Id IN :caseids];
    }
    catch(Exception e) {
        caselist = null;
    }
    
    for(Case c:caselist) {
        c.Status = 'Open';
        casestoupd.add(c);
    }
    
    List<Database.SaveResult> updateResults = Database.update(casestoupd,False);
}

And here's the test:
@isTest
private class UpdateStatus_UnitTest {
    
    static testMethod void testTrigger() {
        
        Case c = new Case(Subject='Test Case', Status = 'New');
        insert c;
        
        test.startTest();
        
        FeedItem f = new FeedItem(ParentId=c.Id, Body='Test Post');
        insert f;
        
        FeedComment fc = new FeedComment(CommentBody='Test Comment',FeedItemId = f.Id);
        insert fc;
        
        System.assertEquals('Closed', c.Status);
        
        test.stopTest();
        
    }
}

The problem seems to be that FeedComment's ParentId field isn't writable. When I try to print out fc.ParentId it just returns null, and because of this the System.assertEquals test fails.

Really appreciate any help I can get on this. Thanks in advance!

Can u help me to write test class


/**
 * Using without sharing as need to run query on Organization table
 */
public without sharing class Utilities {

    //Get instance from INSTANCE.visual.force.com page so we can build
    public Static String getInstance(){
        String instance = '';
        Organization o = [SELECT OrganizationType, InstanceName FROM Organization limit 1];
        String orgType = o.OrganizationType;
        String insName = o.InstanceName;
        if(orgType == 'Developer Edition' || insName.startsWithIgnoreCase('cs')){
            List<String> parts = ApexPages.currentPage().getHeaders().get('Host').split('\\.');
            instance = parts[parts.size() - 4] + '.';
        }
        return instance;
    }
    //Needed in cases if current org is sandbox
    public static String getSubdomainPrefix(){
        Organization o = [SELECT OrganizationType, InstanceName FROM Organization limit 1];
        String orgType = o.OrganizationType;
        String insName = o.InstanceName;
        if(insName.startsWithIgnoreCase('cs')){
            return UserInfo.getUserName().substringAfterLast('.')+ '-';
        }
        return '';
    }
}
how to know which line of code we stopped and how to set debug points and logs 
select id,name,email from Account where createddate=today
select accountid,Account.name from Contact where account.closeddate=today and createdate=today
Hi, I am a newbie to SFDC, and very excited learning tons of new stuff here. Now I have a question that, if I have a controller which serves as REST API Web Service endpoint and receiving the external parties' post information. can I trigger some actions such as popup/alert in the associated VF page?

Part of my code is pasted below.I was trying to trigger the popup by calling the action function in the httppost function, but failed. Can somebody please help me? Any advice will be very appreciated. Thank you!
--Controller
  @HttpPost
  global static boolean getPost(String matrics) {
        boolean received = false;
        Map<String, Object> params = (Map<String, Object>)JSON.deserializeUntyped(matrics);
        postID = (String)params.get('ID');
        userId = 'myid123';
        if(userID.equals(postID)){ 
            received=true;
            showPopup(); //change the displayPopUp from false to true
        }else{
            received=false;
           closePopup();//change the displayPopUp from  true to false
        }
        return received;
    }   

--VF Page
        <apex:outputPanel id="TestPopup">
        <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
                This is where I would put whatever information I needed to show to my end user.<br/><br/><br/>
                <apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="TestPopup"/>
            </apex:outputPanel>
        </apex:outputPanel>

I have a formula field where I need to return varying values based upon an opportunity with or without a related campaign.  IF my opporunity has NO campaigns, I need to use this forumla.  

Scenario ONE has no syntax errors:

IF(CampaignId  = null &&  CustomField__c <> null, "Value 1", "Value 2")

If my opportunity has a campaign, I need to add this logic:

Scenario TWO has no syntax errors:

CASE(
Campaign.Type,
"Direct Mail","Direct Mail",
"Email","Email",
"Trade Show","Trade Show",
""
)

I'm trying
 

CASE(
CampaignId  = null &&  CustomField__c <> null, "Value 1", "Value 2"),
Campaign.Type,
"Direct Mail","Direct Mail",
"Email","Email",
"Trade Show","Trade Show",
""
)
)

Error: Syntax error. Extra ','

Hey- I had written custom REST API for file upload, can you please let me know how to test that using Postman. Do I need to convert the file to base64 encode and post the request or any other way, please suggest.

Thanks
Is multi insert/delete  possible with record edit form ?
Hi everyone,

Hoping someone can have a look and help me identify my problem. I've been working on the code in a fragmented, few-minutes-at-a-time way and I'm kind of stuck.

Here's the class:
global class AddressableSpend  {

public static Decimal CalculateAddressableSpend(Integer employees, Integer accountSIC, Decimal revenue){
	//Create a variable to store the results of our query, Query the Addressable Spend metadata table to get the appropriate records.
	Decimal multiplierResults = new Decimal
	multiplierResults = [SELECT Addressable_Spend_Multiplier__c FROM MultiplierMetadata__mdt  WHERE (employees>=Employee_Lower_Bound__c && employees <= Employee_Upper_Bound__c && accountSIC == SIC__c) LIMIT 1]
	//Use the Addressable Spend Multiplier from the retrieved record to multiply the revenue
	Decimal finalSpendAmount = multiplierResults * revenue;
	return finalSpendAmount;
	}
}

I'm trying to call this class from a trigger, which will pass in the three variables employees, accountSIC, and revenue. The class is supposed to return the multiplied revenue value (here labeled as finalSpendAmount) to the trigger to update the Account.

I'm getting four errors on the above code. Two are "expecting ; but was )" and "expecting ; but was ]" so I'm putting them aside for the moment. The ones I'm more concerned about are "Unexpected token 'multiplierResults'" and "Unexpected token 'Employee_Lower_Bound__c'" I've declared the multiplierResults variable, and I've encapsulated the query in [], so I'm not sure why those two are throwing errors.

If anyone can point me to the probably-quite-simple fix I'd appreciate it. Thanks for the help!
Hi all,

we are experiencing an issue not only when attaching daily emails to opportunities but also when creating reports. In both cases the date of yesterday always appears.

For instance, I created a report yesterday (14th November), but Salesforce is showing me the Created Date  as "13th November" (13.11.2018). 

I already checked my user settings. My time zone is pointing to the correct one "Central European Time (Europe/Berlin) --> GMT+01:00.

Did anybody face this issue before? how did you solve this issue?.
Hi,
I  have a controller class A which has two methods ,first method which fetches ContactID and 2nd  method fetches the Module Id.
I am creating a page whose controller class B will fetch values from Methods of Class A.
Question-1 : How to call methods of controller A in controller B.
Should we write this in the constructor of the new controller B or a separate method inside it to call the Controller class A methods.


Once i fetch the values , i need to create a record in a junction object which will associate contactId and Module Id(which is fetched from the methods). Here id the Module is 1,2 only then create record in junction object else not required.How shall we put this logic.

Kindly help as i am new to this.
 
There is some raw html being displayed underneath the 'check syntax' button when you click the 'check syntax' button and the syntax is valid or invalid, see screenshot: User-added image

not a serious bug by any stretch, but should definitely get fixed! :) 
Hi.I am trying to create a report that returns a Count of Cases with Attchments.  Record Type can't do this.  I'm just learning SOQLso I ran a SOQL query but I get a result with a list of all Cases and Attachments.  Here's my query:

SELECT Case.CaseNumber, (SELECT Attachment.ParentID FROM Case.Attachments) FROM Case

I know I am missing Count() but I don't know how to put it in. I just need a simple Count of Cases WITH Attachments. Thanks for helping.
({
	doInit : function(component, event, helper) {
		component.set(v.columns[
               {label: 'Department ID', fieldName: 'DepartmentID', type: 'Auto Number'},
               {label: 'Department Name', fieldName: 'Name', type: 'text'},
               {label: 'Department Manager', fieldName: 'DepartmentManager', type: 'text'},
        	   {label: 'Employee Count', fieldName: 'NoofEmployee', type: 'number'}
        ]);
		var action= component.get("c.getRecord");
        action.setCallback(this, funtion(response){
                          var state=response.getState();
        if(state==="SUCCESS"){
            component.set("v.dept",response.getReturnValue());
        }
        else{
            console.log("Failed with state: " + state);
        }
        });
		$A.enqueueAction(action);    
}
})
I am getting  Parsing error: Unexpected token {  at line 10.
Can someone suggest me what is requier in this?
Thank you!!
 
I have a requirement that ananymous user who doesn't requre login to access a page, fills the details, saves to an object (custom, and it has lookup field  to contact) . For this I have done the below steps
  • Added Domain
  • Created new Site
  • Assigned the created VF page in to the list 'Site Visualforce Pages'
  • Activated the site
  • Gave perrmissions (RWA) to the custom object
But when I click on the page I got the following error
Authorization Required

You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.
We should directly access to the page without authorize, how can we do this?
Thanks,