• ssoftware
  • NEWBIE
  • 85 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 30
    Replies
Hi All,

Created the following simple visualforce page, and then a tab based on this page. Enabled lightning experience and then visited the tab (App Launcher -> Other Items -> this tab). The option "Available for Salesforce mobile apps and Lightning Pages" is also enabled.

The output shows Theme3 instead of Theme4d. What am I doing wrong?

<apex:page showHeader="true" >
{!$User.UITheme}
<br/>
{!$User.UIThemeDisplayed}
</apex:page>
 
Hi All,

I developed a custom lightning component to use in a Salesforce community and it is working fine. Salesforce communities have quite a few standard lightning components. I am particularly interested in using the Record Detail standard component in my custom component. Can someone let me know if it is possible, and if yes, what is the proper syntax to nest it in my custom component? I could not find anything about this so far in the documentation. 
Hi All,

My application frequently utilises a list custom setting in a for loop.
Custom_Setting__c cs = Custom_Setting__c.getInstance(key);

Is there any additional benefit to store all the values in a Map before the for loop begins and then access the Map in the loop?
Map<String, Custom_Setting__c> mapCS = Custom_Setting__c.getAll();
for (....) {
Custom_Setting__c cs = mapCS.get(key);
}

My guess is that as custom settings are already utlizing application cache, there is probably no added benefit. But I would like to double check if this is correct as I want to optimise the for loop as much as possible.
 
Hi All,

The following visualforce page when embedded in a detail record looks OK when accessed from a web browser. However, when it is accessed from Salesforce1App, its background color is white. The option "Available for Salesforce mobile apps" is checked for the page.

How can I fix it so that the same page looks properly in both the cases?

--------------------------------------
<apex:page standardController="Lead" docType="html-5.0" showHeader="false" sidebar="false">
<apex:outputText value="Hello World" />
</apex:page>
--------------------------------------

Following is the screenshot from Salesforce1 App:

salesforce1 screenshot

Thanks in advance
Madhav
Hi All,

List<CronTrigger> lstJobs = [SELECT Id FROM CronTrigger WHERE CronJobDetail.Name LIKE '%myReports%'];
for(CronTrigger ct : lstJobs) system.abortJob(ct.Id);

I run the above code on a daily basis to clean up some old scheduled batch jobs, and I am getting the limitexception:
System.LimitException: ads:Too many DML statements: 151

I undestand that bulkifying the above would solve the issue - similar to other DML operations on standard and custom objects.

My question is - how to do bulkify this operation? Is there a way to mass delete schduled jobs as abortJob() function seems to take only one Job Id at a time?

Kind Regards
Madhav

Hi All,

 

I have a batch job runnning quite frequently - every hour processing Case records. While the job is running, users are sometimes experiencing difficulty in saving case records that they were edting at the same time. I understand this is due to the batch job locking those records while they were being processed by it.

 

Couple of questions:

1. If I reduce the batch size will it minimise this issue or does it not have any effect? For instance if there were 1000 cases in total matching the query criteria, the batch job is processing by default 200 records at a time. When the batch process started, is it locking all the 1000 records that the querylocator returned or only 200 records at the time?

 

2. I also have a master-detail relationship between the Case object (master) and a custom detail object. If a batch program is being run only on the detail object, does Salesforce also lock the related master Case records? If it does not, then this could be a potential workaround for me - where the batch is making all the needed changes in the custom detail object while the users can make any changes to the Cases during this time.

 

Kind Regards

Madhav

Hi,

 

I have a visualforce page that I have added to the Account page layout. (Edit Page layout -> Visualforce Pages -> then selected the custom visual force page that I developed). This is working fine and showing the relevant data as expected when logged into Salesforce from a regular browser.

 

I would like to make it work in Salesforce Touch and Salesforce Classic. How do I go about getting it to work? Currently it is now showing up when I access an account from Touch/Classic.

 

