• Roth2842
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 16
    Replies

How do you get the System Permissions to be pulled?

 

I am working on building a Metadata deployment for our company, and part of the deployment includes creating several new profiles. We are trying to capture all of the permissions for these profiles, but can't seem to get the system permissions to match in our test runs.

 

I know that when you retrieve the profile object, what you get is dynamic, based on what other object you are retrieving. (see Chap 4 bullet 2 of the Migration Guide)

 

The Following System Permissions are different between our source and destination environment

 

Customize Application
Manage Connections
Manage Custom Report Types
Manage Dashboards
Manage Public Documents
Manage Public List Views
Manage Public Reports
Manage Public Templates
Manage Translation
Manage Users
Modify All Data
Reset User Passwords and Unlock Users
+ Send Email
Transfer Record
View All Data

 

 

note: + indicates added in the destination. All others are lost.

I am trying to submit a custom object for approval from a remoteAction. Up to this point, we have been using a Apex pageReference controller method, which has been working as expected.

The Approval request has been built as follows:

public static string submitQuote(id quoteId){
    Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
    req1.setComments('Submitting for Approval');
    req1.setObjectId(q.id);
    req1.setNextApproverIds(new ID[]{UserInfo.getUserId()});
    Approval.ProcessResult pr = Approval.process(req1);
    return 'Success';
}

 



If we call the submitQuote from the standard method it works in all cases we have identified. When we call the method using the remote action AND the running user is not the Opportunity owner or the Quote creator (these are the initial submitters on the approval workflow), they get this error:

NO_APPLICABLE_PROCESS, No applicable approval process found.

 



the Opportunity owner and or quote creator can submit using the remote action with out error.

Is there a reason that the workflow wouldn't apply when called by a remoteAction but would be accepted when not? Is there anyway to get both calls to run in the same context, so they will work and not work similarly?

In testing my sandbox for the upcomming winter 12 release I have found that existing code has been broken (continues to work in production, coded exactly as it is in the sandbox).

It appears that aggregate functions can no longer be aliased according to the developer API documentation as found at:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_groupby_alias.htm

Provided are 3 SOQL queries demonstrating what I am experiencing.  Two which should be run from the Sandbox and the third from production.  I have indicated the outcome of each and the error received when applicable.

 

Failing from Sandbox (Invalid field Total_Cost__c

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('Total_Cost__c'));
}

 Success from Production

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('Total_Cost__c'));
}

 Success from Sandbox

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('expr0'));
}

 

My questions are:

1. Are my results something that I am doing incorrectly?

2. Are we really losing the ability to alias aggregate functions in our SOQL?

3. Is there anywhere that this change (any any others, in this or future releases) is documented?

4. Are there any better ways of handling this change, besides ordering any/all aggregate functions and accessing them by their exprn position?




If I generate a partner WSDl file in my sandbox SF instance, go through the process of writing a working program that propts for user credentials to login(), can I re-use the resulting program to access a partner's sandbox instance just using the username/password credentials for a user in their sandbox, or do I need to obtain a partner WSDL from them, import it into my project, and rebuild the binary using their partner WSDL?

How can you get information on why an internal server error is happening?

 

When I try to transfer an existing approval, using both the Mass approval transfer wizard or individually, I received an internal server error message, where the only difference is the error Id

Error ID: 764721291-6671 (-1939455650) 
Error ID: 80795130-8539 (-1939455650) 

 The entire debug log is as follows:

