• Shilpa Kamble
  • NEWBIE
  • 70 Points
  • Member since 2014
  • Project Associate
  • Cognizant

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 15
    Replies
I have added several new VF pages and their controllers to a managed package. When I deploy the managed package, I am unable to change the security to the controllers. Can't grant permission from profiles and no 'Security' link appears next to the classes. They are properly assigned in my packaging org. 

Any thoughts on what's happening? Thanks in advance.
I am trying to delete the report but I am getting following error message.
The report definition is obsolete. Your administrator has disabled all reports for the custom object, or its relationships have changed.
Please guide me, if you know anything about absolete report.

Thanks in advance!
 
For this Do I need to use the tooling api? or without api's can I achiev.
Found one refernce link :http://developer.force.com/cookbook/recipe/automated-unit-test-execution

please suggest me, what is the correct approch.

Thanks in advance!
Hi,

I am trting to use the tooling api, I want to check the result if I call the method from Anonymous window of developer console, I am not getting the response.

Please check the below code.
public class APIHandler{

    public void executeREST(){
        system.debug('In executeREST');
        HttpRequest req = new HttpRequest();
        req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
        req.setHeader('Content-Type', 'application/json');
        req.setEndpoint('http://ap5.lightning.force.com/services/data/v42.0/tooling/sobjects/');
        req.setMethod('GET'); 
        
        Http h = new Http();
        HttpResponse res = h.send(req);
        system.debug('req='+req);
        system.debug('response===='+res.getBody()); 
    }
}
and the code for testing is as below:
APIHandler obj = new APIHandler();
obj.executeREST();
but I am not getting the response, please guide me.

Thanks in advance!

 
I need to add newly added user to some group, I am storing the group id's in custom label(comma separated).
I have created a process builder where in related record id field I am passing custom label.

I don't want to create many users for testing, so before that need to ask that Will it work?

please check the screen shot and let me know.
User-added image

