• prakashedl
  • NEWBIE
  • 55 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 13
    Replies

I am creating a dependent picklist in visual workflow using dynamic choice elements. The data source for picklists is a custom object field. The dependent values are stored as fields and the data is denormalized to represent the dependencies between the fields. Based on the dependencies and table structure, when I fetch values for the first dependent element, I am getting duplicate values as it is in the database. Any way to fetch only the unique values using visual workflow

I am creating a dependent picklist in visual workflow using dynamic choice elements. The data source for picklists is a custom object field. The dependent values are stored as fields and the data is denormalized to represent the dependencies between the fields. Based on the dependencies and table structure, when I fetch values for the first dependent element, I am getting duplicate values as it is in the database. Any way to fetch only the unique values using visual workflow

I create a managed package myself in one org and installed it in another org. The managed package is in beta status. The managed package has a few custom labels defined that I would like to use it in my apex code in the subscriber's organization. The labels are NOT protected. They have the protected checkbox unchecked. But still I am unable to access them from apex using Label.namespace__labelname. I always get a compilation error "invalid external string name". Am I missing something?

I am testing scheduled jobs in apex class. The test class runs fine in IDE but always errors in the browser/Salesforce UI in the same line. Any help shall be highly appreciated.

 

static testMethod void testSyncScheduledJobs(){
        //initialize logger
        LoggerSetup loggersetupInstance=new LoggerSetup();
        //call the method to schedule the job
        Test.startTest();
        loggersetupInstance.scheduleClearLogger();
        Test.stopTest();
        //custom setting to store the job ids of the scheduled jobs once scheduled. 
        Set<String> jobInstanceSet=Sched_JobIDs__c.getAll().keySet();
        //make sure the job is scheduled
        System.assertEquals(1,jobInstanceSet.size());
        
           //There can be only a maximum of 25 cron jobs so querying all the records in the cron trigger
        List<CronTrigger> cronTriggerList=[select Id
                                                 ,State 
                                           from CronTrigger
                                           LIMIT 100
                                          ];
        
        System.assertEquals(1,cronTriggerList.size());
        //after assertion that only one exist, delete the job behind the scenes
        System.abortjob(cronTriggerList.get(0).id);
        //now invoke the method to sync the scheduled jobs
        loggerSetupInstance.syncScheduledJobs();
        jobInstanceSet=Sched_JobIDs__c.getAll().keySet();
        //make sure the list is empty
        System.assertEquals(0,jobInstanceSet.size());
    }

 The error is on the last assert. The expected value is 0 but the actual value is still 1.

We are having some batch apex classes. We wrote methods to test batch apex. The execute of batch apex method makes a callout to external web service. Hence, we have an executeBatch with a size of 1. Our test methods were running without any failures until yesterday. I would consistently for about two-three weeks we did not see this error.  But suddenly, when we run test class, we are getting an error "System.UnexpectedException: Error processing messages" at the line where we call "System.schedule".

 

Any idea what might cause this? Please advise.

After the scheduled jobs in my Salesforce instance are completed, they are in "DELETED" state. Do these account towards the total number of jobs i can have running in my Salesforce instance? I guess the current limit is 25 jobs at any given point of time. As an example, let's say I have 5 jobs in state "DELETED", then will i able to schedule 25 jobs or just 20 jobs?

We are trying to create a managed package and host it on the appexchange. Our implementation includes standard objects like Leads, Contacts, Events and Campaign. Our concern at this point is the following

  1. We are creating records in these objects. WHat is the recommended approach to consider the required fields or other constraints the customers or subscribers may have for these objects? We are not aware of these constraints/required field and our record inserts may fail. Is this even recommended to use standard objects given this problem?
  2. In test classes to test the solution, we need to create instance of these objects to create data. Will these test classes fail in the subscriber's org because of missing required fields or validation rules/constraints.

Please help and advise the recommended approach. Thanks in advance for your help.

We are trying to create a managed package and host it on the appexchange. Our implementation includes standard objects like Leads, Contacts, Events and Campaign. Our concern at this point is the following

  1. We are creating records in these objects. WHat is the recommended approach to consider the required fields or other constraints the customers or subscribers may have for these objects? We are not aware of these constraints/required field and our record inserts may fail. Is this even recommended to use standard objects given this problem?
  2. In test classes to test the solution, we need to create instance of these objects to create data. Will these test classes fail in the subscriber's org because of missing required fields or validation rules/constraints.

