• Smita Hodiggeri
  • NEWBIE
  • 34 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 13
    Questions
  • 31
    Replies
Hi Community,
 
I am looking for an extension that would make query building more quicker by auto suggesting and auto completing?
Is there an extension like that I can install on my visual studio IDE and get cracking? 
 
#Microsoft Visual Studio Code #SOQL Queries
 
Hi Community,
I am writing a brand new trigger on visual stuio code by going under triggers--> create new apex trigger and all iI have in the trigger(No test class yet) is as below. 

trigger AccountTrigger on Case (before insert) {
System.debug('I am in trigger please confirm I am here');

and it throws error as follows. 
Unexpected token trigger at Ln1,Col 1 
Can i get some pointers on how to resolve this in Visual studio ?
The Same code in Dev console has no issues. 
Thanks in advance, 
Smita
Hi Community,
 
I am working on a requirement where in I don't want Case assignment rule to run which is changing the case owner.The condition being if there is a value in a particular field (Old case number field which means this case is actually getting unarchived). This is basically a scenario of unarchiving(using ob archiver tool ) where in, upon unarchiving we are loosing original case owner as case assignment rules are running again.
 
Any ideas on how to implement this?
 
My ultimate intention is to preserve case owner. Have the same owner assigned to case as it was before archiving.
 
I read a post which says implement this in future method. I would prefer any non code/low code ways to do this.
https://salesforce.stackexchange.com/questions/186702/turn-off-case-assignment-rules
 
Would a after insert trigger help?
 
Thanks in advance,
Smita
Hi Community,

I am looking to figure out how do I get a list of all the email messages for the all oppotunities of particualr record type?
Any thoughts are much appreciated.

Many thanks,
Smita 
Hi Community,
 
I am writing a flow which should create a chatter post internally using Rich text template.
The content of rich text template is as per SC. So when I try to create a test record it throws error saying "NVALID_MARKUP: Error while parsing Rich Text Content: Unsupported HTML tag or attribute encountered - strong." I highly doubt the way I am using tags "<p> </p>" to create lines between Subject and Description.
Can I get another pair of eyes to look at this and suggest workable ways?
User-added imageYour time is much appreciated.
Thanks,
Smita
Hi Community,

I am doing migration from Notes & Attachments to Files. and I am trying to establish who becomes owner of the migrated attachment(File). Would it be the original owner or will it be the person who carried out migration? 

Can do we SOQL to get this info?
Hi Community,

I have inherited an aura component that basically prints a list of records dispalyed right down below for the community users to print.
This was written back in 2017 and no body has seen it working.
I played around a bit and observed that The URL for salesforce community being used under Lightning experience Transition Assistant--> Feature Settings--> All Sites is changed to following
New URL
https://community.ausure.com.au
The URL being used in Controller.Js is 
"url": "http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId

I am not sure how to construct a correct URL so that it prints all the records of CPD Register Points for a community user properly on clicking the button. 

My Controller Code.
({
    openCPDPointsList : function(component, event) {
    var urlEvent = $A.get("e.force:navigateToURL");
    var recordId = component.get("v.recordId");    
        urlEvent.setParams({
            url:"http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId           
        });
    urlEvent.fire();
    },
})

Tried constructing URL Like
 url": "https://community.ausure.com.au/s/my-cpd-register?recordId="+recordId
But this brings me back to the same page instead of taking me to printable view.

User-added image
I am looking to use the following query to bulk query all the notes and attachments in an org(or by object) so that I can do the migration of N&A's to Files (pre Spring '16 N&A's). Can someone give me a hand with this?
The results are way too many and I am hit with too many exceptions even for a month range. Can some one help get past that stupid error so that I can get a nice list of the notes & attchments created on accounts before 01012016?

I am looking to execute this in ANon window or just a simple SOQL query would be a dream!!
Your time and thoughts are much appreciated.
Thanks,

List<Account> accList = [SELECT Id,Name ,(SELECT RecordType FROM CombinedAttachments AS S WHERE (CreatedDate >= 2015-01-01T23:59:59Z AND CreatedDate < 2016-02-01T23:59:59Z)  AND (S.RecordType = 'Note' OR S.RecordType = 'Attachment'))  FROM Account];

Set<Id> accSetId = new Set<Id>(); 
for (Account acc :accList){
   if (acc.CombinedAttachments != null) {
      accSetId.add(acc.Id);
       system.debug('acc:'+acc);
   }
}
Hi Devs,

So i have inherited code which should create reneweal oppotunites based on policies which is not creating reneweal opportuites for some polices and I need to work out why. I am stumped at the moment about how to and where to strat. I would like to start by executing the code in Anon block and was wondering I can get help with the synatx? Here is the class any thoughts are appreciated.

global class CreatePolicyToOppBatch implements Database.Batchable<sObject>, Database.Stateful, database.allowscallouts,schedulable {
    global Map<String, Decimal> insuranceMap = new Map<String, Decimal>();
    global Map<String, Policy_Opportunity_Field_Map__mdt> fieldMap = new Map<String, Policy_Opportunity_Field_Map__mdt>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
        String query = 'Select Id, Class_of_Business__c, Insurance_Start_Date__c, Account__c, Insurance_End_Date__c,Account_RecordType__c, Account__r.OwnerId';
        for(Policy_Class_of_Insurance__mdt  pm : [SELECT Id, Label, QualifiedApiName, Value__c FROM Policy_Class_of_Insurance__mdt]){
            insuranceMap.put(pm.Label, pm.Value__c);
        }
        sObject sObj = Schema.getGlobalDescribe().get('Policies__c').newSObject() ;
        Map<String, Schema.SObjectField> poFieldMapping = sObj.getSObjectType().getDescribe().fields.getMap();
        sObject opp = Schema.getGlobalDescribe().get('Opportunity').newSObject() ;
        Map<String, Schema.SObjectField> opFieldMapping = opp.getSObjectType().getDescribe().fields.getMap();
        
        for(Policy_Opportunity_Field_Map__mdt  po : [SELECT Id, Label,Policy_Field_Api__c ,Default_Value_AUS__c, Default_Value_NZ__c,Use_Default_If_Null__c,Default_Value__c  FROM Policy_Opportunity_Field_Map__mdt]){
            if(poFieldMapping.containsKey(po.Policy_Field_Api__c) && po.Policy_Field_Api__c <> null ){
                if( !'Insurance_End_Date__c'.equals(po.Policy_Field_Api__c) && !'Class_of_Business__c'.equals(po.Policy_Field_Api__c) && !'Insurance_Start_Date__c'.equals(po.Policy_Field_Api__c) && !'Account__c'.equals(po.Policy_Field_Api__c) && !'Account_RecordType__c'.equals(po.Policy_Field_Api__c))   {
                    query= query + ', ' + po.Policy_Field_Api__c;
                }
            }
            if(opFieldMapping.containsKey(po.Label)) {
                fieldMap.put(po.Label,po);
            }
        }
        query = query+' FROM Policies__c WHERE Policy_Status__c != \'Expired\' AND Policy_Status__c != \'Cancelled\' '; 
        System.debug(query);
        return Database.getQueryLocator(query);
    }
    global void execute(SchedulableContext ctx){
        CreatePolicyToOppBatch poBatch  = new CreatePolicyToOppBatch();
        Database.executeBatch(poBatch,50);            
    }    
    global void execute(Database.BatchableContext bc, List<sObject> scope){
        System.debug('ecute>>'+ scope);
        List<sObject> policyListToUpdate = new List<sObject>();
        List<sObject> oppList = new List<sObject>();
        Date policyStartDate;
        for(sObject obj : scope){ 
            if(obj.get('Insurance_Start_Date__c') <> null){
                policyStartDate = Date.valueOf(obj.get('Insurance_Start_Date__c'));
                System.debug('insuranceMap >>'+insuranceMap);
                System.debug('Class_of_Business__c>>'+obj.get('Class_of_Business__c'));
                Integer noofday =Integer.valueOf(insuranceMap.get(String.valueOf(obj.get('Class_of_Business__c'))));
                System.debug(noofday);
                System.debug(policyStartDate.daysBetween(system.today()));
                if(policyStartDate.daysBetween(system.today()) == noofday ){
                    sObject opp = Schema.getGlobalDescribe().get('Opportunity').newSObject() ;
                    Map<String, Schema.SObjectField> fieldMapping = opp.getSObjectType().getDescribe().fields.getMap();
                    for(String fieldval : fieldMap.keySet()){
                        if(getValue(fieldMap,fieldval,obj) <> null ){
                            if(Schema.DisplayType.DATE == fieldMapping.get(fieldval).getDescribe().getType()){
                                Date d = Date.ValueOf(getValue(fieldMap,fieldval,obj));
                                if('Insurance_End_Date__c'.equals(fieldMap.get(fieldval).Policy_Field_Api__c) && ('Renewal_Date__c'.equals(fieldval) || 'CloseDate'.equals(fieldval))){
                                   d = d.addDays(1);
                                }
                                opp.put(fieldval, d );
                            }
                            else if(Schema.DisplayType.DATETIME ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, DateTime.ValueOf(getValue(fieldMap,fieldval,obj)) );   
                            }
                            else if(Schema.DisplayType.CURRENCY == fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Decimal.ValueOf(String.valueOf(getValue(fieldMap,fieldval,obj)) )); 
                            }
                            else if(Schema.DisplayType.BOOLEAN ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Boolean.ValueOf(getValue(fieldMap,fieldval,obj))); 
                            }
                            else if(Schema.DisplayType.DOUBLE ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Double.ValueOf(String.valueOf(getValue(fieldMap,fieldval,obj)) )); 
                            }
                            else{
                                opp.put(fieldval, String.valueOf(getValue(fieldMap,fieldval,obj))); 
                            }
                        }
                    }
                    opp.put('AccountId',String.valueOf(obj.get('Account__c') ));
                    if(obj.getSObject('Account__r') <> null && obj.getSObject('Account__r').get('OwnerId') <> null){
                        opp.put('OwnerId',String.valueOf(obj.getSObject('Account__r').get('OwnerId')));
                    }
                    
                    oppList.add(opp);
                    System.debug(opp);
                }
                if(Date.valueOf(obj.get('Insurance_End_Date__c')) == System.today()){
                    obj.put('Policy_Status__c', 'Expired ');
                    policyListToUpdate.add(obj);
                } 
            }
        }
        if(!oppList.isEmpty()){
            insert oppList;
        }
        if(!policyListToUpdate.isEmpty()){
            update policyListToUpdate;
        }
    }    
    global void finish(Database.BatchableContext bc){
        
    }
    public Static Object getValue(Map<String, Policy_Opportunity_Field_Map__mdt> fieldMap,String fieldval, sObject obj){
        
        if(fieldMap.get(fieldval).Policy_Field_Api__c <> null && obj.get(fieldMap.get(fieldval).Policy_Field_Api__c) <> null){
            return obj.get(fieldMap.get(fieldval).Policy_Field_Api__c);
            
        }
        else if(fieldMap.get(fieldval).Use_Default_If_Null__c == true ) {
            if('New_Zealand_Account'.equals(String.valueOf(obj.get('Account_RecordType__c')))){
                return fieldMap.get(fieldval).Default_Value_NZ__c; 
            }
            else if('Australian_Account'.equals(String.valueOf(obj.get('Account_RecordType__c')))){
                return fieldMap.get(fieldval).Default_Value_AUS__c; 
            }
            else{
                return fieldMap.get(fieldval).Default_Value__c; 
            }
        }
        return null;
    }  
    global static string scheduleJob(){
        CreatePolicyToOppBatch job  = new CreatePolicyToOppBatch();
        
        String CRON_EXPR =  '0 0 5 * * ?' ; //every day 5 am
        System.Schedule('CreatePolicyToOppBatch Job',CRON_EXPR,job);
        return null;
    }    
}
 
