• Ramk123
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 17
    Replies
Dear Experts,

We have a requirement to generate different numbering formats for Community Self-Registration user-related Contact Records than other person accounts in the system.

I created a Process builder with the following conditions but it is not recognizing the Community Self-Registration user-related Contact upon creating a contact created.

1. Account only when a record is created
2. IsPersonAccount = True and IsCustomerPortal = True
3. Immediate Action to update [Account].Textfield__C = "Self" & "-" &  [Account].Autonumber_field__c 

Please suggest the approach to make the unique numbering format for self-registered related user contacts.

Thank you very much for your help!
We have a requirement to generate different numbering formats for Community Self-Registration Contact Records than other person accounts in the system.

I created a Process builder with the following conditions but it is not providing a new numbering format.

1. Account only when a record is created
2. IsPersonAccount = True and IsCustomerPortal = True
3. Immediate Action to update [Account].Textfield__C = "Self" & "-" &  [Account].Autonumber_field__c 

Please suggest the approach to make the unique numbering format for self-registered contacts.

Thank you very much!
I have an interesting requirement to be able to export a list of records and print it one per page.

Kindly provide logic to meet the business need.
Dear Experts,

May I request you to help with increasing code coverage for the following highlighted missing code coverage? Appreciate your quick help.
Apex Class
public class ApexUtility {
    
    public static Boolean isCommunity() {
        if(Site.getSiteId() != null)
            return true;
        return false;
    }

    public static final String PUBLIC_USERNAME = 'Community Site Guest User';
    static User publicUser;
    public static Boolean isLoggedInUser() {
        if(publicUser == null){
            publicUser = [SELECT Id FROM User WHERE Name = :PUBLIC_USERNAME LIMIT 1];
        }
        if(publicUser != null){
            if(UserInfo.getUserId() != publicUser.Id)
                return true;
        }    
        return false;
    }
    
    public static PageReference redirectToVipForm(String recordId) {
        String returnUrl = '/apex/FormWizard?id=' + recordId;
    
        if(isCommunity()){
             returnUrl = '/mcr' + returnUrl;
        }
           
        PageReference p = new PageReference(returnUrl);
        p.setRedirect(true);
        return p;  
    }
    
}

Test Class
 
@isTest
public class btn_EnableCustomerCommunityUser_ExtTest {

    @isTest
    static void testCreateCustomerUser() {
        Account testAccount = TestDataFactory.getPersonAccount();
        insert testAccount;
        
        Test.startTest();
        ApexPages.StandardController stdController = new ApexPages.StandardController(testAccount);
        btn_EnableCustomerCommunityUser_Ext ext = new btn_EnableCustomerCommunityUser_Ext(stdController);
        
        PageReference pr = ext.CreateCustomerCommunityUser();
        Test.stopTest();
        
        testAccount = [SELECT Id, Community_User__c FROM Account WHERE Id = :testAccount.Id LIMIT 1];
        
        System.assertEquals(true, testAccount.Community_User__c);
    }

}

 
Dear Experts,

I would like to switch community with the apex logic.

SELECT GuestUserId, Name, Subdomain, UrlPathPrefix FROM Site 'abc'

If UrlPathPrefix is abc
returnurl = '/abc' + returnurl
else if UrlPathPrefix  is xyz
returnurl = '/xyz' + returnurl

anyone please help me to frame the logic to return proper community URL.
Dear Experts,

In my community, I have one Custom Lightning component and Rich Text Editor, but I would like to Restrict the lightning component visibility to the Guest Users. When I apply "Assign Audience" it is applicable to both the "Custom lightning Component" and "Rich Text Editor". Kindly advice.
Dear Integration Experts,

I have a Requirement to Integrate between Teradata to Salesforce to pull simple Data From Teradata to Salesforce. Could any able to suggest simple options with lowcost and easy maintenance?

Thank you very much for understanding!
Dear Mobile App experts,

One of my customers would like to build a mobile App with React Native, What would be the pros and cons for the following options.
  • Option1: Can we build Mobile App in Salesforce with React Native Technology?
  • Option 2: Build React Native Mobile App outside salesforce and Integrate with Salesforce? 
  • What are the other best options to build a Mobile App?
