• fsdafdsfsdfsa
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

I would like a command like to look like a command button. I was once told that I could to that with using the style but I am having trouble figureing out how to do it. Can anyone give me a hand. Thanks

Hi all,

 

I have a managed package that's targeting twards force.com free edition users, and all is well except that I'm not able to package a profile that can be applied to force.com free seats.

 

In the free org I'm installing to I've cloned the free edition profile to make sure that it's not related to custom object permissions changes under spring10, and still no dice, none of the packaged profiles can be applied to the free profile.

 

As my developer edition doesn't support free edition seats (at least thats what support told me), how can I package a profile for free edition users?

 

It's very tedious to have them manually set all visualforce, apex, record type, and object permissions by hand and makes them appexchange seem that much less of a "one-click install" solution.

I would like a command like to look like a command button. I was once told that I could to that with using the style but I am having trouble figureing out how to do it. Can anyone give me a hand. Thanks

All out DEs and our PE have been upgraded to Spring '10 but our client is still on Winter '10. We need to release a new package version to them but the deployment fails saying that a Spring '10 package can't be deployed to a Winter '10 org. Seems reasonable but this means that we can't release new features they require and the latest announcement says that it might be March until we can. This will cause them significant issues.

 

What are our options?

 

Can we get our DEs and PE rolled back to Winter '10 (or is there a plan to roll everyone back to Winter '10 if there is an issue with Spring)? Can we have this block overridden as we're not using any Spring '10-specific features yet?

I have a simple Batch Apex class called from a trigger on the User object that updates a field on the Accounts owned by the User if a corresponding field is updated on the User.

 

All's working well as regards functionality, but the test method does not seem to be calling the Execute.

 

The trigger:

 

trigger au_User on User (after update) {

List<id> usersToUpdate = new List<id>();

//Loop through the trigger set for (integer iterator=0; iterator<trigger.new.size(); iterator++){

//Add the Users to collection where the values of the given fields have changed

if(trigger.new[iterator].Super_Sector_Region__c <> trigger.old[iterator].Super_Sector_Region__c){

usersToUpdate.add(trigger.new[iterator].id);

}

}

AccountUpdaterBatch batch = new AccountUpdaterBatch();

batch.usersToUpdate = usersToUpdate;

Database.executeBatch(batch, 20);

}

 

 The batch apex class:

 

 

global class AccountUpdaterBatch implements Database.Batchable<SObject>, Database.Stateful{

public List<id> usersToUpdate = new List<id>();

global Database.QueryLocator start(Database.BatchableContext BC){

String query='select a.id, a.Sector_Region__c, a.Owner.Super_Sector_Region__c'

+' from Account a where a.OwnerId IN :usersToUpdate';

return Database.getQueryLocator(query);

}

global void execute(Database.BatchableContext BC, List<sObject> scope){

List<Account> accns = new List<Account>();

for(sobject s : scope){

Account a = (Account)s;

if(a.Sector_Region__c != a.Owner.Super_Sector_Region__c)

a.Sector_Region__c = a.Owner.Super_Sector_Region__c;

accns.add(a);

}

update accns;

system.debug('####### Number of accounts updated'+accns.size());

}

global void finish(Database.BatchableContext BC){ //Do nothing }

 

}

 

The test method:

 

 

static testMethod void testUserTrigger(){

User currentUser = [Select u.Super_Sector_Region__c, u.Id From User u Where u.Id =: UserInfo.getUserID()];

List<Account> testAccs = new List<Account>();

for(integer i=0;i<90;i++){

Account testAccount = new Account(Name = 'TestAccount'+i, OwnerId = currentUser.Id);

testAccs.add(testAccount);

}

insert testAccs;

Test.starttest();

currentUser.Sector_Sales_Team__c = 'Test1';

update currentUser;

AccountUpdaterBatch testBatch = new AccountUpdaterBatch();

testBatch.usersToUpdate = new List<id>{currentUser.Id};

Database.executeBatch(testBatch, 20);

test.stoptest();

}

 

 

 

 Finally, the dump from the test log that shows that the start method was called, but the execute wasn't:

 

 

20100110162747.501:External entry point: returning Database.QueryLocator from method global Database.QueryLocator

start(Database.BatchableContext) in 0 ms

20100110162747.501:Class.AccountUpdaterBatch.start: line 35, column 10: SOQL locator query with 93 rows finished in 122 ms

Cumulative resource usage:

..

..

..

..

 

20100110162738.641:Class.TestAccountTrigger.testUserTrigger: line 123, column 3: returning from end of method global static void stopTest() in 5760 ms

 

20100110162738.641:External entry point: returning from end of method static testMethod void testUserTrigger() in 9065 ms

 

 Can someone please guide me as to what I'm missing or doing wrong?

 

Thanks,

 

-Manu 

Message Edited by md1 on 10-01-2010 04:36 PM
  • January 10, 2010
  • Like
  • 0