I understand that one can develop custom visualforce Tabs that can be shown in Touch/Cassic. However I would like the visualforce page to show in the Account detail page and not as a separate Tab.

 

Any help is appreciated.

 

Kind Regards
Madhav

Hi All,

I am calling a batch class (with Database.AllowsCallouts) from a Scheduler class. The batch class is making http callouts. Both classes are using Apex version 27.0.

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {

String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);

}

}

 

In my developer environment, the above code is working just fine. However when I deploy it to production (as part of a managed package) and run the scheduled class, I am getting the error:

"Callout from scheduled Apex not supported"

 

Why it works without issues in dev but not in production? Do I need to do anything in the production environment to get it working?


I have also tried the following variation of the scheduler class:

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
runBatchProgram();
}

 

@future (callout=true)
static void runBatchProgram() {
String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);
}


}

 

With this I get the error: Database.executeBatch cannot be called from a batch or future method.

 

Any help is appreciated as I am stuck.

 

Madhav

Hi All,

 

I am using the following formula field to open a knowledge article.

 

HYPERLINK('/knowledge/publishing/articleOnlineDetail.apexp?id='+ artcle_id, 'Sample Article')

 

Can one of you let me know how I can adapt it so that it opens as a subtab in the service cloud console?

 

Thanks

Madhav

Hi All,

 

I am getting the above error message for a visualforce page I developed. I minimized this issue by using the transient keyword in the controller code and by using readOnly="true" in the visualforce page.

 

However, my question is in case I get this error again, is there a way I can catch this error and display a more user friendly message?

 

For any DML operations in the controller code, I can catch the exceptions and use ApexPages.addMessages to display a user friendly message. However, where and how do I catch the view state error messages?

 

Thanks

Madhav

Hi All,

 

I have a zip file with a csv file in it - and is stored as a Document in Salesforce. I understanda that from Apex one can access a regular file using the Document object. However, is it possible to access a csv file stored with in a zipped file? From what I have read on the Board so far, this seems to be not possible.

 

Thanks in advance. Any pointers would be very much appreciated.

 

Madhav

Hi All,

 

In the Campaign detail page, for the opportunity related list, there is a "New" button to create and add a new opportunity to the Campaign.

 

I would like to provide an "Add" custom button to this related list so that one can select and add an existing opportunity.

 

I understand that one way to do this is create a list button and add it to the Opportunity List View search layout, but I do not know the code that needs to go there in the button.

 

Can someone let me know what is the best way to go about this?

 

Thanks in advance!!

Hi All,

 

The primary campaign source lookup field in the Opportunity detail page only seems to allow linking a top-level campaign (Parent). Is this correct?

 

I have a campaign hierarchy and I would like to associate an opportunity with a child campaign in the hierarchy. Is this possible? If it is, can someone let me know how I can accomplish this?

 

Thank you.

Hi All,

 

1. I created a child campaign where the 

Budgeted Cost = 25000

 

 
 
Not Checked

Actual Cost = 13000

 

2. I edited the campaign page layout and added the following fields:

 

Total Budgeted Cost in Hierarchy

Total Actual Cost in Hierarchy.

 

3. In the  parent campaign, I see the Hierarchy totals line summary correctly in the Campaign Hierarchy related list. (25000 and 13000). However, the "Total Budgeted Cost in Hierarchy" and the "Total Actual Cost in Hierarchy" fields that I added in Step 2 show incorrect values (15000 and 8000 respectively).

 

Can someone let me know what could be going wrong?

 

Thanks!

Hi All,

 

Is it possible to add a custom field to a standard SObject (Account etc..) via Apex? If it is, can someone point me in the right direction or show me some sample code?

 

Thanks in advance!

Hi All,

 

I am not sure if this is possible or not.

 

Budgets is being accessed in a form as input text fields from a visualforce page.

 

public Integer[] Budgets {get;set;}

 

