• Ajay K Dubedi
  • PRO
  • 2433 Points
  • Member since 2015
  • Ajay Dubedi


  • Chatter
    Feed
  • 73
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 1
    Questions
  • 634
    Replies
How to delete the Schedule Jobs with for loop.
In visualforce page i using pageBlock and it display a top border is black:
User-added image
How can remove top border of  pageBlock?
or
How can change color of this top border?
 
I using inputfield to insert an MyAccount:
UserName: <apex:inputfield value="{!acc.UserName__c}" />
 Pass: <apex:inputfield  value="{!acc.Pass__c}" />
 <p>
            <apex:commandButton value="Save"  action="{!save}" /> 
</p>
Current : Pass only mark is "*" after click save.
Can I mark pass when input?
 
Hi, I'm facing below error on trialhead challenge even though the code is correct. Got expected results in the debug window as well.

Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Please help.

Code:

public class StringArrayTest
{
   
    public static List<String> generateStringArray(Integer n)
    {
        String[] arr = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
           arr.add('Test'+i);
        }
        
         System.debug('The array is:'+arr); 
          return arr;
    }
    
  
}

 

We have two custom Object Student and College.
I have one custom field in Student fee
And in Parent Total Amount
Whenever student joined to college Total Amount will be update using trigger
It display error:
Your attempt to delete MyCart could not be completed because it is associated with the following relationships with other objects.

Object Type Relationship
MyProduct MyCart
MyProduct MyCart

I had deleted Lookup relationships  in table MyProduct , but still can't delete MyCart.
Challenge Not yet complete... here's what's wrong:  The 'Sales Manager' dashboard does not have the required 4 charts.
i didn't find any difference in my dashboard sketches and rough dashboard sketchesUser-added image
my sketches
User-added image
rough dashboard sketches
I using apex:repeat to display a table image:
This my code:
​<table>
                <apex:repeat value="{!MyProducts}" var="row">
                     <tr>
                       <td>
                       <apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>
                      </td>
                     </tr>
               </apex:repeat>
            </table>

i want display 4 image in a row, 
How can to set step of apex:repeat=4?
User-added image
If i add a visualforce page to Force.com_Sites, it display a top banner of salesforce.
can i remove it? or have to buy?
Hello, 
I want to create a way of mass uploadin fields on custom object "task". I installed mass edit/update but the instructions for custom objects are very old and they have not updated them. Anyway...
Is there a way of doing this (have no visual force / apex experience) - please see my screenshots

User-added image

User-added image
I need to update a field on a object with count of a field from another object (parent object) by writing a apex class. I'm stuck on this. Can anyone just guide me on this.
I have a custom object: Japan CCA Form
With a checkbox field: CCA_Agree_to_terms__c  
I want to update a custom checkbox field on the case object: CCA_Received
When the CCA_Agree_to_terms_c is true
 
How can I accomplish this?  I have spent hours chasing my tail. I feel the answer is a trigger, which I have no experience in. Please help!
 
<apex:page controller="SearchRecords" showHeader="true" >
    <apex:form id="frm">
        <apex:actionFunction name="showcon" action="{!showContact}" reRender="frm" />
        <apex:pageblock >
            <apex:pageBlockSection title="Search Account Records" columns="1">
                Enter Name<apex:inputText value="{!getstring}" id="theTextInput"/>
            </apex:pageBlockSection>
            <apex:commandButton action="{!searchRecords}" value="Search" id="theSearch" reRender="frm"/>
                <apex:pageBlockSection title="Account Detail">
                    <apex:pageBlocktable value="{!accountlist}" var="acc">
                        <apex:column >
                          <input type="radio" onclick="showcon()"/>
                        </apex:column>
                        <apex:column value="{!acc.name}" headerValue="Account Name"/>
                        <apex:column value="{!acc.Phone}" headerValue="Phone"/>
                    </apex:pageBlocktable>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Related Contact">
                    <apex:pageBlockTable value="{!Contactlist}" var="con">
                        <apex:column value="{!con.Name}" headerValue="Contact Name"/>
                        <apex:column value="{!con.Phone}" headerValue="Phone"/>
                        <apex:column value="{!con.Email}" headerValue="Email"/>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>

public class SearchRecords {
    public String AccId{get;set;}
    public string getstring{get;set;}
    public List<Account> accountlist {get;set;}
    public list<Contact> Contactlist{get;set;}
    public void searchRecords(){
        accountlist= new list<Account>();
        if(getstring!=null){
            accountlist= Database.query('select id,name,Phone from Account where name like \'%'+getstring+'%\'');
        }
    } 
    public void showContact(){
     Contactlist=[select Id,Name,Email,Phone from contact where accountId =:Accid];  
    }
}
Hi,