Hi Community, 
Really need help in getting this over the line.
I have a long text area like this 
Policy Type: Accidental Damage (SCTP), Policy Start Date: 27/03/2022, Acceptance Criteria: All default to No, Insured Name: Account Name, Date of Birth of Oldest Insured: Date of birth of primary contact, Existing Policy With Selected Insurers: No (SCTP)

I Need to dispaly it like this using flow
Policy Type: Accidental Damage (SCTP)
Policy Start Date: 27/03/2022
Acceptance Criteria: All default to No and so on.. 

Can any one guide me how to loop through long text area and introduce new line after each comma using flow?
 
This is a really intersting data import problem I am stuck with.
Basically I have an object A which needs data uploading and this object has 3 LOOKUP relationships to the same object B with different names. So in essenece they appear as different fields on the Object A page layout and we expect people to browse and populate values into those 3 differently named lookup B object lookup fields(But They Belong to the same object). When I try to insert the data into these 3 lookup fileds for object A, data loader throws me error saying "Map only one csv field to Salesforce.com Id "
How can I automtically data import data into Object A's 3 lookup fields  in this kind of scenario as it not allowing me to import data with unique object b record id's.
Any thoughts are much appreciated.
Thanks,
Smita 
Hey Devs,

For the following my test class  code coverage doesnt seem to go up above 75%, This is my first test class.
Any thoughts on how to improve the code coverage are much appreciated.

