• SKriLL
  • NEWBIE
  • 34 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 20
    Replies
Hi all,

I am trying to build and deploy a package.  The package contains a custom Campaign record type, page layout, custom fields, etc.
The package also contains profile settings that are mapped to a newly cloned profile on install.

After installing the package in a new org and mapping the profile settings to a newly cloned profile, all of my other object permissions appear to be correct, but the campagin object only has read checked.  The write and edit permissions are not copied over.

The package is currently unmanaged, but I am trying to move everything into a new dev org with the intention of creating a managed package.  So my question applies to both unmanged and managed packages.

Any thoughts on why Im having trouble?  Is the campaign object uniuqe in some way?

Im not sure what else to add so please ask if you would like to see some more info.

Thanks
  • March 07, 2016
  • Like
  • 0
Hi guys and gals,

Why does this test succeed?  I would expect it to fail...

@isTest(SeeAllData=false)
public class RepoBatchTest2
{
   static testMethod void testMethod1()
   {
       List<Account> a1list = [select id from account where name = 'asdf1234asdf1234asdf1234asdf1234asdf1234asdf1234'];
       integer i1 = 0;
       for(account a : a1list)
       {
           i1++;
       }
       Account a = new Account();
       a.name='asdf1234asdf1234asdf1234asdf1234asdf1234asdf1234';
       insert a;
       List<Account> a2list = [select id from account where name = 'asdf1234asdf1234asdf1234asdf1234asdf1234asdf1234'];
       integer i2 = 0;
       for(account a1 : a1list)
       {
           i2++;
       }
       System.assertEquals(i1,i2); //i1 should = 0 and i2 should = 1... both = 0??
   }
}
  • September 19, 2014
  • Like
  • 0
How do I do something like this... Obviously fieldsetmemeber isnt the same as field, but it was the closet thing I could find to illistrate my point.  I want to be able to build an object dynamically even if the numbers or names of fields changes.  I could query the object and get a list of strings that are the names of the fields... but how do I turn that into a field reference?

for(Schema.FieldSetMember f : ObjectType.Custom_Object__c.FieldSets.Field_Set.getFields())
        {
            obj.f = datamap.get(f.getLabel());
        }

for(String s : ListOfFieldsNames)
{
   obj.s = datamap.get(s);
}

Bitcoin reward for a correct answer :)
  • March 05, 2014
  • Like
  • 0

Im wondering what the limits are on exporting data from a salesforce org.  I noticed that when scheduling a data export through Setup > Administration Setup > Data Management > Data Export the most frequently scheduled export you can do is once a week.

 

If I create a data loader command line file and use a scheduled .bat to run this command line export every day, or every hour, will there be issues?

 

What if this data loader command line file only exports one object?  What if it exports the whole DB?

 

If someone could give answers for all the different kinds of salesforce editions that would also be fantastic.

 

Thanks

  • April 02, 2012
  • Like
  • 0
s.Total_Projections_From_Projection__c is a Roll-Up Summary field and its column wont display on the page as is.  As in I cannot see the CY_Projection column on the page at all.  If I change the column value the column displays itself... Why cant I display my Roll-Up Summary field?
<apex:pageBlockTable value="{!Snapshots}" var="s">
              <apex:column headerValue="Name">
                  <apex:outputLink value="/{!s.ID}" target="_blank">{!s.BD_Name__r.Name}</apex:outputlink>
              </apex:column>
              <apex:column value="{!s.Actuals__c}" headerValue="CY Billings"/>
              <apex:column value="{!s.Sum_of_Open_Opps_2012__c}" headerValue="!CY Pipeline"/>
              <apex:column value="{!s.Total_Projections_From_Projection__c}" headerValue="!CY Projections"/>
              <apex:column value="{!s.Total_YTD_Forecast__c}" headerValue="CY Forecast"/>
              <apex:column value="{!s.Quota__c}" headerValue="CY Quota"/>
              <apex:column value="{!s.Gap__c}" headerValue="CY Gap"/>
              <apex:column value="{!s.YTD_Quota__c}" headerValue="YTD Quota"/>
              <apex:column value="{!s.YTD_Gap__c}" headerValue="YTD Gap"/>
              
              
              
          </apex:pageBlockTable>
 
  • March 26, 2012
  • Like
  • 0

There is a select statement inside the begining of the first for loop and there is also a select statement used as part of the conditional of the next for loop.  Do I need to bulkify both of these select statements to avoid 'Too many SOQL queries' ?  

 