I just finished the reports and dashboard of the "Business Administration Specialist" trail in a fresh environment. I first got a warning that I forgot something. Then when I correct that I received the follow. Do I really have to create all the reports and dashboards again in a new playground or does anyone have a better idea? Thanks

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: XPFGIEDN
I have two status picklist field one at contact and one at account.Both the picklist have the same value (Active,Inactive,closed).Now i want when i update the status on account then the contactstatus is automatically update as account. 
trigger CreateOpportunityRelatedAccount on Opportunity (before insert) 
{
    public string ids;
    List<Opportunity> oppLstToUpdate=new List<Opportunity>();
    if(Trigger.isInsert)
    {
        for(Opportunity opp : Trigger.new)
        {        oppLstToUpdate.add(opp);
                 ids=opp.id;
                 opp.Description=ids;
        }   
    }

}

 
We need to create a storage location for a userguide(in any format pdf,excel etc) in salesforce and for that we have to give read only permissions to all users and Editable access to admin and selected users.

We have tried these two ways but couldn't find exact solution:

1- We have tried it using by creating a Folder in documents and giving readable access to all users and to give editable access to admin or some selected users we have created a permission set in which under System Permissions we just ticked the Manage public Documents checkbox.So by this all the users which are assigned in the permission set are able to manage all the folders but we want to manage only a particular folder.

2- We have also tried using content libraries.In that we created a library and added the content file in it.Gave permissions of viewing,editing to particular users but in this we are not able to add Chatter Only users so this solutions got breaked,adding to it some more profiles are asked to generate a case to salesforce support to get Salesforce CRM Content User License by this license only they can view or edit content.

Solutions for this is highly appreciable.And if any one can suggest how to modify any of above two ways to get required solution this will be a great help. I have also posted this question on salesforce community and Stack Exchage.

Thanks
i try include a slds to a custom css, but it not working.
<style>
    .div-custom{
        text-align:center;        
        } 
    .numcol{
        slds-size_1-of-4;
        }
    @media screen and (max-width: 800px) {
         .numcol{
        slds-size_1-of-2;
        }
        }
    @media screen and (max-width: 600px) {
         .numcol{
        slds-size_1-of-1;
        }
        }
    </style>

and using it:
<div class="slds-grid slds-wrap div-custom">
                <apex:repeat value="{!MyProducts}" var="row">
                    <div class="slds-col numcol">
                       <apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>                 
                       <p>
                           <apex:outputText >{!row.Name}{!row.Price__c}</apex:outputText>
                        </p> 
                        <p>
                         <apex:commandButton onclick="addCartAndBuy('{!row.Product_Code__c}');  return false;" value="Buy" id="btnBuy"/>
                        </p>
                      
                    </div>
                </apex:repeat>
            </div>

​How include a slds to a custom css?
Want to Write CronJobDetail Test class
public void abortCronJob(){
            List<CronJobDetail> detailIds = new List<CronJobDetail>([Select Id From CronJobDetail where Name ='ScheduleBatchPaymentDaysPassed']);
    System.debug('++detailsIds++=='+detailIds);
        if(detailIds != null && detailIds.size() > 0){
            Id detailId = detailIds[0].Id; 
            List<CronTrigger> cronTriggerList = new List<CronTrigger>([SELECT Id from CronTrigger WHERE CronJobDetailId = :detailIds[0].Id]);
            if(cronTriggerList.size() > 0){ 
                System.abortJob(cronTriggerList[0].Id); 
            }
        } 
}

 
I have two lightning components and in my Parent Component I have a Data Table to show the records that I query from the Custom settings and in each row, I have Edit and Delete Button. When I click the Edit button there I need to show a Modal Box(Child Component) to edit the custom settings Record? Is there any sample to do it? I am new to lightning and my knowledge of Lightning is the beginner.
I have imported my Accounts, Contact, Hobbies and Contact Hobbies.

Now when I go to check my progress by clicking the button-this error is thrown out:

There was an unhandled exception. Please reference ID: MOSDSHXA. Error: Faraday::ClientError. Message: INVALID_TYPE: select id from Hobbies__c limit 100 ^ ERROR at Row:1:Column:16 sObject type 'Hobbies__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.
Keep in mind that I'm not getting this error when importing anything-it's simply when checking the challenge.  The records already exist so I'm perplexed as to why this error is here.
Hi All,

Can we convert List<List<Account>> into List<Account>.

Regards,
VSK98
  • June 21, 2018
  • Like
  • 0
My question is, is each data load considered as one execution context or each trigger has it's own context? It would help me understand where more time is being spent. Whether time is being spent in 1. switching between multiple triggers (I know its bad practice. But, cant change so quickly now) or 2. This one trigger which is looping for 400-5000 times and creating possibly some insertions?
  • June 21, 2018
  • Like
  • 0
Hi,
      I need to change the default background color of vf page.
  User-added image
in this image there are two pageblock sections with white backfround , i am using lightning interface.
I used attribute in <apex:form StyleClass="background-color:blue" > but the white background of pageblock sections remains same.I need to apply the color to whole form including pageblock sections also,Is there any other way  please suggest me.
Thank you All.
How to delete the Schedule Jobs with for loop.

Hi all,