Thanks in advance!
I have written a post install script, where on installation of package the scheduler class will get schedule. but the code is not working
please check the below code and let me know what is wrong in the code.
global class CX_InstallUninstallHandler implements InstallHandler, UninstallHandler {
    //Installation handler
    global void onInstall(InstallContext context) {
        try {
            List < CronTrigger > listCronTriggerAllScheduledJobs = new List < CronTrigger > ([SELECT CronJobDetail.Name FROM CronTrigger
                WHERE CronJobDetail.Name = 'Schedule job to send reminder email'
                limit 1
            ]);
            for (CronTrigger CronTriggerAllScheduledJobs: listCronTriggerAllScheduledJobs) {
                if ((CronTriggerAllScheduledJobs.CronJobDetail.Name).equalsIgnoreCase('Schedule job to send reminder email')) {
                    // Delete the Scheduled Job
                    System.abortJob(CronTriggerAllScheduledJobs.id);
                    break;
                }
            }

            //Schedule New job
            CX_CertificationUpdateReminderScheduler scheduler = new CX_CertificationUpdateReminderScheduler();
            String schExpression = '0 0 0 * * ?';
            system.schedule('Schedule job to send reminder email', schExpression, scheduler);

            List < CronTrigger > Jobs = new List < CronTrigger > ([SELECT CronJobDetail.Name FROM CronTrigger
                WHERE CronJobDetail.Name = 'Schedule job to send reminder email'
                limit 1
            ]);
            

          // ---------------for deugging---------------
            system.debug('Jobs=' + Jobs[0].CronJobDetail.Name);
            string jobDetails = string.valueOf(Jobs[0].CronJobDetail.Name);
            Exception ex;
            SendFailureEmail('Installation', ex, jobDetails);
          //---------------for debugging----------------------
           
        }
        Catch(Exception e) {
            SendFailureEmail('Installation', e, '');
        }
    }
    //Uninstallation handler
    global void onUninstall(UninstallContext context) {
        try {
            //retrive the scheduled jobs and abort it
            List < CronTrigger > listCronTriggerAllScheduledJobs = [SELECT CronJobDetail.Name FROM CronTrigger
                WHERE CronJobDetail.Name = 'Schedule job to send reminder email'
                limit 1
            ];
            for (CronTrigger CronTriggerAllScheduledJobs: listCronTriggerAllScheduledJobs) {
                if ((CronTriggerAllScheduledJobs.CronJobDetail.Name).equalsIgnoreCase('Schedule job to send reminder email')) {
                    // Delete the Scheduled Job
                    System.abortJob(CronTriggerAllScheduledJobs.id);
                    break;
                }
            }
        }
        Catch(Exception e) {
            SendFailureEmail('unInstallation', e, '');
        }
    }
    //Notify CertXchange Team, in case of installation and uninstallation 
    public void SendFailureEmail(String strContex, Exception e, String str) {

        Organization orgDetail = [select Id, IsSandbox, InstanceName, Organizationtype from Organization LIMIT 1];
        String strError;
        strError = e.getMessage();
        List < String > toAddresses = new List < String > ();
        //False Positive 
        //We using the hardcoded Email Id for sending the email alert when the package installtion got failed.
        toAddresses.add('Shilpa.kamble@gmail.com');
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(toAddresses);
        mail.setReplyTo(UserInfo.getUserEmail());
        mail.setTargetObjectId(UserInfo.getUserId());
        mail.setSaveAsActivity(false);
        system.debug('mail=' + mail);
        string orgId = '';
        if (orgDetail != null)
            orgId += orgDetail.Id;
        mail.setSenderDisplayName('My Package Errors');
        if (strContex == 'unInstallation') {
            //  mail.setSubject('Exception while unInstalling package for org: ' + orgId );
            mail.setPlainTextBody('Exception : ' + strError + ' test msg =' + str);
        } else if (strContex == 'Installation') {
            //  mail.setSubject('Post install script fail for org: ' + orgId);
            mail.setPlainTextBody('Exception : ' + strError + ' test msg =' + str);
        }

        Messaging.sendEmail(new Messaging.Email[] {
            mail
        });
    }
  
}

Thanks in advance!
The scheduled job run everyday at 12 am.
String schExp = '0 0 0 * * ?';
Is it correct?
I have to send an reminder email after 2 week to user when the status is updated. I am thinking to use time based workflow. How many email will get send in 1 day? What is the limit of email alert per day?
 
I have added notes and attachments to one of my Account, If I run the below query I am getting notes but not attachements
SELECT Id,name,(SELECT Id, Name FROM Attachments),(SELECT Id, Title FROM Notes) FROM Account
If I run seperate query on attachments, then also I am not getting any attachmants, the result is 0.
SELECT Id, Name FROM Attachment
Does anyone know why the count is getting zero? even though I have attachments in my org.
Hi,

Is it possible to add a Visualforce component or lightning component to the dashboard in lighting experience? if yes, how? if not, any other alternative solution?

Thanks in advance!
How can I get the next alphabetical character in alphabetical sequence?
ex. I have  'A' letter, I want 'B' by using 'A'.
Does anyone know How to search the string with hyphen(-) in dynamic SOSL?
 
string searchStr = 'EG-0006201';
string str = 'FIND  \''+searchStr+'*\'IN ALL FIELDS REturning Event_Registration__c (Id,Name)';
system.debug('str='+str);

List<List <sObject>> Rslt= search.query(str );
system.debug('Rslt='+Rslt);

returning 0 results.
 
How do I display Rich Text Area field value with proper alignment in table in lightning component.
Description column displaying data of 'Rich Text area' field