Actual Class

public class EngagementSharepointFolderCreation {
    @InvocableMethod(label='Setup Engagements Folder structure in Sharepoint' description='Creates accounts with children of Opportunities and Deliverables')
    public static void CreateEngagementsFolder (List<String> engagementId){
        CreateEngagementsFolderHierarchy(engagementId);
    }
    @future(callout=true)
    public static void CreateEngagementsFolderHierarchy(List<String> lstOfEngagementIds){
        try{
            // get the Engagement
            
            List<pse__Proj__c> lstOfEngagementRecs = [Select Id, Engagement_SharePoint_Folder_Name__c, AccountEngagementSharePointFolderIdOnEng__c,pse__Account__c, pse__Account__r.Name, pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c, pse__Opportunity__r.Name,pse__Account__r.Opportunity_Sharepoint_Folder_Id__c, pse__Proj__c.Engagement_Sharepoint_Folder_Id__c from pse__Proj__c where Id = :lstOfEngagementIds];
            
            List<Account> lstOfAccountsToPSEFolderIds = new List<Account>();
            
            List<Opportunity> lstOfOppPSEFolderIds = new List<Opportunity>();
            
            
            //get auth info from the Settings MDT
            fileforcem1__Sharepoint_Settings__mdt orgSettings = [SELECT fileforcem1__Named_Credential__c,fileforcem1__Document_Library_Id__c,fileforcem1__Site_Id__c FROM fileforcem1__Sharepoint_Settings__mdt WHERE Developername = 'Default' limit 1];
            
            //Initialize the client object
            fileforcem1.ClientApi apiClient = new fileforcem1.ClientApi();
            apiClient.namedCredentialName = orgSettings.fileforcem1__Named_Credential__c;
            
            
            //get the root folder id for the Engagement -- Need to check whats this?
            fileforcem1__SharePoint_Object_Settings__mdt objectSettings = [SELECT fileforcem1__Root_Folder_Id__c,fileforcem1__Site_Id__c,fileforcem1__Document_Library_Id__c,fileforcem1__Initial_Folder_Structure__c FROM fileforcem1__Sharepoint_Object_Settings__mdt WHERE MasterLabel ='pse__Proj__c' LIMIT 1 ];
            
            apiClient.sharepointSiteId = objectSettings.fileforcem1__Site_Id__c;
            apiClient.documentLibraryId = objectSettings.fileforcem1__Document_Library_Id__c;
            for(pse__Proj__c  engagement : lstOfEngagementRecs){
                String accFolderId;
                fileforcem1.SharepointFileInfo accFolder;
                if (String.isBlank(engagement.pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c))
                {
                    //Create the Customer Account folder and record the ID
                    
                    if (!Test.isRunningTest()) {
                        accFolder = apiClient.createFolder(Label.PSA_CCX_Account, engagement.pse__Account__r.Name);
                        accFolderId = accFolder.Id;
                        lstOfAccountsToPSEFolderIds.add(new Account(Id = engagement.pse__Account__c, Account_Engagement_SharePoint_Folder_Id__c = accFolder.Id));
                    } else {accFolder=new fileforcem1.SharepointFileInfo();}
                    
                }else{
                    accFolderId = engagement.pse__Account__r.Account_Engagement_SharePoint_Folder_Id__c;
                }
                
                //Create the opportunity folder and record the ID
                fileforcem1.SharepointFileInfo oppFolder;
                if (!Test.isRunningTest()) {
                    oppFolder = apiClient.createFolder(accFolderId, engagement.pse__Opportunity__r.Name);
                    lstOfOppPSEFolderIds.add(new Opportunity(Id = engagement.pse__Opportunity__c, Opportunity_PSA_Sharepoint_Folder_Id__c = oppFolder.Id));
                } else{ oppFolder = new fileforcem1.SharepointFileInfo();}
                System.debug('Opp Folder created successfully'+oppFolder.Id);
                
                //Create PSE folder
                
                fileforcem1.SharepointFileInfo pseFolder;
                if (!Test.isRunningTest()){
                pseFolder = apiClient.createFolder(oppFolder.Id, engagement.Engagement_SharePoint_Folder_Name__c);
                engagement.sharepoint_folder_id__c = pseFolder.Id;
                }
                //Create Deliverables Folder under opportunity
                fileforcem1.SharepointFileInfo Deliverable1Folder;
                if (!Test.isRunningTest()) {
                    Deliverable1Folder  = apiClient.createFolder(pseFolder.Id, 'Deliverables');
               
                }
                else {Deliverable1Folder = new fileforcem1.SharepointFileInfo(); }
                engagement.Deliverable_Folder_Id__c= Deliverable1Folder.Id;
                System.debug('Deliverable Folder created successfully'+Deliverable1Folder.Id);
            }
            
            // update Account Engagement Folder Id 
            if(!lstOfAccountsToPSEFolderIds.isEmpty()){
                update lstOfAccountsToPSEFolderIds;
            }
            // update Opportunity Engagement Folder Id
            if(!lstOfOppPSEFolderIds.isEmpty()){
                update lstOfOppPSEFolderIds;
            }
            
            //update the opportunity to save the IDs
            update lstOfEngagementRecs;
        }
        
        catch(DmlException e) {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
    }
}

The Test Class for the same