public Integer[] getBudgets() {
    return Budgets;
}

 

public void setBudgets(????) {

       ???

}

 

Is it possible to write a setter method as well? If it is, can someone let me know the syntax? If not possible, can you point me to a workaround? Ideally, I do not want to define 12 individual Integer variables to do the same thing.

 

The visualforce code looks something like this:

 

          <apex:inputText value="{!Budgets[0]}" size="9"/>
          <apex:inputText value="{!Budgets[1]}" size="9"/>
          <apex:inputText value="{!Budgets[2]}" size="9"/>
          <apex:inputText value="{!Budgets[3]}" size="9"/>
          <apex:inputText value="{!Budgets[4]}" size="9"/>
          <apex:inputText value="{!Budgets[5]}" size="9"/>
          <apex:inputText value="{!Budgets[6]}" size="9"/>
          <apex:inputText value="{!Budgets[7]}" size="9"/>
          <apex:inputText value="{!Budgets[8]}" size="9"/>
          <apex:inputText value="{!Budgets[9]}" size="9"/>
          <apex:inputText value="{!Budgets[10]}" size="9"/>
          <apex:inputText value="{!Budgets[11]}" size="9"/>

 

 

Thanks in advance!!!

Hi All,

 

The following works and returns the result as expected:

 

private List<Opportunity> opps;

 

opps = [SELECT Id, Name, Amount, CloseDate, StageName,LeadSource FROM Opportunity WHERE Id IN ('006U00000026EE0IAM','006U00000026EDs')];



However, I am trying to make it work this way, but the query does not return any results.

 

String sClause = '\'' + '006U00000026EE0IAM' + '\'' + ',' + '\'' + '006U00000026EE0IAM' + '\'';

 

opps = [SELECT Id, Name, Amount, CloseDate, StageName,LeadSource FROM Opportunity WHERE Id IN (:sClause)]; 

 

Can someone let me know what is the proper syntax?

 

Thanks in advance.

      


Hi All,

 

I am trying to update the outputText value from javascript in the following code but it is not working. Can someone let me know what could be going wrong?

 

The current output is:

 

xyz

 

Thanks

Success Software

 

<apex:page>

<apex:outputText id="theText" value="xyz"/>

<script>

var tText = document.getElementById('{!$Component.theText}');

tText.value = 'Hello';

</script>

</apex:page>

Hi All,

I developed a custom lightning component to use in a Salesforce community and it is working fine. Salesforce communities have quite a few standard lightning components. I am particularly interested in using the Record Detail standard component in my custom component. Can someone let me know if it is possible, and if yes, what is the proper syntax to nest it in my custom component? I could not find anything about this so far in the documentation. 
Hi All,

The following visualforce page when embedded in a detail record looks OK when accessed from a web browser. However, when it is accessed from Salesforce1App, its background color is white. The option "Available for Salesforce mobile apps" is checked for the page.

How can I fix it so that the same page looks properly in both the cases?

--------------------------------------
<apex:page standardController="Lead" docType="html-5.0" showHeader="false" sidebar="false">
<apex:outputText value="Hello World" />
</apex:page>
--------------------------------------

Following is the screenshot from Salesforce1 App:

salesforce1 screenshot

Thanks in advance
Madhav
Hi All,

List<CronTrigger> lstJobs = [SELECT Id FROM CronTrigger WHERE CronJobDetail.Name LIKE '%myReports%'];
for(CronTrigger ct : lstJobs) system.abortJob(ct.Id);

I run the above code on a daily basis to clean up some old scheduled batch jobs, and I am getting the limitexception:
System.LimitException: ads:Too many DML statements: 151

I undestand that bulkifying the above would solve the issue - similar to other DML operations on standard and custom objects.

My question is - how to do bulkify this operation? Is there a way to mass delete schduled jobs as abortJob() function seems to take only one Job Id at a time?

Kind Regards
Madhav

Hi All,

 