Thanks
Our notes & attchemnet are accessible through files(ie ContentDocumentLink replacement of attachment object), As we can not access/get attachment through lightning experience.
reference: https://help.salesforce.com/apex/HTViewSolution?urlname=Attachments-are-not-returned-in-Lightning-Experience-search&language=en_US
I want to display the attachment(image file) on lightning component, How can I display it?
I tried following code :
<apex:image url="/servlet/servlet.FileDownload—file=06941000000SKtyAAG" width="50" height="50" />  
 <apex:image url="/servlet/servlet.FileDownload?file={!attchmentId}"/>

 
Couldn’t create new Force.com project in Eclipse.Eclipse version is 3.3 .Does any one know the steps to create a force.com project in eclipse?
Our notes & attchemnet are accessible through files(ie ContentDocumentLink replacement of attachment object), As we can not access/get attachment through lightning experience.
reference: https://help.salesforce.com/apex/HTViewSolution?urlname=Attachments-are-not-returned-in-Lightning-Experience-search&language=en_US
I want to display the attachment(image file) on lightning component, How can I display it?
I tried following code :
<apex:image url="/servlet/servlet.FileDownload—file=06941000000SKtyAAG" width="50" height="50" />  
 <apex:image url="/servlet/servlet.FileDownload?file={!attchmentId}"/>

 
Hi,

I am trting to use the tooling api, I want to check the result if I call the method from Anonymous window of developer console, I am not getting the response.

Please check the below code.
public class APIHandler{

    public void executeREST(){
        system.debug('In executeREST');
        HttpRequest req = new HttpRequest();
        req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
        req.setHeader('Content-Type', 'application/json');
        req.setEndpoint('http://ap5.lightning.force.com/services/data/v42.0/tooling/sobjects/');
        req.setMethod('GET'); 
        
        Http h = new Http();
        HttpResponse res = h.send(req);
        system.debug('req='+req);
        system.debug('response===='+res.getBody()); 
    }
}
and the code for testing is as below:
APIHandler obj = new APIHandler();
obj.executeREST();
but I am not getting the response, please guide me.

Thanks in advance!

 
Is there anyway that I can investigate the actual root cause of an issue that I have been facing with installing an unmanaged package. I do recieve the error message, and I have applied changes as suggested by the community but I am still getting the same error and I cannot seem to get around it.

Any help would be greatly appreciated. 
  • January 16, 2018
  • Like
  • 0
Why Notes and Attachment, Case Comments are non-customisable objects?
I have visualforce page with two few fileds out of which there are two account fileds. I want to throw an error message when user tries to edit an existing record and enter same account name in both the account fields. I am not able to achieve this. below is my code: (It works fine for NEW record).

Visualforce Page:
<apex:page standardController="GRP_Fund_Relationship__c" extensions="GRP_EditNew_FundRelationshipCon" lightningStylesheets="true">
    <apex:form >
        <div align="center" draggable="false">
            <apex:commandbutton action="{!SaveAndRedirect}" Value="Save"/>   
            <apex:commandbutton action="{!CancelAndRedirect}" Value="Cancel" immediate="true" />   
        </div>
        <apex:pageBlock mode="edit">
            <apex:pageBlockSection title="Fund Relationship" columns="2" rendered="{!NOT(ISBLANK(GRP_Fund_Relationship__c.Id))}">
                            
                <apex:inputField value="{!GRP_Fund_Relationship__c.Name}"/>          
                <apex:inputField value="{!GRP_Fund_Relationship__c.GRP_Start_Date__c}"/>
                <apex:inputField value="{!GRP_Fund_Relationship__c.GRP_Account1__c}"/>
                <apex:inputField value="{!GRP_Fund_Relationship__c.GRP_End_Date__c}"/>
                <apex:inputField value="{!GRP_Fund_Relationship__c.GRP_Account2__c}"/>              
                <apex:inputField value="{!GRP_Fund_Relationship__c.GRP_Type_of_Relationship__c}"/>
               
            </apex:pageBlockSection>
            <apex:pageMessages />
            <apex:pageBlockSection title="New Fund Relationship" columns="2" rendered="{!(ISBLANK(GRP_Fund_Relationship__c.Id))}">
                            
                <apex:inputField value="{!NewFundRelationship.GRP_Account1__c}"/>
                <apex:inputField value="{!NewFundRelationship.GRP_Start_Date__c}"/>
                <apex:inputField value="{!NewFundRelationship.GRP_Account2__c}"/>
                <apex:inputField value="{!NewFundRelationship.GRP_End_Date__c}"/>
                <apex:inputField value="{!NewFundRelationship.GRP_Type_of_Relationship__c}"/>
               
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>