 // Engagement(Deliverable) folder test class creation
    
  static testMethod void folderCreationTestEngagement()
  {
      
  Test.StartTest();         
  
  //Create Accounts To be related to Engagement
 
  Account customerAccTobeRelatedToEngagement = new Account();
  customerAccTobeRelatedToEngagement.Name ='TestCustomerAccountTobeRelatedToEngagement';
  customerAccTobeRelatedToEngagement.Type ='Customer';
  customerAccTobeRelatedToEngagement.D_Invoice_Delivery_Method__c= 'Email';
  customerAccTobeRelatedToEngagement.D_Historic_Customer_Folder_Locations__c= 'HistoricCustomerFolderLocation';  
  insert customerAccTobeRelatedToEngagement;
  System.debug('The new inserted account' + customerAccTobeRelatedToEngagement);    
      
  Account prospectAccTobeRelatedToEngagement = new Account();    
  prospectAccTobeRelatedToEngagement.Name='TestProspectAccountTobeRelatedToEngagement';
  prospectAccTobeRelatedToEngagement.Type='Prospect';
  prospectAccTobeRelatedToEngagement.D_Invoice_Delivery_Method__c='Email';
  prospectAccTobeRelatedToEngagement.D_Historic_Customer_Folder_Locations__c='HistoricCustomerFolderLocation';    
  prospectAccTobeRelatedToEngagement.D_External_ID_From_Legacy_Systems__c='ExternalId';    
  insert prospectAccTobeRelatedToEngagement;
  System.debug('The new inserted prospect account' + prospectAccTobeRelatedToEngagement); 

   //add account ids to be related to the Engagement to the list
  List<String> accIDsTobeRelatedToEngagement = new List<String>();
  accIDsTobeRelatedToEngagement.add(customerAccTobeRelatedToEngagement.Id); 
  accIDsTobeRelatedToEngagement.add(prospectAccTobeRelatedToEngagement.Id);     
       
  //Create Account Folders in SharePoint    
  AccountSharepointFolderCreation.CreateAccountFolder(accIDsTobeRelatedToEngagement);
    
    If (customerAccTobeRelatedToEngagement.SharePoint_Folder_Id__c<>'')  {
      System.debug('Account SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.SharePoint_Folder_Id__c);}
    else if (customerAccTobeRelatedToEngagement.Opportunity_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Account Opp SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.Opportunity_Sharepoint_Folder_Id__c);}
    else if (customerAccTobeRelatedToEngagement.Contracts_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Account Contract SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.Contracts_Sharepoint_Folder_Id__c);}
    else if (customerAccTobeRelatedToEngagement.Contracts_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Account Contract SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.Contracts_Sharepoint_Folder_Id__c); }
    else if (customerAccTobeRelatedToEngagement.Finance_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Account Finance SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.Finance_Sharepoint_Folder_Id__c); }
    else if (customerAccTobeRelatedToEngagement.Archive_Sharepoint_Folder_Id__c<>'') {
        System.debug('Account Archive SharePoint FolderID: ' + customerAccTobeRelatedToEngagement.Archive_Sharepoint_Folder_Id__c);}
  
  //Create Opportunity to be related to Engagement
  Opportunity newCustomerOppTestCustomerOppTobeRelatedtoEngagement = new Opportunity();  
  newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Name='TestCustomerOppTobeRelatedOpportunity';
  newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Type='New Sale';    
  newCustomerOppTestCustomerOppTobeRelatedtoEngagement.CloseDate=System.today();
  newCustomerOppTestCustomerOppTobeRelatedtoEngagement.StageName='Discovery & Qualification';
  newCustomerOppTestCustomerOppTobeRelatedtoEngagement.AccountId=customerAccTobeRelatedToEngagement.Id;
  insert newCustomerOppTestCustomerOppTobeRelatedtoEngagement;

    
  Opportunity newProspectOppTobeRelatedtoEngagement = new Opportunity();     
  newProspectOppTobeRelatedtoEngagement.Name='TestCustomerOpp';
  newProspectOppTobeRelatedtoEngagement.Type='New Sale';
  newProspectOppTobeRelatedtoEngagement.CloseDate=System.today();
  newProspectOppTobeRelatedtoEngagement.StageName='Discovery & Qualification';
  newProspectOppTobeRelatedtoEngagement.AccountId=prospectAccTobeRelatedToEngagement.Id;
  insert newProspectOppTobeRelatedtoEngagement;
     
    
  List<String> oppIDsToBeRelatedToEngagement = new List<String>();
  oppIDsToBeRelatedToEngagement.add(newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Id); 
  oppIDsToBeRelatedToEngagement.add(newProspectOppTobeRelatedtoEngagement.Id);     
 

  //Create Opportunity Folders in SharePoint
  OpportunitySharepointFolderCreation.CreateOpportunityFolder(oppIDsToBeRelatedToEngagement);

    If (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.fileforcem1__Sharepoint_Folder_Id__c <>'')  {
      System.debug('Opp SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.fileforcem1__Sharepoint_Folder_Id__c);}
    else if (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Quotes_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Opp Quotes SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Quotes_Sharepoint_Folder_Id__c);}
    else if (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Proposal_Sharepoint_Folder_Id__c<>'')  {
        System.debug('Opp Proposals SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Proposal_Sharepoint_Folder_Id__c);}
    else if (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Signed_Contracts_Sharepoint_Folder_ID__c<>'')  {
        System.debug('Opp Signed Contracts SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Signed_Contracts_Sharepoint_Folder_ID__c); }
    else if (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Customer_Invoices_Folder_Id__c<>'')  {
        System.debug('Opp Customer Invoices SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Customer_Invoices_Folder_Id__c); }
    else if (newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Vendor_Sharepoint_Folder_Id__c<>'') {
        System.debug('Opp Vendor SharePoint FolderID: ' + newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Vendor_Sharepoint_Folder_Id__c);}
  
            
  //Create Engagement 
  pse__Proj__c NewEngagement1 = new pse__Proj__c();
  NewEngagement1.RecordTypeId = '0124Y000000502fQAA'; //Client
  NewEngagement1.Name='TestEngagementCreatedForMilestone';
  NewEngagement1.Account__c = customerAccTobeRelatedToEngagement.Id;
  NewEngagement1.Opportunity__c = newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Id;
 // Query the regions to be used and assigned
   List<pse__Region__c> regionresultsforvic  = [SELECT Name FROM pse__Region__c WHERE Name = 'Victoria' Limit 1]; 
  if (regionresultsforvic.size()>0)
{
   NewEngagement1.pse__Region__c = regionresultsforvic[11].Name;

}
  NewEngagement1.pse__Start_Date__c = System.today();
  NewEngagement1.pse__End_Date__c = System.today();  
  NewEngagement1.pse__Practice__c = 'aDt4Y000000000aSAA';
    
  System.debug('practice name inserted' + NewEngagement1.pse__Practice__c);
  insert NewEngagement1;
 
  //Create Engagement2 
  pse__Proj__c NewEngagement2 = new pse__Proj__c();
  NewEngagement2.RecordTypeId = '0124Y000000502BQAQ'; // Global // Internal 0124Y000000502aQAA // 0124Y000000502kQAA
  NewEngagement2.Name='TestEngagementCreatedForMilestone2';
  NewEngagement2.Account__c = customerAccTobeRelatedToEngagement.Id;
  NewEngagement2.Opportunity__c = newCustomerOppTestCustomerOppTobeRelatedtoEngagement.Id;
 // Query the regions to be used and assigned
   List<pse__Region__c> regionresultsforqld  = [SELECT Name FROM pse__Region__c WHERE Name = 'Queensland' Limit 1]; 
  if (regionresultsforqld.size()>0)
{
   NewEngagement1.pse__Region__c = regionresultsforqld[6].Name;

}
  NewEngagement1.pse__Start_Date__c = System.today();
  NewEngagement1.pse__End_Date__c = System.today();  
  NewEngagement1.pse__Practice__c = 'aDt4Y000000000aSAA';
    
  System.debug('practice name inserted' + NewEngagement2.pse__Practice__c);
  insert NewEngagement2;
 
      
  List<String> milestoneIDs = new List<String>();
  milestoneIDs.add(NewEngagement1.Id); 
  milestoneIDs.add(NewEngagement2.Id); 
 /* milestoneIDs.add(NewEngagement3.Id); 
  milestoneIDs.add(NewEngagement4.Id); */
     
  //Create Milestone Folders in SharePoint
  AutomaticmilestonesharepointFolder.CreateMilestoneFolder(milestoneIDs);    

 If (NewEngagement1.sharepoint_folder_id__c <>'')  {
      System.debug('Milestone SharePoint FolderID: ' + NewEngagement1.sharepoint_folder_id__c);}
 If (NewEngagement2.sharepoint_folder_id__c <>'')  {
      System.debug('Milestone SharePoint FolderID: ' + NewEngagement2.sharepoint_folder_id__c);}
 /* If (NewEngagement3.sharepoint_folder_id__c <>'')  {
      System.debug('Milestone SharePoint FolderID: ' + NewEngagement3.sharepoint_folder_id__c);}
  If (NewEngagement4.sharepoint_folder_id__c <>'')  {
      System.debug('Milestone SharePoint FolderID: ' + NewEngagement4.sharepoint_folder_id__c);} */
 
  Test.stopTest();
  }
 
Hey Everyone,
 Moving from administration to coding here.Your understanding is much apprecaited. :)
So the scenario I am trying to handle with apex is When portential "lead " record will attempeted to create by external party(Zapier) which is triggered by Facebook messenger I am cheacking for "Psid" of the sender which is unique to every user. So for ex: If Anna sends series of messages to Flower'em asking for floral arrangments I would like to capture the whole message as a description in a lead record and later process the info in that description box.
So now, I am all good in preventing the duplicate lead creation when same person sends series of messages.Howver I am not able to print or extract the exitsing description the lead created and append the subsequent messages to the lead's description field. I am wondering how do I go about this.
My code so far.
trigger CheckPsidBeforeCreatingNewLead on Lead (before insert) {

    Lead exLead = null;
    String NewMessageDescription;
    
    for(Lead l : Trigger.new){
        for(Lead l1 : [select ATMTApp_Test1__SenderPsid__c from Lead]){
            if(l.ATMTApp_Test1__SenderPsid__c == l1.ATMTApp_Test1__SenderPsid__c){
                l.addError('This is a duplicate Lead');
                exLead =l1;
                NewMessageDescription = l.Description;
            }
                                    
        }
        if(exLead!=null){
        System.debug(exLead);
    String ExistingLeadId = (String) exLead.get('id');
        System.debug(ExistingLeadId);
        
      String ExistingDescription =[Select Description from Lead where id = '+ ExistingLeadId +'].Description;
        System.debug(ExistingDescription);
        
        
    }
         
    //exLead.set(Description) = exLead.get(Description) +'---------New Message Recevied' +  NewMessageDescription ;
        
}
}
Any help is much appreciated.
Many thanks,
Smita V.H
Hi Community,
 
I am working on a requirement where in I don't want Case assignment rule to run which is changing the case owner.The condition being if there is a value in a particular field (Old case number field which means this case is actually getting unarchived). This is basically a scenario of unarchiving(using ob archiver tool ) where in, upon unarchiving we are loosing original case owner as case assignment rules are running again.
 
Any ideas on how to implement this?
 
My ultimate intention is to preserve case owner. Have the same owner assigned to case as it was before archiving.
 
I read a post which says implement this in future method. I would prefer any non code/low code ways to do this.
https://salesforce.stackexchange.com/questions/186702/turn-off-case-assignment-rules
 
Would a after insert trigger help?
 
Thanks in advance,
Smita
Hi Community,

I am looking to figure out how do I get a list of all the email messages for the all oppotunities of particualr record type?
Any thoughts are much appreciated.

Many thanks,
Smita 
Hi Community,

I have inherited an aura component that basically prints a list of records dispalyed right down below for the community users to print.
This was written back in 2017 and no body has seen it working.
I played around a bit and observed that The URL for salesforce community being used under Lightning experience Transition Assistant--> Feature Settings--> All Sites is changed to following
New URL
https://community.ausure.com.au
The URL being used in Controller.Js is 
"url": "http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId

I am not sure how to construct a correct URL so that it prints all the records of CPD Register Points for a community user properly on clicking the button. 

My Controller Code.
({
    openCPDPointsList : function(component, event) {
    var urlEvent = $A.get("e.force:navigateToURL");
    var recordId = component.get("v.recordId");    
        urlEvent.setParams({
            url:"http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId           
        });
    urlEvent.fire();
    },
})

Tried constructing URL Like
 url": "https://community.ausure.com.au/s/my-cpd-register?recordId="+recordId
But this brings me back to the same page instead of taking me to printable view.

User-added image
Hi Devs,

So i have inherited code which should create reneweal oppotunites based on policies which is not creating reneweal opportuites for some polices and I need to work out why. I am stumped at the moment about how to and where to strat. I would like to start by executing the code in Anon block and was wondering I can get help with the synatx? Here is the class any thoughts are appreciated.

global class CreatePolicyToOppBatch implements Database.Batchable<sObject>, Database.Stateful, database.allowscallouts,schedulable {
    global Map<String, Decimal> insuranceMap = new Map<String, Decimal>();
    global Map<String, Policy_Opportunity_Field_Map__mdt> fieldMap = new Map<String, Policy_Opportunity_Field_Map__mdt>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
        String query = 'Select Id, Class_of_Business__c, Insurance_Start_Date__c, Account__c, Insurance_End_Date__c,Account_RecordType__c, Account__r.OwnerId';
        for(Policy_Class_of_Insurance__mdt  pm : [SELECT Id, Label, QualifiedApiName, Value__c FROM Policy_Class_of_Insurance__mdt]){
            insuranceMap.put(pm.Label, pm.Value__c);
        }
        sObject sObj = Schema.getGlobalDescribe().get('Policies__c').newSObject() ;
        Map<String, Schema.SObjectField> poFieldMapping = sObj.getSObjectType().getDescribe().fields.getMap();
        sObject opp = Schema.getGlobalDescribe().get('Opportunity').newSObject() ;
        Map<String, Schema.SObjectField> opFieldMapping = opp.getSObjectType().getDescribe().fields.getMap();
        
        for(Policy_Opportunity_Field_Map__mdt  po : [SELECT Id, Label,Policy_Field_Api__c ,Default_Value_AUS__c, Default_Value_NZ__c,Use_Default_If_Null__c,Default_Value__c  FROM Policy_Opportunity_Field_Map__mdt]){
            if(poFieldMapping.containsKey(po.Policy_Field_Api__c) && po.Policy_Field_Api__c <> null ){
                if( !'Insurance_End_Date__c'.equals(po.Policy_Field_Api__c) && !'Class_of_Business__c'.equals(po.Policy_Field_Api__c) && !'Insurance_Start_Date__c'.equals(po.Policy_Field_Api__c) && !'Account__c'.equals(po.Policy_Field_Api__c) && !'Account_RecordType__c'.equals(po.Policy_Field_Api__c))   {
                    query= query + ', ' + po.Policy_Field_Api__c;
                }
            }
            if(opFieldMapping.containsKey(po.Label)) {
                fieldMap.put(po.Label,po);
            }
        }
        query = query+' FROM Policies__c WHERE Policy_Status__c != \'Expired\' AND Policy_Status__c != \'Cancelled\' '; 
        System.debug(query);
        return Database.getQueryLocator(query);
    }
    global void execute(SchedulableContext ctx){
        CreatePolicyToOppBatch poBatch  = new CreatePolicyToOppBatch();
        Database.executeBatch(poBatch,50);            
    }    
    global void execute(Database.BatchableContext bc, List<sObject> scope){
        System.debug('ecute>>'+ scope);
        List<sObject> policyListToUpdate = new List<sObject>();
        List<sObject> oppList = new List<sObject>();
        Date policyStartDate;
        for(sObject obj : scope){ 
            if(obj.get('Insurance_Start_Date__c') <> null){
                policyStartDate = Date.valueOf(obj.get('Insurance_Start_Date__c'));
                System.debug('insuranceMap >>'+insuranceMap);
                System.debug('Class_of_Business__c>>'+obj.get('Class_of_Business__c'));
                Integer noofday =Integer.valueOf(insuranceMap.get(String.valueOf(obj.get('Class_of_Business__c'))));
                System.debug(noofday);
                System.debug(policyStartDate.daysBetween(system.today()));
                if(policyStartDate.daysBetween(system.today()) == noofday ){
                    sObject opp = Schema.getGlobalDescribe().get('Opportunity').newSObject() ;
                    Map<String, Schema.SObjectField> fieldMapping = opp.getSObjectType().getDescribe().fields.getMap();
                    for(String fieldval : fieldMap.keySet()){
                        if(getValue(fieldMap,fieldval,obj) <> null ){
                            if(Schema.DisplayType.DATE == fieldMapping.get(fieldval).getDescribe().getType()){
                                Date d = Date.ValueOf(getValue(fieldMap,fieldval,obj));
                                if('Insurance_End_Date__c'.equals(fieldMap.get(fieldval).Policy_Field_Api__c) && ('Renewal_Date__c'.equals(fieldval) || 'CloseDate'.equals(fieldval))){
                                   d = d.addDays(1);
                                }
                                opp.put(fieldval, d );
                            }
                            else if(Schema.DisplayType.DATETIME ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, DateTime.ValueOf(getValue(fieldMap,fieldval,obj)) );   
                            }
                            else if(Schema.DisplayType.CURRENCY == fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Decimal.ValueOf(String.valueOf(getValue(fieldMap,fieldval,obj)) )); 
                            }
                            else if(Schema.DisplayType.BOOLEAN ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Boolean.ValueOf(getValue(fieldMap,fieldval,obj))); 
                            }
                            else if(Schema.DisplayType.DOUBLE ==  fieldMapping.get(fieldval).getDescribe().getType()){
                                opp.put(fieldval, Double.ValueOf(String.valueOf(getValue(fieldMap,fieldval,obj)) )); 
                            }
                            else{
                                opp.put(fieldval, String.valueOf(getValue(fieldMap,fieldval,obj))); 
                            }
                        }
                    }
                    opp.put('AccountId',String.valueOf(obj.get('Account__c') ));
                    if(obj.getSObject('Account__r') <> null && obj.getSObject('Account__r').get('OwnerId') <> null){
                        opp.put('OwnerId',String.valueOf(obj.getSObject('Account__r').get('OwnerId')));
                    }
                    
                    oppList.add(opp);
                    System.debug(opp);
                }
                if(Date.valueOf(obj.get('Insurance_End_Date__c')) == System.today()){
                    obj.put('Policy_Status__c', 'Expired ');
                    policyListToUpdate.add(obj);
                } 
            }
        }
        if(!oppList.isEmpty()){
            insert oppList;
        }
        if(!policyListToUpdate.isEmpty()){
            update policyListToUpdate;
        }
    }    
    global void finish(Database.BatchableContext bc){
        
    }
    public Static Object getValue(Map<String, Policy_Opportunity_Field_Map__mdt> fieldMap,String fieldval, sObject obj){
        
        if(fieldMap.get(fieldval).Policy_Field_Api__c <> null && obj.get(fieldMap.get(fieldval).Policy_Field_Api__c) <> null){
            return obj.get(fieldMap.get(fieldval).Policy_Field_Api__c);
            
        }
        else if(fieldMap.get(fieldval).Use_Default_If_Null__c == true ) {
            if('New_Zealand_Account'.equals(String.valueOf(obj.get('Account_RecordType__c')))){
                return fieldMap.get(fieldval).Default_Value_NZ__c; 
            }
            else if('Australian_Account'.equals(String.valueOf(obj.get('Account_RecordType__c')))){
                return fieldMap.get(fieldval).Default_Value_AUS__c; 
            }
            else{
                return fieldMap.get(fieldval).Default_Value__c; 
            }
        }
        return null;
    }  
    global static string scheduleJob(){
        CreatePolicyToOppBatch job  = new CreatePolicyToOppBatch();
        
        String CRON_EXPR =  '0 0 5 * * ?' ; //every day 5 am
        System.Schedule('CreatePolicyToOppBatch Job',CRON_EXPR,job);
        return null;
    }    
}
 
Hi Community, 
Really need help in getting this over the line.
I have a long text area like this 
Policy Type: Accidental Damage (SCTP), Policy Start Date: 27/03/2022, Acceptance Criteria: All default to No, Insured Name: Account Name, Date of Birth of Oldest Insured: Date of birth of primary contact, Existing Policy With Selected Insurers: No (SCTP)

I Need to dispaly it like this using flow
Policy Type: Accidental Damage (SCTP)
Policy Start Date: 27/03/2022
Acceptance Criteria: All default to No and so on.. 

Can any one guide me how to loop through long text area and introduce new line after each comma using flow?
 
Hey Everyone,
 Moving from administration to coding here.Your understanding is much apprecaited. :)