22.0 APEX_CODE,FINEST;APEX_PROFILING,FINEST;CALLOUT,FINEST;DB,FINEST;SYSTEM,FINEST;VALIDATION,FINEST;VISUALFORCE,FINEST;WORKFLOW,FINEST
13:05:00.145 (145430000)|EXECUTION_STARTED
13:05:00.145 (145537000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:ApprovalProcessActions
13:05:00.172 (172696000)|WF_REASSIGN_RECORD|[Quote: APTAR T/A a0jC0000005jNej]|xxxxx xxxxxx
13:05:00.815|CUMULATIVE_PROFILING_BEGIN
13:05:00.815|CUMULATIVE_PROFILING|No profiling information for SOQL operations
13:05:00.815|CUMULATIVE_PROFILING|No profiling information for SOSL operations
13:05:00.815|CUMULATIVE_PROFILING|No profiling information for DML operations
13:05:00.815|CUMULATIVE_PROFILING|No profiling information for method invocations
13:05:00.815|CUMULATIVE_PROFILING_END
13:05:00.702 (702472000)|CODE_UNIT_FINISHED|Workflow:ApprovalProcessActions
13:05:00.702 (702531000)|EXECUTION_FINISHED

 It is only happening with one custom object and only one record type for that object, so I can't imagine that it is actually a Salesforce problem, but without insight into the internal reassignment method, how does one go about troubleshooting this?

We are trying to set up a CI environment, using the Migration tool, to effectively test a deployment to production, using the sandbox environment.  We are looking to run all of the tests that would be run in production, so we can catch any issues in the coding, or deployment process itself, before we try to push it to production.

 

The problem we are running into is that the deployment is failing on tests from installed packages

 

Example:

 

Test failure, method: al.DatabaseUtilsTest.test_query_ListString -- System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must at least input postal code for this site location: [] stack (al)
External entry point

 

 

All of our test successfully pass and we have >75% test coverage.

 

Migration Target:

 

<target name="deployTest">
	<sf:deploy username="${sf.username}" password="${sf.password}" runAllTests="True" serverurl="${sf.serverurl}" deployRoot="src" />
</target>

 

 

I have been poring over the Migration Tool Guide for a couple of days, but I am not finding any way to address this.  The guide says that in a deployment "to a production organization, all the tests in your organization, except for those that originate from installed managed packages, are automatically run." (emphasis added) 

 

Should I take my results to mean that in the sandbox, installed packages are tested too?

Is there some way of eliminating installed package tests from 'runAllTests="True"'?

I am created a batchable class, but when I am trying to run it, I am getting errors that I don't understand.

 

 

global class RefreshPipelineProcessor implements Database.Batchable<sObject>, Database.Stateful {
...
private Map<Id,User> activeUsers {
get {
...
global void execute(Database.BatchableContext ctx,List<Sobject> scope){
for (OpportunityFieldHistory ofh : lofh){ Opportunity o = ofh.Opportunity; User u = o.Owner__r; system.debug('Variable Settings:\n Opportunity: ' + o + '\nUser: ' + u + '\nUID: ' + u.id + '\nActiveUsers: ' + activeUsers.get(u.id)); if (activeUsers.containsKey(u.id)) { ...

(the System.debug was inserted to figure out what was going on.  I don't really call Map values with out testing for their presence)

 

The debug log:

 

 

11:27:36.221|USER_DEBUG|[86]|DEBUG|Variable Settings:
Opportunity: Opportunity:{Has_Quote__c=True, Owner__c=00580000003P8glAAC, Id=006Q00000046PZ4IAM}
User: User:{ManagerId=00580000002MQKSAA4, IsActive=true, Id=00580000003P8glAAC}
UID: 00580000003P8glAAC
ActiveUsers: User:{ManagerId=00580000002MQKSAA4, IsActive=true, Id=00580000003P8glAAC}
11:27:36.221|METHOD_EXIT|[86]|System.debug(ANY)
11:27:36.221|METHOD_ENTRY|[87]|MAP.containsKey(ANY)
11:27:36.221|EXCEPTION_THROWN|[87]|System.NullPointerException: Attempt to de-reference a null object
11:27:36.221|METHOD_EXIT|[87]|MAP.containsKey(ANY)

 

The activeUsers Map appears exists, not be null, and has the key in question, but I don't understand why calling .containsKey() against it is returning an error.

 

 

Any insight would be greatly appreciated.

 

 

I am going through the developer docs (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm) as I work on my first batchable class.

 

Under the section about the start method it says:

... For example, a batch Apex job for the Account object can return a QueryLocator for all account records (up to 50 million records) in an organization. ...

 Does the 50 million record limit extend past the start method?

 

My current project calculates total opportunity value by lead source.  Because we are entering more then 10,000 leads in a months period, I must move the class out to a batchable class.  I select all of the leads that I am dealing with in the start(), and then identify and return the opportunities generated from these leads in the execute().

 

If I go over 10,000 rows in my execute() will error out, or do I have the full 50M for the entire class?

 

I have written a visual force page and the controller to support a new custom object.  The custom object is deployed and I can create rows by using the built-in tab.

 

When I access the visual force page, I receive no errors and the page displays correctly.  When I look at the debug log, I see successful dml insert/update statements, and can retrieve the object via SOQL.  I have put a debug on the retrieved record and it has an ID and all other fields are set to their initial values.  As far as I can see from the debug log, everything looks successful.

 

15:25:34.58 (704508000)|USER_DEBUG|[11,4]|DEBUG|ReportStats__c:{Month__c=8, WonCount__c=0, RecordTypeId=012Q00000000FW2IAM, TotalInstallWon__c=0.00, AvgInstall__c=0.00, Count__c=0, Year__c=2010, Closed__c=0, OppCount__c=0, TotalInstall__c=0.00, TotalRMRWon__c=0.00, AvgInstallWon__c=0.00, AvgRMRWon__c=0.00, Id=a12Q00000004moUIAQ, TotalRMR__c=0.00, AvgRMR__c=0.00}

 

The problem is when I return to the tab for the object, the new records don't exist. 

 

If I use the ID from the debug log HTTPS://sf.com/a12Q00000004moUIAQ I get "Data Not Available"

 

 

System.debug([select id from ReportStats__c ALL ROWS ]); 

 Running the above command from the system log, only returns the objects that I manually created.

 

The standard name field on the object is auto-incrementing.

 

If I manually create another record, the name will have increased by the number of records that should have been created by the page.

 

I have taken every troubleshooting step I can think of, so any ideas on how I could identify the problem would be greatly appreciated.

 

I have several reports that I am trying to build, for use in a dashboard to show statistics for multiple time periods across several standard and custom objects.

 

The problem I am running into is trying to create custom summary formulas to support conditional situations.

 

An example is I want a field that counts the Lead records where the Lead status equals "Suspect"

 

Is this possible within existing report functionality, or is the only option to create a custom page/controller?

How do you get the System Permissions to be pulled?

 

I am working on building a Metadata deployment for our company, and part of the deployment includes creating several new profiles. We are trying to capture all of the permissions for these profiles, but can't seem to get the system permissions to match in our test runs.

 

I know that when you retrieve the profile object, what you get is dynamic, based on what other object you are retrieving. (see Chap 4 bullet 2 of the Migration Guide)

 

The Following System Permissions are different between our source and destination environment

 

Customize Application
Manage Connections
Manage Custom Report Types
Manage Dashboards
Manage Public Documents
Manage Public List Views
Manage Public Reports
Manage Public Templates
Manage Translation
Manage Users
Modify All Data
Reset User Passwords and Unlock Users
+ Send Email
Transfer Record
View All Data

 

 

note: + indicates added in the destination. All others are lost.

I am trying to submit a custom object for approval from a remoteAction. Up to this point, we have been using a Apex pageReference controller method, which has been working as expected.

The Approval request has been built as follows:

public static string submitQuote(id quoteId){
    Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
    req1.setComments('Submitting for Approval');
    req1.setObjectId(q.id);
    req1.setNextApproverIds(new ID[]{UserInfo.getUserId()});
    Approval.ProcessResult pr = Approval.process(req1);
    return 'Success';
}

 



If we call the submitQuote from the standard method it works in all cases we have identified. When we call the method using the remote action AND the running user is not the Opportunity owner or the Quote creator (these are the initial submitters on the approval workflow), they get this error:

NO_APPLICABLE_PROCESS, No applicable approval process found.

 



the Opportunity owner and or quote creator can submit using the remote action with out error.

Is there a reason that the workflow wouldn't apply when called by a remoteAction but would be accepted when not? Is there anyway to get both calls to run in the same context, so they will work and not work similarly?

In testing my sandbox for the upcomming winter 12 release I have found that existing code has been broken (continues to work in production, coded exactly as it is in the sandbox).

It appears that aggregate functions can no longer be aliased according to the developer API documentation as found at:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_groupby_alias.htm

Provided are 3 SOQL queries demonstrating what I am experiencing.  Two which should be run from the Sandbox and the third from production.  I have indicated the outcome of each and the error received when applicable.

 

Failing from Sandbox (Invalid field Total_Cost__c

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('Total_Cost__c'));
}

 Success from Production

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('Total_Cost__c'));
}

 Success from Sandbox

for (AggregateResult ar : [SELECT Sum(Total_Cost__c) Total_Cost__c FROM Service__c WHERE Quote__c in :listQuote GROUP BY Quote__c, Service_Category__c, Product__r.name]){
  system.debug(ar.get('expr0'));
}

 

My questions are:

1. Are my results something that I am doing incorrectly?

2. Are we really losing the ability to alias aggregate functions in our SOQL?

3. Is there anywhere that this change (any any others, in this or future releases) is documented?

4. Are there any better ways of handling this change, besides ordering any/all aggregate functions and accessing them by their exprn position?




Hi,

 

Can lists be passed to a webservice methods. Or should they be passed as strings. If they should only be passed string whats the alternative to convert a list to a string.

 

please suggest.

 

Thank you

  • September 28, 2011
  • Like
  • 0

If I generate a partner WSDl file in my sandbox SF instance, go through the process of writing a working program that propts for user credentials to login(), can I re-use the resulting program to access a partner's sandbox instance just using the username/password credentials for a user in their sandbox, or do I need to obtain a partner WSDL from them, import it into my project, and rebuild the binary using their partner WSDL?

We are trying to set up a CI environment, using the Migration tool, to effectively test a deployment to production, using the sandbox environment.  We are looking to run all of the tests that would be run in production, so we can catch any issues in the coding, or deployment process itself, before we try to push it to production.

 

The problem we are running into is that the deployment is failing on tests from installed packages

 

Example:

 

Test failure, method: al.DatabaseUtilsTest.test_query_ListString -- System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must at least input postal code for this site location: [] stack (al)
External entry point

 

 

All of our test successfully pass and we have >75% test coverage.

 

Migration Target:

 

<target name="deployTest">
	<sf:deploy username="${sf.username}" password="${sf.password}" runAllTests="True" serverurl="${sf.serverurl}" deployRoot="src" />
</target>

 

 

I have been poring over the Migration Tool Guide for a couple of days, but I am not finding any way to address this.  The guide says that in a deployment "to a production organization, all the tests in your organization, except for those that originate from installed managed packages, are automatically run." (emphasis added) 

 

Should I take my results to mean that in the sandbox, installed packages are tested too?

Is there some way of eliminating installed package tests from 'runAllTests="True"'?

I am created a batchable class, but when I am trying to run it, I am getting errors that I don't understand.

 

 

global class RefreshPipelineProcessor implements Database.Batchable<sObject>, Database.Stateful {
...
private Map<Id,User> activeUsers {
get {
...
global void execute(Database.BatchableContext ctx,List<Sobject> scope){
for (OpportunityFieldHistory ofh : lofh){ Opportunity o = ofh.Opportunity; User u = o.Owner__r; system.debug('Variable Settings:\n Opportunity: ' + o + '\nUser: ' + u + '\nUID: ' + u.id + '\nActiveUsers: ' + activeUsers.get(u.id)); if (activeUsers.containsKey(u.id)) { ...

(the System.debug was inserted to figure out what was going on.  I don't really call Map values with out testing for their presence)

 

The debug log:

 

 

11:27:36.221|USER_DEBUG|[86]|DEBUG|Variable Settings:
Opportunity: Opportunity:{Has_Quote__c=True, Owner__c=00580000003P8glAAC, Id=006Q00000046PZ4IAM}
User: User:{ManagerId=00580000002MQKSAA4, IsActive=true, Id=00580000003P8glAAC}
UID: 00580000003P8glAAC
ActiveUsers: User:{ManagerId=00580000002MQKSAA4, IsActive=true, Id=00580000003P8glAAC}
11:27:36.221|METHOD_EXIT|[86]|System.debug(ANY)
11:27:36.221|METHOD_ENTRY|[87]|MAP.containsKey(ANY)
11:27:36.221|EXCEPTION_THROWN|[87]|System.NullPointerException: Attempt to de-reference a null object
11:27:36.221|METHOD_EXIT|[87]|MAP.containsKey(ANY)

 

The activeUsers Map appears exists, not be null, and has the key in question, but I don't understand why calling .containsKey() against it is returning an error.

 

 

Any insight would be greatly appreciated.

 

 

I have written a visual force page and the controller to support a new custom object.  The custom object is deployed and I can create rows by using the built-in tab.

 

When I access the visual force page, I receive no errors and the page displays correctly.  When I look at the debug log, I see successful dml insert/update statements, and can retrieve the object via SOQL.  I have put a debug on the retrieved record and it has an ID and all other fields are set to their initial values.  As far as I can see from the debug log, everything looks successful.

 

15:25:34.58 (704508000)|USER_DEBUG|[11,4]|DEBUG|ReportStats__c:{Month__c=8, WonCount__c=0, RecordTypeId=012Q00000000FW2IAM, TotalInstallWon__c=0.00, AvgInstall__c=0.00, Count__c=0, Year__c=2010, Closed__c=0, OppCount__c=0, TotalInstall__c=0.00, TotalRMRWon__c=0.00, AvgInstallWon__c=0.00, AvgRMRWon__c=0.00, Id=a12Q00000004moUIAQ, TotalRMR__c=0.00, AvgRMR__c=0.00}

 

The problem is when I return to the tab for the object, the new records don't exist. 

 

If I use the ID from the debug log HTTPS://sf.com/a12Q00000004moUIAQ I get "Data Not Available"

 

 

System.debug([select id from ReportStats__c ALL ROWS ]); 

 Running the above command from the system log, only returns the objects that I manually created.

 

The standard name field on the object is auto-incrementing.

 

If I manually create another record, the name will have increased by the number of records that should have been created by the page.

 

I have taken every troubleshooting step I can think of, so any ideas on how I could identify the problem would be greatly appreciated.

 

I am trying to query records and getting error : System.Exception: retrieve id limit reached.

 

What does this mean and how can this be resolved?

 

Suggestions please? 

  • March 15, 2010
  • Like
  • 0