Please help and advise the recommended approach. Thanks in advance for your help.

Hi All,

I have a basic question. If I mark the field "Read Only" when i am defining the field. Will my apex code be able to access it and set values? My requirement is the field should be updated only through apex code and not by any other means. Is just hiding the field from the page layout good enough?

Unable to save the file that involves dynamic binding in Visualforce. It works at times but at times it errors in the following line on my visualforce page.

 


<apex:inputField value="{!sObjectInstance[fieldName]}"/>

 

<apex:repeat value="{!fieldNameList}" var="fieldName">
             <apex:inputField value="{!sObjectInstance[fieldName]}"/>
</apex:repeat>

 

The "fieldName" is string and fieldNameList is the string list containing all field names. However, I get the following save error. sObjectInstance is a bind variable in my controller that refers to generic SObject as below. Any help in this regard is highly appreciated.

 

 

SObject sObjectInstance;

 

Save Error in Visualforce

 

Description    Path    Resource    Location    Type
Save error: Incorrect parameter for subscript. Expected Text, received core.apexpages.el.adapters.metadata.JavaMetadataELAdapter setup_requiredfields.page    line 0    Force.com save problem

Can we create a new meeting request ( cloud scheduler) associated to a lead or contact using apex? I am trying to create events for the leads or contacts behind the scenes using third party meeting tools integration. It would be nice, if i can create that as a meeting request using apex and NOT UI as opposed to just a normal event on the lead or contact. Is that possible?

I am trying to perform some DML operations in a method call. The method will be called very frequently in my application. However, the method is not within a LOOP and nor is the DML. But the method itself will be invoked say 200 times. Obviously, I would be hitting the governor limits. Is there a way to aggregate the values and do one single DML at the end of transaction as opposed to doing it for every single method call?

I would like to expose the schedule Apex user interface to the end users as a part of my application. They need not necessarily be system administrators. Is there a way to expose the OOB UI, without developing a new one? I realized that the URL for that is ui/setup/apex/batch/ScheduleBatchApexPage . But I am hesitant to use this, as this can change without notice. Any inputs or suggestions appreciated?

I have two questions around apex scheduler Jobs. Any help would be very useful

 

a) Why scheduled jobs that are in "COMPLETED" or "DELETED" state show up in Monitoring-->Scheduled Jobs and count towards the limit of 10 scheduled jobs. Any thoughts to get around this?

 

b) I am trying to delete jobs in CronTrigger table. I am getting the following error message the job still remains in the list of scheduled jobs. However, if i manually delete by going to Monitoring-->Scheduled Jobs in the org, it works. Any idea why I am getting the below exception? Suggestion to resolve this would be very useful.

 

java.sql.SQLException: ORA-20001:
ORA-06512: at "DOC.CMETAACCESS", line 542
ORA-01403: no data found
ORA-06512: at "DOC.CMETAACCESS", line 706
ORA-06512: at "DOC.CMETAACCESS", line 694
ORA-06512: at "DOC.CMETAACCESS", line 663
ORA-06512: at "DOC.CMETAACCESS", line 641
ORA-06512: at "DOC.UDDDMLCRONTRIGGER", line 65
ORA-06512: at line 1
: {call UddDmlCronTrigger.get_detail(?,?,?)}

I need to generate a word doc/PDF based on MS word template. It is very similar to the use case of mail merge templates where i create word template using SF merge fields. However, I understand that mail merge works only in Internet Explorer browsers. I would like the functionality to work across all browsers. Is there a suggestion to get that working on all browsers? On click of a button on a detail record, I would like to generate a word document based on template with values from the detail record I clicked the button.

 

Any suggestions or pointers would be very useful.

I am facing difficulties in writing test class. The main class logic reads the current date and time, reads the default business hours data, and performs functions based on the current date or time is within business hours or not. Also, it schedules jobs for end of business. My problem is since DML is not allowed in business hours, my coverage doesnt always remain constant and at times tests fail if i try to run it on weekends or holidays? Has anyone faced this before? Any suggestions to approach this problem would be very useful. 