So the scenario I am trying to handle with apex is When portential "lead " record will attempeted to create by external party(Zapier) which is triggered by Facebook messenger I am cheacking for "Psid" of the sender which is unique to every user. So for ex: If Anna sends series of messages to Flower'em asking for floral arrangments I would like to capture the whole message as a description in a lead record and later process the info in that description box.
So now, I am all good in preventing the duplicate lead creation when same person sends series of messages.Howver I am not able to print or extract the exitsing description the lead created and append the subsequent messages to the lead's description field. I am wondering how do I go about this.
My code so far.
trigger CheckPsidBeforeCreatingNewLead on Lead (before insert) {

    Lead exLead = null;
    String NewMessageDescription;
    
    for(Lead l : Trigger.new){
        for(Lead l1 : [select ATMTApp_Test1__SenderPsid__c from Lead]){
            if(l.ATMTApp_Test1__SenderPsid__c == l1.ATMTApp_Test1__SenderPsid__c){
                l.addError('This is a duplicate Lead');
                exLead =l1;
                NewMessageDescription = l.Description;
            }
                                    
        }
        if(exLead!=null){
        System.debug(exLead);
    String ExistingLeadId = (String) exLead.get('id');
        System.debug(ExistingLeadId);
        
      String ExistingDescription =[Select Description from Lead where id = '+ ExistingLeadId +'].Description;
        System.debug(ExistingDescription);
        
        
    }
         
    //exLead.set(Description) = exLead.get(Description) +'---------New Message Recevied' +  NewMessageDescription ;
        
}
}
Any help is much appreciated.
Many thanks,
Smita V.H
Working on Windows 10.  