I have a batch job runnning quite frequently - every hour processing Case records. While the job is running, users are sometimes experiencing difficulty in saving case records that they were edting at the same time. I understand this is due to the batch job locking those records while they were being processed by it.

 

Couple of questions:

1. If I reduce the batch size will it minimise this issue or does it not have any effect? For instance if there were 1000 cases in total matching the query criteria, the batch job is processing by default 200 records at a time. When the batch process started, is it locking all the 1000 records that the querylocator returned or only 200 records at the time?

 

2. I also have a master-detail relationship between the Case object (master) and a custom detail object. If a batch program is being run only on the detail object, does Salesforce also lock the related master Case records? If it does not, then this could be a potential workaround for me - where the batch is making all the needed changes in the custom detail object while the users can make any changes to the Cases during this time.

 

Kind Regards

Madhav

Hi,

 

I have a visualforce page that I have added to the Account page layout. (Edit Page layout -> Visualforce Pages -> then selected the custom visual force page that I developed). This is working fine and showing the relevant data as expected when logged into Salesforce from a regular browser.

 

I would like to make it work in Salesforce Touch and Salesforce Classic. How do I go about getting it to work? Currently it is now showing up when I access an account from Touch/Classic.

 

I understand that one can develop custom visualforce Tabs that can be shown in Touch/Cassic. However I would like the visualforce page to show in the Account detail page and not as a separate Tab.

 

Any help is appreciated.

 

Kind Regards
Madhav

Hi All,

I am calling a batch class (with Database.AllowsCallouts) from a Scheduler class. The batch class is making http callouts. Both classes are using Apex version 27.0.

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {

String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);

}

}

 

In my developer environment, the above code is working just fine. However when I deploy it to production (as part of a managed package) and run the scheduled class, I am getting the error:

"Callout from scheduled Apex not supported"

 

Why it works without issues in dev but not in production? Do I need to do anything in the production environment to get it working?


I have also tried the following variation of the scheduler class:

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
runBatchProgram();
}

 

@future (callout=true)
static void runBatchProgram() {
String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);
}


}

 

With this I get the error: Database.executeBatch cannot be called from a batch or future method.

 

Any help is appreciated as I am stuck.

 

Madhav

Hi All,

 

I am using the following formula field to open a knowledge article.

 

HYPERLINK('/knowledge/publishing/articleOnlineDetail.apexp?id='+ artcle_id, 'Sample Article')

 

Can one of you let me know how I can adapt it so that it opens as a subtab in the service cloud console?

 

Thanks

Madhav

Hi All,

 

I am getting the above error message for a visualforce page I developed. I minimized this issue by using the transient keyword in the controller code and by using readOnly="true" in the visualforce page.

 

However, my question is in case I get this error again, is there a way I can catch this error and display a more user friendly message?

 

For any DML operations in the controller code, I can catch the exceptions and use ApexPages.addMessages to display a user friendly message. However, where and how do I catch the view state error messages?

 

Thanks

Madhav

Hi All,

 

I have a zip file with a csv file in it - and is stored as a Document in Salesforce. I understanda that from Apex one can access a regular file using the Document object. However, is it possible to access a csv file stored with in a zipped file? From what I have read on the Board so far, this seems to be not possible.

 

Thanks in advance. Any pointers would be very much appreciated.

 

Madhav

Hi Guys,

 

I am doing a project related to the multiple timezone.  Currently I am using the salesforce time zone to calculate the local time.

 

for exmaple : 

(GMT+10:00) Australian Eastern Standard Time (Australia/Sydney) (default timezone in our org). 

(GMT+08:00) Australian Western Standard Time (Australia/Perth)

 

If the Sydney time is 11:00 am, it is 9:00 am in Perth.

 

The problem is the daylight saving time.

 

Will the time zone become to  (GMT+11:00) automatically or not ? If not, how do I calculate the local time for Perth?

 

 

 

Thanks in advance