I am trying to invoke system.schedule method. The first parameter is name of the schedule, second is the schedule string and third is the instance of the apex class that implements Schedulable interface.

 

The schedule string is the following

 

'58 0 20 12 5 ? 2010'

 

I get an exception saying System.Exception: trigger must be associated with a job detail

 

Has anyone encountered this exception before? Any idea where i could be missing? Any help would be appreciated.

 

3:0:57.407|METHOD_ENTRY|[109,32]|system.schedule(String, String, scheduleActiveQChecker)
3:0:57.450|EXCEPTION_THROWN|[109,32]|System.Exception: trigger must be associated with a job detail
3:0:57.450|METHOD_EXIT|[109,32]|schedule(String, String, APEX_OBJECT)

Do we have a limit of one thousand records that can be processed per DML statement? I believe, that was to do with the earler collection limit of one thousand records. Since, there is no limit on number of records in the collection, do we still have a limit on the number of records processed per DML statement. Please advice.

I am constructing a formula field of type 'Text'. The formula concatenates the value of about ten fields. I am not sure, if there is a limit on the length of a formula field ? Please advice

I was wondering, if there was a way to tie apex scheduler to BusinessHours object in Salesforce. i.e. I want the scheduler to define batch jobs to run every hour during business hours ( defined in BusinessHours object. ). Is this possible? If not , has anyone implemented this use case. Looking for recommended approach and suggestions.

I am trying to invoke system.schedule method. The first parameter is name of the schedule, second is the schedule string and third is the instance of the apex class that implements Schedulable interface.

 

The schedule string is the following

 

'58 0 20 12 5 ? 2010'

 

I get an exception saying System.Exception: trigger must be associated with a job detail

 

Has anyone encountered this exception before? Any idea where i could be missing? Any help would be appreciated.

 

3:0:57.407|METHOD_ENTRY|[109,32]|system.schedule(String, String, scheduleActiveQChecker)
3:0:57.450|EXCEPTION_THROWN|[109,32]|System.Exception: trigger must be associated with a job detail
3:0:57.450|METHOD_EXIT|[109,32]|schedule(String, String, APEX_OBJECT)

We are trying to create a managed package and host it on the appexchange. Our implementation includes standard objects like Leads, Contacts, Events and Campaign. Our concern at this point is the following

  1. We are creating records in these objects. WHat is the recommended approach to consider the required fields or other constraints the customers or subscribers may have for these objects? We are not aware of these constraints/required field and our record inserts may fail. Is this even recommended to use standard objects given this problem?
  2. In test classes to test the solution, we need to create instance of these objects to create data. Will these test classes fail in the subscriber's org because of missing required fields or validation rules/constraints.

Please help and advise the recommended approach. Thanks in advance for your help.

Unable to save the file that involves dynamic binding in Visualforce. It works at times but at times it errors in the following line on my visualforce page.

 


<apex:inputField value="{!sObjectInstance[fieldName]}"/>

 

<apex:repeat value="{!fieldNameList}" var="fieldName">
             <apex:inputField value="{!sObjectInstance[fieldName]}"/>
</apex:repeat>

 

The "fieldName" is string and fieldNameList is the string list containing all field names. However, I get the following save error. sObjectInstance is a bind variable in my controller that refers to generic SObject as below. Any help in this regard is highly appreciated.

 

 

SObject sObjectInstance;

 

Save Error in Visualforce

 

Description    Path    Resource    Location    Type
Save error: Incorrect parameter for subscript. Expected Text, received core.apexpages.el.adapters.metadata.JavaMetadataELAdapter setup_requiredfields.page    line 0    Force.com save problem

I need to generate a word doc/PDF based on MS word template. It is very similar to the use case of mail merge templates where i create word template using SF merge fields. However, I understand that mail merge works only in Internet Explorer browsers. I would like the functionality to work across all browsers. Is there a suggestion to get that working on all browsers? On click of a button on a detail record, I would like to generate a word document based on template with values from the detail record I clicked the button.

 

Any suggestions or pointers would be very useful.

Do we have a limit of one thousand records that can be processed per DML statement? I believe, that was to do with the earler collection limit of one thousand records. Since, there is no limit on number of records in the collection, do we still have a limit on the number of records processed per DML statement. Please advice.