I've installed Zulu 11.  Proof:

User-added image

I've installed Dataloader 45.0.0

I open Data Loader using the shortcut created during installation.

This screen flashes for a second then disappears:

User-added image

And then nothing happens... no Data Loader.

I've tried reinstalling and restarting but that doesn't help.

Any ideas?
For life of me I can't figure out what this exercise is asking to do.  I was able to modify other reports but this particualr R&D report, Temperature to kWh Research, I'm not able to do.  Error is keep saying, "We can’t find the additional analysis by model being performed on the 'Temperature to kWh Research' report. Remember that you can organize data horizontally and vertically at the same time."

User-added image


 
I'm having trouble validating challenge 2, with regard to Shinje Tashi's user settings.
ERROR: 
Challenge Not yet complete... here's what's wrong: 
Shinje Tashi does not have the user settings he needs.

The instructions say: "This sales data quality specialist supports the entire company and needs to be assigned a role that can see and access all account, contact, and opportunity records for the entire company. Use the Standard User profile."

First off, it seems odd not to handle this through a separate profile, but I'm trying to follow the directions. So...

I created Shinje as an active user, User License: Salesforce, Profile: Standard User. There isn't a role specified for him, and the instructions suggest providing access to all acct, contact and oppty records through a role assignment, so I created a Sales Data Admin role, reporting to the CEO. That role should provide RECORD access. Additionally, for OBJECT access, I created a permission set granting full access (CRED, View All, Modify All) to Acct, Contact, and Oppty objects and assigned it to Shinje. I created a separate permission set granting access to the Language preference field on Acct, named that permission set "Bilingual Pilot" as instructed, and assigned it to Shinje.