Appreciate your valuable suggestions!
I have Review(Multi-Select Picklist) field with values following.
101(Previous grant)
101(No Expectation)
101(Sufficient Income)
101(Long Term)

Based on the above values selected update Review Log (Long Text Area) field.
I tried like below, but am getting an error message like "Error  Field Review__c may not be used in this type of formula "

IF(INCLUDES( Review__c, "101(Not Unforeseen)"), "$Label.X101_Not_Unforeseen", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Previous grant)"), "$Label.Previous_grant", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(No Expectation)"), "$Label.No_Expectation", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Sufficient Income)"), "$Label.X101_Sufficient_Income", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Long Term)"), "$Label.X101_Long_Term", NULL )
  
Note: Long Text referring from Label

Appreciate quick help on this!
 
Please help to write a test class for below part apex logic 

   private void populateRequesterInfo() {
        if(CommonUtil.isNotBlank(this.caseObj.isApplicantPA__c) && 'No'.equalsIgnoreCase(this.caseObj.isApplicantPA__c)) {
            this.contactObj.FirstName = trimLongText(this.caseObj.Requester_First_Name__c, 40);
            this.contactObj.LastName = this.caseObj.Requester_Last_Name__c;
            this.contactObj.Phone = this.caseObj.Requester_Home_Phone__c;
            this.contactObj.MobilePhone = this.caseObj.Requester_Cell_Phone__c;
            this.contactObj.MailingStreet = buildMailingStreet(this.caseObj.Requester_Mail_to_Address__c, this.caseObj.Requester_Apt__c);
            this.contactObj.Apt__c = this.caseObj.Requester_Apt__c;
            this.contactObj.MailingCity = this.caseObj.Requester_Mail_to_City__c;
            this.contactObj.MailingState = this.caseObj.Requester_Mail_to_State__c;
            this.contactObj.MailingPostalCode = null != this.caseObj.Requester_Mail_to_Zip_Postal_Code__c ?  String.valueOf(this.caseObj.Requester_Mail_to_Zip_Postal_Code__c) : '';
            this.contactObj.Email = this.caseObj.Requester_Email__c;
            this.contactObj.Region__c = this.caseObj.Requester_Region__c;
            this.contactObj.County__c = this.caseObj.Requester_County_of_Residence__c;
Requesting help on the below requirement.
I have 3 Picklist fields on the page.
  • Field 1 -- Values A, B C, D
  • Field 2 -- Values A, B, C, D
  • Field 3 --  Values A, B, C, D
Capture latest field value from above fields and always update "Field 4" with the latest Value.

Thank a lot in advance.

 
How to populate logitude and latitude on custome object using Google API.
Any one please help on this? Thank you!
I would like to auto-populate slashes(/) in the date field, am unable achieve with below code.
Example:
Option 1: when user move cursor into date field Slashes(/) should be constant like __/__/____(MM/DD/YYYY)
Option 2: validate user date format: User should enter Date with Slashes and specified format(MM/DD/YYY) else field should throw an error with invalid date format.
Lighting Component
<ui:inputDate aura:id="Birthdate" label="Date Of Birth" 
                                                  value="{!v.value}" 
                                                  displayDatePicker="false" blur="{!c.formatDoB}"
                                                  format="MM/dd/yyyy" />
JS Controller
formatDOB: function(component, helper, event) {
        var DOB = component.find("Birthdate");
        var Date = DoB.get('v.value');
        var s = (""+Date).replace(/\D/g, '');
        var m = s.match(/^(\d{2})(\d{2})(\d{4})$/);
        var formattedDoB = (!m) ? null : + m[1] + "/" + m[2] + "/" + m[3];
        DoB.set('v.value',formattedDoB);
    },

any one please help?
Thanks
I have a requirement to automate SSN structure.
example:
user input SSN: 123456789
automate output SSN format: 123-45-6789
with my below logic am not able to achieve the scenario, anyone please help.
Component:
<lightning:input aura:id="SSN__c" name="SSN" 
           label="SSN" 
           maxlength="9" onblur="{!c.formatSSN}"                                          
           value="{!v.newCallerModel.Ssn}" />  
JS Controller 
formatSSN: function(component, helper, event)  {   
     var patt = new RegExp("\d{3}[\-]\d{2}[\-]\d{4}");
     var x = document.getElementById("SSN__c");
     var res = patt.test(x.value);
        if(!res){
            x.value = x.value
            .match(/\d*/g).join('')
            .match(/(\d{0,3})(\d{0,2})(\d{0,4})/).slice(1).join('-')
            .replace(/-*$/g, '');
        }
    },  
Hi,

I have created below formula field to calculate total efforts and calcuating as expected, but while deployement am getting below error.

Formual field: 
TEXT(ROUND(
if ( And( TEXT(Status) <> "Completed", TEXT(Status) <> "On Hold",
ISBLANK(Task_Completion_Date__c), ISBLANK(On_Hold_Date__c )), NOW() - CreatedDate,

if( TEXT(Status) = "On Hold", On_Hold_Date__c - CreatedDate,

if( TEXT(Status) = "Completed", Task_Completion_Date__c - CreatedDate - (Not_On_Hold_Date__c - On_Hold_Date__c),

NOW() - CreatedDate - (Not_On_Hold_Date__c - On_Hold_Date__c))))*24, 2))&" "&"hours"

Deployment Error  : Incorrect parameter type for operator '-'. Expected Number, Date, received DateTime

Appreciate your help at the earliest.

Thanks,
Ramesba
Task completion email notification to task creator and Should not generate a notification to yourself when you complete the task.

trigger Taskcompletednotification on Task (after update) {
   List<Messaging.SingleEmailMessage> mails= new List<Messaging.SingleEmailMessage>(); 
   Map<Id,Id> userTaskIds = new Map<Id,Id>();
   EmailTemplate Template =  [SELECT Id,Name FROM EmailTemplate WHERE Name='Task creator email notification'];
   for(Task tsk : Trigger.New)
   {
        if(tsk.Status == 'Completed'&& tsk.OwnerId != tsk.CreatedById)
        {
           userTaskIds.put(tsk.CreatedById,tsk.Id);
        } 
   }
   
   for(User targetId : [SELECT id,Email From User where Id IN :userTaskIds.keySet()])
   {
         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
         email.setSaveAsActivity(false);
         email.setTargetObjectId(targetId.Id); 
         email.setTemplateId(Template.Id);  
         email.setWhatId(userTaskIds.get(targetId.id));
         mails.add(email);
   }
 
   if(mails.size() > 0)
   {  
      try
      {
         System.debug('Control Came Here');
         Messaging.sendEmail(mails);
      }catch(Exception e)
      {
         System.debug('Error Message :'+e);
      }  
   }                
         
}

Test Class
========
@isTest
public class Taskcompletednotificationtest{

@isTest
public static void taskUpdateTest()
{
    Task tsk = new Task(); 
    tsk.subject='test';
    tsk.ActivityDate=Date.Today();
    tsk.Status='Not Started';
    tsk.Priority='Normal';
    tsk.OwnerId='00524000003MWO2';
    tsk.CreatedById='00524000003MWO2';
    insert tsk;
    
    Task task = [SELECT status FROM Task WHERE id=:tsk.id];
    task.status = 'Completed';
    update task;
}

}
Dear Experts,

May I request you to help with increasing code coverage for the following highlighted missing code coverage? Appreciate your quick help.
Apex Class
public class ApexUtility {
    
    public static Boolean isCommunity() {
        if(Site.getSiteId() != null)
            return true;
        return false;
    }

    public static final String PUBLIC_USERNAME = 'Community Site Guest User';
    static User publicUser;
    public static Boolean isLoggedInUser() {
        if(publicUser == null){
            publicUser = [SELECT Id FROM User WHERE Name = :PUBLIC_USERNAME LIMIT 1];
        }
        if(publicUser != null){
            if(UserInfo.getUserId() != publicUser.Id)
                return true;
        }    
        return false;
    }
    
    public static PageReference redirectToVipForm(String recordId) {
        String returnUrl = '/apex/FormWizard?id=' + recordId;
    
        if(isCommunity()){
             returnUrl = '/mcr' + returnUrl;
        }
           
        PageReference p = new PageReference(returnUrl);
        p.setRedirect(true);
        return p;  
    }
    
}

Test Class
 
@isTest
public class btn_EnableCustomerCommunityUser_ExtTest {

    @isTest
    static void testCreateCustomerUser() {
        Account testAccount = TestDataFactory.getPersonAccount();
        insert testAccount;
        
        Test.startTest();
        ApexPages.StandardController stdController = new ApexPages.StandardController(testAccount);
        btn_EnableCustomerCommunityUser_Ext ext = new btn_EnableCustomerCommunityUser_Ext(stdController);
        
        PageReference pr = ext.CreateCustomerCommunityUser();
        Test.stopTest();
        
        testAccount = [SELECT Id, Community_User__c FROM Account WHERE Id = :testAccount.Id LIMIT 1];
        
        System.assertEquals(true, testAccount.Community_User__c);
    }

}

 
Dear Experts,

In my community, I have one Custom Lightning component and Rich Text Editor, but I would like to Restrict the lightning component visibility to the Guest Users. When I apply "Assign Audience" it is applicable to both the "Custom lightning Component" and "Rich Text Editor". Kindly advice.
Dear Integration Experts,

I have a Requirement to Integrate between Teradata to Salesforce to pull simple Data From Teradata to Salesforce. Could any able to suggest simple options with lowcost and easy maintenance?

Thank you very much for understanding!
Dear Mobile App experts,

One of my customers would like to build a mobile App with React Native, What would be the pros and cons for the following options.
  • Option1: Can we build Mobile App in Salesforce with React Native Technology?
  • Option 2: Build React Native Mobile App outside salesforce and Integrate with Salesforce? 
  • What are the other best options to build a Mobile App?
Appreciate your valuable suggestions!
I have Review(Multi-Select Picklist) field with values following.
101(Previous grant)
101(No Expectation)
101(Sufficient Income)
101(Long Term)

Based on the above values selected update Review Log (Long Text Area) field.
I tried like below, but am getting an error message like "Error  Field Review__c may not be used in this type of formula "

IF(INCLUDES( Review__c, "101(Not Unforeseen)"), "$Label.X101_Not_Unforeseen", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Previous grant)"), "$Label.Previous_grant", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(No Expectation)"), "$Label.No_Expectation", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Sufficient Income)"), "$Label.X101_Sufficient_Income", NULL ) + BR() +
IF(INCLUDES( Review__c, "101(Long Term)"), "$Label.X101_Long_Term", NULL )
  