What is the maximum amount of data that can be sent in a SOAP API call? Is there a limit?

Thanks!
Hello All,

Can you please help me to understand inner class concept in details in apex. I have below code which is fine but I am not able to understand the concept. Here is my code. Thanks
//Apex class
public with sharing class InputSelectErrorExt 
{
	// parent standard controller
	private ApexPages.StandardController stdCtrl {get; set;}
	
	// object to encapsulate the entered value and any error
	// message associated with it
	public ValueAndError accountIdVal {get; set;}
		
	// constructor
	public InputSelectErrorExt(ApexPages.StandardController std)
	{
		stdCtrl=std;
		accountIdVal=new ValueAndError();
		
	}
	
	// Creates select list options for all accounts in the system
	public List<SelectOption> getAccountOptions()
	{
		List<SelectOption> result=new List<SelectOption>();
		result.add(new SelectOption('', '-- Choose --'));
		for (Account acc : [select id, Name from Account])
		{
			result.add(new SelectOption(acc.Id, acc.Name));
		}
		
		return result;
	}
	
	// validates the input and generates an error message or
	// delegates to the standard controller save method
	public PageReference save()
	{
		PageReference result=null;
		
		// clear down the previous errors
		accountIdVal.error='';
		
		if (String.IsBlank(accountIdVal.value))
		{
			accountIdVal.error='Please choose an account';
		}
		else
		{
			result=stdCtrl.save();
		}
		
		return result;
	}
	
	// custom class to encapsulate a value and error message
	public class ValueAndError
	{
		public String value {get; set;}
		public String error {get; set;} 
		
		public Boolean getHasError()
		{
			return (!String.IsBlank(error));
		}
	}
}
VisualForce Page
<apex:page standardController="Contact" extensions="InputSelectErrorExt">
  <apex:form >
    <apex:sectionHeader title="Create Contact" />
    <apex:pageBlock >
      <apex:pageBlockButtons >
        <apex:commandButton value="Save" action="{!save}" />
        <apex:commandButton value="Cancel" action="{!cancel}" />
      </apex:pageBlockButtons>
      <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="Choose account" />
          <apex:outputPanel >
            <apex:selectList value="{!accountIdVal.value}" size="1" styleClass="{!IF(accountIdVal.hasError,'error','')}">
              <apex:selectOptions value="{!accountOptions}" />
            </apex:selectList>
            <div class="errorMsg" style="display:{!IF(accountIdVal.hasError,'block','none')}"><strong>Error:</strong>&nbsp;{!accountIdVal.error}</div>
          </apex:outputPanel>
        </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem />
        
        <apex:inputField value="{!Contact.Salutation}"/>
        <apex:inputField value="{!Contact.FirstName}"/>
        <apex:pageBlockSectionItem />
        <apex:inputField value="{!Contact.LastName}"/>
        <apex:inputField value="{!Contact.Phone}"/>
        <apex:inputField value="{!Contact.Email}"/>
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 
Hi All,

I need to get the account Id and return the same to Visualforce page. Below is the method I am using.

I am getting an empty array list instead of parrticular Account ID. Have provided the output below for reference.

Any help is appreciated.

Code:

 public List<Account> getaccount() {
        account = [SELECT id FROM Account where Name = :contactName Limit 1];
        return account;
                                    }

Output:

https://XXXXXX.my.salesforce.com/[]?IDforaccountname=ZZZZ
  • April 24, 2018
  • Like
  • 1
Hi,

Cannot save the Controller, please help.

https://trailhead.salesforce.com/projects/quickstart-lightning-components/steps/quickstart-lightning-components4
Ok, been directed here by support so hoping someone can help.

Basically noticed that our case milestones were violating outside our set business hours.  After a lot of head scratching the only conclusion was that our timezone on the business hours in use by the entitlement processes were set to GMT.  I have changed this to BST (British Summer Time) to prevent more out of hours violations.

I have asked support if having it set to BST would mean that come Autumn salesforce will automatically revert back an hour in line with daylight savings.  They have said this does not occur and you have to manually change the timezone each time daylight savings occurs.

Can anyone confirm if this is true?  Seems like something so basic that I can't believe its not in the system. 
  • April 21, 2016
  • Like
  • 3

Hi, 

This Monday I tried to do the exam but I had technical issues with camera. Kryterion support tried to help me but we couldn't solve the problem. They rescheduled my exam multiple times but they can not do it to a different day.

Please, I have opened cases and called to certification support phone without getting any answer. Could you help me?

Best regards
I want to send emails in user's language dynamically. Two approaches:
1. Use visualforce email template, create labels and use them in the template. Set language attribute in the template and provide translations for the labels using translation workbench.
2. Create multiple versions of each template, each in a separate language and choose the template dynamically.

Advantage of first approach is that no additional efforts are required if a new language is to be supported but creating so many custom labels is cumbersome. 2nd approach is good in that respect but a template needs to be added everytime a new language is supported. 
Is there any other approach? If not, which one of the above should be chosen?