I'm not sure what I'm missing...

 
Hi,

i am getting below error while completing "Lightning Experience Rollout Specialist Superbadge Step #8"
Challenge Not yet complete... here's what's wrong:
Knowledge must be enabled for the org.
.User-added image


i have alredy enabled knowledge settings..

User-added image

Thank you.
Hello,

I am currently running in to an issue on Step 6 of the Lightning Experience Rollout Specialist Superbadge.

When I click check challenge, this is the error I get:
Challenge Not yet complete... here's what's wrong: 
The All Lusso Scarpe Employee group page must display the following information on the right side of the page: recommended groups and individuals to follow, and the most popular topics currently under discussion.

Here is a screenshot of my page:
User-added image

Can anyone help me understand what I am doing wrong?

Thank you!
I am getting this error when trying to do the "Lightning Experience Rollout Specialist"

The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.


My code is as follows:
 
<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyHtmlTag="false" applyBodyTag="false" showHeader="false">
   <head>
       <apex:slds />
    </head> 
	<body>
    <div class="slds-scope">     
        <table class="slds-table">
  			<thead>
    			<tr class="slds-text-title_caps">
      				<th scope="col">
        				<div class="slds-truncate" title="{!$ObjectType.Account.Fields.Name.Label}">{!$ObjectType.Account.Fields.Name.Label}</div>
      				</th>
    			</tr>
  			</thead>
  			<tbody>
    			<apex:repeat value="{!accounts}" var="a">
                <tr>
                  <td data-label="Account Name">
                    <div class="slds-truncate" ><apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink></div>
                  </td>
      
    			</tr>
                </apex:repeat>
            </tbody>
        </table>
     <!--   
     <div class="slds-scope">
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accounts}" var="a" styleClass="slds">
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>-->
    </div>
        </body>