Can you guys and girls help me with how to bulkify these loops?  I have trouble with collections in apex :(

 

for(ID user :MYSnapShotUsers)
{
aUserOpp = 0;
BD_Performance__c Isnapshot = [select Sum_of_Open_Opps_2012__c from BD_Performance__c where BD_Name__c = :user LIMIT 1];

for(Rep_Split__c rs : [select Id, Opportunity__c, Opportunity__r.IsWon, User__c, Rep_Percentage__c, Account_ID__c, Opp_Stage__c,Rep_Commission__c, Custom_Split__c, Split__c, Real_Split__c, IsOpen__c, Rep_s_Projected_Amount_for_2012__c, Reps_Credit_Formula__c, Opp_Amount__c, Opp_Probability__c, Opp_Projected_2012__c, Opp_Close_Date__c from Rep_Split__c WHERE User__c = :user AND (IsOpen__c = 1 OR Opp_Close_Date__c >= :SixtyDays)])
{

IF(rs.Rep_s_Projected_Amount_for_2012__c != null)
{
aUserOpp = aUserOpp + rs.Rep_s_Projected_Amount_for_2012__c;
a2012opp = a2012opp + rs.Rep_s_Projected_Amount_for_2012__c;
}
 }
Isnapshot.Sum_of_Open_Opps_2012__c = aUserOpp;
update Isnapshot;
}

 

 

  • March 26, 2012
  • Like
  • 0

I have 2 VF pages.  When I create an Opportunity some values are supposed to be carried over to VFpage1 and VFpage2 is supposed to be a summation of the information in VFpage1.  The problem I am running into is if I create a new opportunity and then go straight to VFpage2, the summation information is not updated.  However if I load VFpage1 and then load VFpage2 the information is passed through and summed up correctly.

 

I found that VFpage1's header contains action="{!updateMethod}".  I believe it is this updateMethod that needs to be run before VFpage2 will have the correct information.

 

Is there anyway to call VFpage1.VFpage1ControllerClass.updateMethod from VFPage2?

 

When I add VFpage1ControllerClass.updateMethod to VFpage2ControllerClass I get the DML error.

  • March 22, 2012
  • Like
  • 0

I have 2 VF pages.  When I create an Opportunity some values are supposed to be carried over to VFpage1 and VFpage2 is supposed to be a summation of the information in VFpage1.  The problem I am running into is if I create a new opportunity and then go straight to VFpage2, the summation information is not updated.  However if I load VFpage1 and then load VFpage2 the information is passed through and summed up correctly.

 

I found that VFpage1's header contains action="{!updateMethod}".  I believe it is this updateMethod that needs to be run before VFpage2 will have the correct information.

 

Is there anyway to call VFpage1.VFpage1ControllerClass.updateMethod from VFPage2?

 

When I add VFpage1ControllerClass.updateMethod to VFpage2ControllerClass I get the DML error.

 

  • March 22, 2012
  • Like
  • 0

I am trying to deploy changes to a production instance... and Im getting the error that says Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required.  I have done almost as much as I can, and it seems like the classes that are bringing the average down are managed code, whos test coverage probably worked a couple years ago but is now outdated and broken.  Is there anyway I can update managed code show its test coverage works again?

 

Or am I barking up the wrong tree and I should just keep trying to find 3 more percent in the code I can edit? 

  • March 16, 2012
  • Like
  • 0

//Im working with some old code...

Team__c tm = new Team__c(ID = ManID);

// Verified that this ID is valid by pasting it into a URL of object type Team__c
        
user u = [select id from user LIMIT 1];
update u;
        
test.starttest();   
ApexPages.StandardController stdController = new ApexPages.StandardController(tm);

RegionalEXT extController = new RegionalEXT(stdController);

// The above line returns error "First argument cannot be null"

// Why is stdController null if tm isnt null?

  • March 15, 2012
  • Like
  • 0

public static testMethod void test1() {
        
        ID TestID = [Select Leader__c FROM Performance__c WHERE Leader__c != null  LIMIT 1].Leader__c;

 

System.QueryException: List has no rows for assignment to SObject

 

What is wrong with this statement?  When I run just this query in the devoloper console it seems to return a row and set the ID, but when I run the test it fails on this same line and gives the error message above.
       

 


  • March 14, 2012
  • Like
  • 0

Im looking to be able to deploy changes from a sandbox to a live instance.  Is there a way I can test this process out before trying it on the live server?

  • March 13, 2012
  • Like
  • 0

I have to deploy changes in a sandbox to the live instance sometime next week.  Is there a way I can test out this deploying process before doing it on something that matters?

  • March 13, 2012
  • Like
  • 0

Already posted this in Apex Dev... which board is better for this type of question?

I am trying to debug a loop inside of an apex class that drives some content for a VF page.

 

public class ClassName{

 public ClassName(ApexPages.StandardController sc) {

System.debug("How do I print from here?")

for loop()

{

System.debug("How do I print from here?")

}

 

What am I doing wrong to not see these debug statements in this class?

  • March 12, 2012
  • Like
  • 0

I am trying to debug a loop inside of an apex class that drives some content for a VF page.

 

public class ClassName{

 public ClassName(ApexPages.StandardController sc) {

System.debug("How do I print from here?")

for loop()

{

System.debug("How do I print from here?")

}

 

What am I doing wrong to not see these debug statements in this class?

  • March 12, 2012
  • Like
  • 0

I have to  write a Test  class  for a batch . . which  calls second batch class through Email handler . ... Second Batch use the data generated by first batch.... I want to know that .  if I write . Database.execute between Test.start and Test.stop in Method....

Does data created by  first batch exist after the Test.stoptest ?......

 

  

Im wondering what the limits are on exporting data from a salesforce org.  I noticed that when scheduling a data export through Setup > Administration Setup > Data Management > Data Export the most frequently scheduled export you can do is once a week.

 

If I create a data loader command line file and use a scheduled .bat to run this command line export every day, or every hour, will there be issues?

 

What if this data loader command line file only exports one object?  What if it exports the whole DB?

 

If someone could give answers for all the different kinds of salesforce editions that would also be fantastic.

 

Thanks

  • April 02, 2012
  • Like
  • 0

There is a select statement inside the begining of the first for loop and there is also a select statement used as part of the conditional of the next for loop.  Do I need to bulkify both of these select statements to avoid 'Too many SOQL queries' ?  

 

Can you guys and girls help me with how to bulkify these loops?  I have trouble with collections in apex :(

 

for(ID user :MYSnapShotUsers)
{
aUserOpp = 0;
BD_Performance__c Isnapshot = [select Sum_of_Open_Opps_2012__c from BD_Performance__c where BD_Name__c = :user LIMIT 1];

for(Rep_Split__c rs : [select Id, Opportunity__c, Opportunity__r.IsWon, User__c, Rep_Percentage__c, Account_ID__c, Opp_Stage__c,Rep_Commission__c, Custom_Split__c, Split__c, Real_Split__c, IsOpen__c, Rep_s_Projected_Amount_for_2012__c, Reps_Credit_Formula__c, Opp_Amount__c, Opp_Probability__c, Opp_Projected_2012__c, Opp_Close_Date__c from Rep_Split__c WHERE User__c = :user AND (IsOpen__c = 1 OR Opp_Close_Date__c >= :SixtyDays)])
{

IF(rs.Rep_s_Projected_Amount_for_2012__c != null)
{
aUserOpp = aUserOpp + rs.Rep_s_Projected_Amount_for_2012__c;
a2012opp = a2012opp + rs.Rep_s_Projected_Amount_for_2012__c;
}
 }
Isnapshot.Sum_of_Open_Opps_2012__c = aUserOpp;
update Isnapshot;
}

 

 

  • March 26, 2012
  • Like
  • 0

I am trying to deploy changes to a production instance... and Im getting the error that says Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required.  I have done almost as much as I can, and it seems like the classes that are bringing the average down are managed code, whos test coverage probably worked a couple years ago but is now outdated and broken.  Is there anyway I can update managed code show its test coverage works again?

 

Or am I barking up the wrong tree and I should just keep trying to find 3 more percent in the code I can edit? 

  • March 16, 2012
  • Like
  • 0

//Im working with some old code...

Team__c tm = new Team__c(ID = ManID);

// Verified that this ID is valid by pasting it into a URL of object type Team__c
        
user u = [select id from user LIMIT 1];
update u;
        
test.starttest();   
ApexPages.StandardController stdController = new ApexPages.StandardController(tm);

RegionalEXT extController = new RegionalEXT(stdController);

// The above line returns error "First argument cannot be null"

// Why is stdController null if tm isnt null?

  • March 15, 2012
  • Like
  • 0

public static testMethod void test1() {
        
        ID TestID = [Select Leader__c FROM Performance__c WHERE Leader__c != null  LIMIT 1].Leader__c;

 

System.QueryException: List has no rows for assignment to SObject

 

What is wrong with this statement?  When I run just this query in the devoloper console it seems to return a row and set the ID, but when I run the test it fails on this same line and gives the error message above.
       

 


  • March 14, 2012
  • Like
  • 0

Im looking to be able to deploy changes from a sandbox to a live instance.  Is there a way I can test this process out before trying it on the live server?

  • March 13, 2012
  • Like
  • 0

Already posted this in Apex Dev... which board is better for this type of question?

I am trying to debug a loop inside of an apex class that drives some content for a VF page.

 

public class ClassName{

 public ClassName(ApexPages.StandardController sc) {

System.debug("How do I print from here?")

for loop()

{

System.debug("How do I print from here?")

}

 

What am I doing wrong to not see these debug statements in this class?

  • March 12, 2012
  • Like
  • 0

I am trying to debug a loop inside of an apex class that drives some content for a VF page.

 

public class ClassName{

 public ClassName(ApexPages.StandardController sc) {

System.debug("How do I print from here?")

for loop()

{

System.debug("How do I print from here?")

}

 

What am I doing wrong to not see these debug statements in this class?

  • March 12, 2012
  • Like
  • 0