Controller:
public class GRP_EditNew_FundRelationshipCon {
    
    public account acc {set;get;}
    public string FundRelationshipID {get;set;}
    public string AccountParentId {get;set;}
    private ApexPages.StandardController controller;
    public GRP_Fund_Relationship__c NewFundRelationship {set;get;}
    public list<GRP_Fund_Relationship__c> FundRelationship {set;get;}
    public list<GRP_Fund_Relationship__c> CheckFundRelationship {set;get;}
    
    public GRP_EditNew_FundRelationshipCon (ApexPages.StandardController controller) {
         
        this.controller = controller;
        
        try{
            
            AccountParentId    = ApexPages.currentPage().getParameters().get('pid');
            FundRelationshipID = ApexPages.currentPage().getParameters().get('id');
            
            FundRelationship = [Select Name, GRP_Account1__c, GRP_Account2__c, GRP_Type_of_Relationship__c, GRP_Start_Date__c, GRP_End_Date__c 
                                from GRP_Fund_Relationship__c where id =:FundRelationshipID];
            
            NewFundRelationship = new GRP_Fund_Relationship__c(GRP_Account1__c = AccountParentId );
            
        }catch(Exception ex){
            
            system.debug('The following exception has occured in GRP_EditNew_FundRelationshipCon.GRP_EditNew_FundRelationshipCon --> ' + ex.getMessage() + ' || Row Number --> ' + ex.getLineNumber());
        }
    }
    
    public pagereference SaveAndRedirect(){
        
        try{
            
            if(FundRelationship.size() > 0){
                
                controller.save();
                
                CheckFundRelationship = [Select GRP_Account1__c, GRP_Account2__c from GRP_Fund_Relationship__c where id =:FundRelationshipID];
                
                system.debug('checkaccount 1---->'+CheckFundRelationship[0].GRP_Account1__c);
                system.debug('checkaccount 2---->'+CheckFundRelationship[0].GRP_Account2__c);
                
                if(checkFundRelationship[0].GRP_Account1__c == checkFundRelationship[0].GRP_Account2__c){
                    
                    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Account fields cannot have same Account Name'));
                    
                }else
                {    
                   system.debug('account 1---->'+FundRelationship[0].GRP_Account1__c);
                   system.debug('account 2---->'+FundRelationship[0].GRP_Account2__c);
                   
                   acc = [select id from account where id = :FundRelationship[0].GRP_Account1__c];
                }
                
            }else
            {
                if(NewFundRelationship.GRP_Account1__c == NewFundRelationship.GRP_Account2__c){
                    
                    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Account fields cannot have same Account Name'));

                }else
                {
                    Insert NewFundRelationship;
                    acc = [select id from account where id = :NewFundRelationship.GRP_Account1__c];
                }
            }
            
            PageReference ToAcc = new PageReference('/'+acc.Id);
            return ToAcc;

        }catch(Exception ex){
            
            system.debug('The following exception has occured in GRP_EditNew_FundRelationshipCon.SaveAndRedirect --> ' + ex.getMessage() + ' || Row Number --> ' + ex.getLineNumber());
            return null;
        }
    }
    