Note: Long Text referring from Label

Appreciate quick help on this!
 
Please help to write a test class for below part apex logic 

   private void populateRequesterInfo() {
        if(CommonUtil.isNotBlank(this.caseObj.isApplicantPA__c) && 'No'.equalsIgnoreCase(this.caseObj.isApplicantPA__c)) {
            this.contactObj.FirstName = trimLongText(this.caseObj.Requester_First_Name__c, 40);
            this.contactObj.LastName = this.caseObj.Requester_Last_Name__c;
            this.contactObj.Phone = this.caseObj.Requester_Home_Phone__c;
            this.contactObj.MobilePhone = this.caseObj.Requester_Cell_Phone__c;
            this.contactObj.MailingStreet = buildMailingStreet(this.caseObj.Requester_Mail_to_Address__c, this.caseObj.Requester_Apt__c);
            this.contactObj.Apt__c = this.caseObj.Requester_Apt__c;
            this.contactObj.MailingCity = this.caseObj.Requester_Mail_to_City__c;
            this.contactObj.MailingState = this.caseObj.Requester_Mail_to_State__c;
            this.contactObj.MailingPostalCode = null != this.caseObj.Requester_Mail_to_Zip_Postal_Code__c ?  String.valueOf(this.caseObj.Requester_Mail_to_Zip_Postal_Code__c) : '';
            this.contactObj.Email = this.caseObj.Requester_Email__c;
            this.contactObj.Region__c = this.caseObj.Requester_Region__c;
            this.contactObj.County__c = this.caseObj.Requester_County_of_Residence__c;
Requesting help on the below requirement.
I have 3 Picklist fields on the page.
  • Field 1 -- Values A, B C, D
  • Field 2 -- Values A, B, C, D
  • Field 3 --  Values A, B, C, D
Capture latest field value from above fields and always update "Field 4" with the latest Value.

Thank a lot in advance.

 
How to populate logitude and latitude on custome object using Google API.
Any one please help on this? Thank you!
Hi
i m a new admin and a maybe stupid question . 
2 teams in my company (sales and support ) 
I need to create 2  differents opportunity path . Sales must be able to view (not edit) the support's opportunity and vice versa . 

is it possible ? how ? 
I have a requirement to automate SSN structure.
example:
user input SSN: 123456789
automate output SSN format: 123-45-6789
with my below logic am not able to achieve the scenario, anyone please help.
Component:
<lightning:input aura:id="SSN__c" name="SSN" 
           label="SSN" 
           maxlength="9" onblur="{!c.formatSSN}"                                          
           value="{!v.newCallerModel.Ssn}" />  
JS Controller 
formatSSN: function(component, helper, event)  {   
     var patt = new RegExp("\d{3}[\-]\d{2}[\-]\d{4}");
     var x = document.getElementById("SSN__c");
     var res = patt.test(x.value);
        if(!res){
            x.value = x.value
            .match(/\d*/g).join('')
            .match(/(\d{0,3})(\d{0,2})(\d{0,4})/).slice(1).join('-')
            .replace(/-*$/g, '');
        }
    },  
Hi,

I have created below formula field to calculate total efforts and calcuating as expected, but while deployement am getting below error.

Formual field: 
TEXT(ROUND(
if ( And( TEXT(Status) <> "Completed", TEXT(Status) <> "On Hold",
ISBLANK(Task_Completion_Date__c), ISBLANK(On_Hold_Date__c )), NOW() - CreatedDate,

if( TEXT(Status) = "On Hold", On_Hold_Date__c - CreatedDate,

if( TEXT(Status) = "Completed", Task_Completion_Date__c - CreatedDate - (Not_On_Hold_Date__c - On_Hold_Date__c),

NOW() - CreatedDate - (Not_On_Hold_Date__c - On_Hold_Date__c))))*24, 2))&" "&"hours"

Deployment Error  : Incorrect parameter type for operator '-'. Expected Number, Date, received DateTime

Appreciate your help at the earliest.

Thanks,
Ramesba
Task completion email notification to task creator and Should not generate a notification to yourself when you complete the task.

trigger Taskcompletednotification on Task (after update) {
   List<Messaging.SingleEmailMessage> mails= new List<Messaging.SingleEmailMessage>(); 
   Map<Id,Id> userTaskIds = new Map<Id,Id>();
   EmailTemplate Template =  [SELECT Id,Name FROM EmailTemplate WHERE Name='Task creator email notification'];
   for(Task tsk : Trigger.New)
   {
        if(tsk.Status == 'Completed'&& tsk.OwnerId != tsk.CreatedById)
        {
           userTaskIds.put(tsk.CreatedById,tsk.Id);
        } 
   }
   
   for(User targetId : [SELECT id,Email From User where Id IN :userTaskIds.keySet()])
   {
         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
         email.setSaveAsActivity(false);
         email.setTargetObjectId(targetId.Id); 
         email.setTemplateId(Template.Id);  
         email.setWhatId(userTaskIds.get(targetId.id));
         mails.add(email);
   }
 
   if(mails.size() > 0)
   {  
      try
      {
         System.debug('Control Came Here');
         Messaging.sendEmail(mails);
      }catch(Exception e)
      {
         System.debug('Error Message :'+e);
      }  
   }                
         
}

Test Class
========
@isTest
public class Taskcompletednotificationtest{

@isTest
public static void taskUpdateTest()
{
    Task tsk = new Task(); 
    tsk.subject='test';
    tsk.ActivityDate=Date.Today();
    tsk.Status='Not Started';
    tsk.Priority='Normal';
    tsk.OwnerId='00524000003MWO2';
    tsk.CreatedById='00524000003MWO2';
    insert tsk;
    
    Task task = [SELECT status FROM Task WHERE id=:tsk.id];
    task.status = 'Completed';
    update task;
}

}