I was wondering, if there was a way to tie apex scheduler to BusinessHours object in Salesforce. i.e. I want the scheduler to define batch jobs to run every hour during business hours ( defined in BusinessHours object. ). Is this possible? If not , has anyone implemented this use case. Looking for recommended approach and suggestions.

I created a managed package 'pkg1' with namespace prefix say 'abc'. The package contains a custom object TestObjectMP__c. I installed the managed package in another org. I am not able to retrieve values from an obj that is part of managed package when i use outputfield. However, if i create a tab for that object ( that is part of managed package ) , i am able to view the values. Following is the code.

<apex:page standardController="abc__TestObjectMP__c" tabStyle="abc__TestObjectMP__c">
<apex:pageBlock >
<apex:pageBlockSection title="TestObject Information">

<apex:outputField value="{!abc__TestObjectMP__c.name}"/>
<apex:outputField value="{!abc__TestObjectMP__c.abc__TestText__c}"/>
<apex:outputField value="{!abc__TestObjectMP__c.abc__TestVal__c}"/>


</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

 Am i missing something simple here? Your suggestions will be very useful.

Message Edited by prakashedl on 01-26-2010 10:27 AM
Message Edited by prakashedl on 01-26-2010 10:28 AM

I packaged all the custom objects into an unmanaged package. The objects were in deployed state in the source org. Additionally, the customer portal was enabled in the source org and all object had  "Available for Customer Portal" option checked. Now, when I install this into the new org with customer portal option enabled, there are two problems

 

a) The objects are in "InDevelopment" state instead of deployed. 

b) The "Available for Customer Portal" is not carried over to the target org for the objects.

 

This defeats the purpose of packaging the objects. I wanted point and click creation of about 100 objects as I replicate my project into multiple orgs. Am i missing something ? Any thoughts on achieving this shall be highly appreciated.

Hi All, 

I am a newbie to salesforce. I would appreciate, if someone could help me with this. I have two visual force pages A and B. They both use common custom controller. VF page B should access the values set by VF page A. However, I do not want to pass values using apex:param, since I do not want the end user to see the values in query parameters. Is there any way I can access since both pages use the same custom controller?

 

VF Page A

------------

 

<apex:page controller="customcontroller">
<apex:commandButton action="{!gotoNextPage}" value="Next Page"/>
</apex:page>

 

VF Page B (/apex/pageB)

----------------------------

<apex:page controller="customcontroller">
Test Value :{!testValue}
</apex:page>

 

customcontroller

-------------------

 

public String testValue { get; set; }

public PageReference gotoNextPage() {
testValue='TestValue set in VF page A';
// set the next page to VF page B
PageReference page = new PageReference('/apex/pageB');
return page;
}


Hence, when I navigate to pageB, I would like to see Test Value:TestValue set in VF page A. Again, I don't want the URL to be /apex/pageB?testValue='TestValue set in VF page A'. Is it possible to do using VF or apex? I might be missing something simple as well. Thanks for your time to help me.

 

 

http://www.edlconsulting.com

 

 

 

 

 

Message Edited by prakashedl on 11-13-2009 02:32 PM

My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute

 

 

Another trivial but strange thing thats happening is that, I can't open a component in view mode. On trying to view the component from Setup > Develop > Components. Following salesforce error comes, though we can edit the component :)

 
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 299154357-472 (-607383983)

 

I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".

 

Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.

 

Please help !

We have an Apex web service that calls out to a RESTful web service with the Http.send() method.

 

When the URL is http (i.e. non-secure http), all works great. But, if we change only the protocol to https the response is a "Bad Request" error code 400. 

 

The strange thing is that it works if we issue the Http.send() command a second time right after getting the failure, i.e. the Http.send() fails the first time, but succeeds if called again.

 

Looking at the debug log's time stamps, we can see that the failure response is coming back in 0 time, i.e. it looks like the request isn't really going out at all to the remote server.

 

Thanks

Message Edited by jbjb on 05-18-2009 05:18 PM
Message Edited by jbjb on 05-19-2009 09:33 AM
  • May 19, 2009
  • Like
  • 0