    public pagereference CancelAndRedirect(){
        
        try{
          
            if(FundRelationship.size() > 0){
                
                controller.cancel();  
                acc = [select id from account where id = :FundRelationship[0].GRP_Account1__c];
                PageReference ToAcc = new PageReference('/'+acc.Id);
                return ToAcc;
                
            }else
            {
                controller.cancel();            
                PageReference ToAcc = new PageReference('/'+AccountParentId);
                return ToAcc;
            }
            
        }catch(Exception ex){
            
            system.debug('The following exception has occured in GRP_EditNew_FundRelationshipCon.CancelAndRedirect--> ' + ex.getMessage() + ' || Row Number --> ' + ex.getLineNumber());
            return null;
        }
        
        
    }
    
}

 
I have a scenario where I am scheduling a job throw apex class. 
Datetime sysTime = System.now().addMinutes(5);    
String SchTimer = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' + sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' + sysTime.year();
system.schedule('scheduleDataJob_'+ SchTimer , SchTimer, new DataScheduleJob(sr));

I want to check whether this job is already scheduled or not? if it is not schedule then it should schedule and if it is scheduled then don't schedule it. 
I have added several new VF pages and their controllers to a managed package. When I deploy the managed package, I am unable to change the security to the controllers. Can't grant permission from profiles and no 'Security' link appears next to the classes. They are properly assigned in my packaging org. 

Any thoughts on what's happening? Thanks in advance.
I get this error: Challenge Not yet complete... here's what's wrong: 
The Suggestion custom object does not contain the correct set of custom fields. Tip: check for typos in the field names.

I've followed all steps, went back and rechecked, and then redid the entire challenge. I can't get it to pass. What am I doing wrong? I have included all custom fields and spelled them correctly.
Does anyone know How to search the string with hyphen(-) in dynamic SOSL?
 
string searchStr = 'EG-0006201';
string str = 'FIND  \''+searchStr+'*\'IN ALL FIELDS REturning Event_Registration__c (Id,Name)';
system.debug('str='+str);

List<List <sObject>> Rslt= search.query(str );
system.debug('Rslt='+Rslt);

returning 0 results.
 
How do I display Rich Text Area field value with proper alignment in table in lightning component.
Description column displaying data of 'Rich Text area' field

Thanks
Our notes & attchemnet are accessible through files(ie ContentDocumentLink replacement of attachment object), As we can not access/get attachment through lightning experience.
reference: https://help.salesforce.com/apex/HTViewSolution?urlname=Attachments-are-not-returned-in-Lightning-Experience-search&language=en_US
I want to display the attachment(image file) on lightning component, How can I display it?
I tried following code :
<apex:image url="/servlet/servlet.FileDownload—file=06941000000SKtyAAG" width="50" height="50" />  
 <apex:image url="/servlet/servlet.FileDownload?file={!attchmentId}"/>

 
Hi,

I am trying to perform dynamic search with sosl but gettig 0 rows.
For same query it is returning 4 rows on workbench.
here is the code snippet for refernce:
list<String>lstNames = new list<String>{'Brain-Prick@gmail.com','Dorsy.Young@coe.com', 'nj-sf@dev.com'};
	String searchquery='FIND {'+ getNames(lstNames) +'} IN ALL FIELDS RETURNING Account(Id,Name),Contact(Id,Name), Lead(Id, Name)'; 
 
	public string getNames(list<string> lstNames){
        String nameList ='';
        for(String name:lstNames){
            //escape hyphen
            if(name.indexof('-')>=0){
                name = name.replace('-', '\\-');
            }
            nameList = nameList + name + ' OR ';
        }
        
        nameList = nameList.substringBeforeLast('OR').trim();
        
        return nameList;
    }

Thanks,
N.J
 

Hi,

 

I have an application that I went to edit and set "Assign to Profiles" as Visible and Default for the "High Volume Customer Portal" profile.

 

I now want to delete this app. I can't because it is default for this profile. So I go in to edit this profile, and unlike the others (e.g. System Admin) it does not contain the "Custom App Settings" section. This means it looks like I cannot set this as not the default profile for this user profile.

 

How can I get out of this deadlock? I need to delete this app, please help!

 

Thanks in advance.