</apex:page>

 
I'm struggling with the custom lightning component on this part. I don't have much background coding and am having trouble finding resources to help me achieve coding the lightning component. If someone could help give me some framework code to create a custom lightning component to hold a URL or direct me to a resource that help break this down I'd be very appreciative.
 
I keep getting an error on Item #4 "The custom set of fields that are highlighted on account records must be assigned to the required profile."

The requirement is asking for having highlights based on profiles, but as we know compact layouts are applied to the whole system not by profile.

I am not sure how to fix this, any help is appreciated.
Hi all,
quite easy question about Database.query method. I'm learning SF with trailhead.salesforce.com and I'm getting pretty strange error here. I'm using developer edition of SF so should be not problems with some code limits or restrictions here I hope.

https://trailhead.salesforce.com/trails/force_com_dev_beginner/modules/visualforce_fundamentals/units/visualforce_custom_controllers
 
public class ContactsListController {

    private String sortOrder = 'LastName';
    
    public List<Contact> getContacts() {
        
        List<Contact> results = Database.query(
            'SELECT Id, FirstName, LastName, Title, Email ' +
            'FROM Contact ' +
            'ORDER BY ' + sortOrder + ' ASC ' +
            'LIMIT 10'
        );
        return results;
    }

}

Error: Method does not exist or incorrect signature: void query(String) from the type Database

User-added image
Hello community

I'm struggling with a small error which I can't seem to find an answer to. Can you help?

[{"message":"bad value for restricted picklist field: Bristol","errorCode":"INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST","fields":["RM_Region__c"]}]

There are scores of picklist values within "RM_Region__c". For some reason, "Bristol" is being rejected.

The closest I can get to a possible answer is that "Bristol" needs to be allocated somewhere for it to work?

I'd really appreciate any ideas the community have.

Many thanks and look forward to hearing from you.
I'm trying to build a formula that if the Checkbox Formula_C is true then the Price is substrated from seller concessions and if the box is FAlse, then it just puts the price. I'm doing this but get error messages about extra , or parenthesis. Does anyone know how I can fix it? 

IF(  Formula__c  , 'True')  (Price__c -  Seller_Concessions__c )
IF(  Formula__c  , 'False') Price__c, 0
I want to use access codes for specific events. I have a custom object called "Event Codes" with only one primary field which represents access code itself (text symbols only with length < 16, each code is unique). I manually add up new codes to an object. Some contacts and leads have text field with access code and it's one of the values of a custom object mentioned above. I use an integration with 3rd party, so that some contacts and leads have this field populated automatically with access code (text representation).

How can I relate contact / lead with my custom object based on access code? How can I relate already existing records?

I believe "Event codes" object should be a master while lead / contact are children. But I can't create master detail relationship at contact / lead object (have no such option).

I am following the guidelines from the Chatter guide and somehow I can't get the OAuth to work. 

 

It's not working from Java or curl.   Here is what I am doing:

 

mike$ curl --form client_id=3MVG9yZ.WNe6bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu5AjB4oT9kxi8SEhY --form client_secret=26542xxxxxxxxxxx78  --form grant_type=password --form username=xxxxxxxx@gmail.com --form password=xxxxxxx https://na11.salesforce.com/services/oauth2/token

 

What I am getting is:

{"error":"invalid_grant","error_description":"authentication failure - Invalid Password"}

 

I double checked and I am getting into na11 with the right password.  Is there anything else I need to do?

 

Here are the settings in my remote access:

 



Applicationchatter



Callback URLhttps://na11.salesforce.com/ConnectTest/oauth/_callback /// temp one



No user approval required for users in this organizationNot Checked

 


I am getting this error when trying to do the "Lightning Experience Rollout Specialist"

The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.


My code is as follows:
 
<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyHtmlTag="false" applyBodyTag="false" showHeader="false">
   <head>
       <apex:slds />
    </head> 
	<body>
    <div class="slds-scope">     
        <table class="slds-table">
  			<thead>
    			<tr class="slds-text-title_caps">
      				<th scope="col">
        				<div class="slds-truncate" title="{!$ObjectType.Account.Fields.Name.Label}">{!$ObjectType.Account.Fields.Name.Label}</div>
      				</th>
    			</tr>
  			</thead>
  			<tbody>
    			<apex:repeat value="{!accounts}" var="a">
                <tr>
                  <td data-label="Account Name">
                    <div class="slds-truncate" ><apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink></div>
                  </td>
      
    			</tr>
                </apex:repeat>
            </tbody>
        </table>
     <!--   
     <div class="slds-scope">
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accounts}" var="a" styleClass="slds">
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>-->
    </div>
        </body>
</apex:page>