• chuk2
  • NEWBIE
  • 60 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

I have a visualforce page that creates a new user and contact, I'm updating the controller class to also add a sharing rule for the new user. However, I am now getting the error "Entity is not org-accessible". I'm told this error is due to typing in an entity wrong, like only 1 _ or such but I simply can not find the typo in my code. Any help or ideas? 

 

here is the new code that is causing the error. 

 

 

Volunteer__Share vShare = new Volunteer__Share();
vShare.ParentId = vID; // The volunteer record that we need to give access to.
vShare.UserOrGroupId = u.Id; // The user to which access is being granted
vShare.AccessLevel = 'Edit';
vShare.RowCause = Schema.Volunteer__Share.RowCause.Contact__c;
Database.SaveResult insertResults = Database.insert(vShare,false); // The false parameter allows for partial processing if multiple records passed into the operation.
// Error handling - did the insert work as intended.
if(insertResults.isSuccess()){ // Indicates success
System.debug('Recrords for BookShare inserted successfully'); 
}

 

  • June 29, 2012
  • Like
  • 0

I have made a portal whose purpose is to allow volunteers for a non-profit to log in and make changes to their contact information and schedule. However they currently have view and edit permissons for all volunteers. I have each contact associated with a specific volunteer via a look up field, but i'm not sure where to make a change so that each portal user can only view their own volunteer record. 

 

Any help would be appriciated. 

  • June 27, 2012
  • Like
  • 0

Could a hand, this save error is rather vague and does not give a line number (line 0). Save error: Expression cannot be assigned. I am making a trigger that takes a zip code from a record and fills in the district based of a table of zip codes and districts. 

 

trigger VolunteerBeforeInsert on Volunteer__c (before insert) {

for(Volunteer__c a: Trigger.new) {
if (a.District__c == Null && a.Zip_Code__c != Null) {
string sZip = a.Zip_Code__c;
Zip_Code__c oZip = [SELECT Name, District__c FROM Zip_Code__c WHERE Zip_Code__c.Name = :sZip LIMIT 1].get(0);
Distric__c oDistrict = [SELECT id FROM District__c WHERE District__c.Name = :oZip.District__c LIMIT 1];
volunteer__c.District__c = oDistrict.id;
}
}

}

  • May 30, 2012
  • Like
  • 0

Hello, I'm a bit new to sales force. I'm doing a one time update and insert to our custom object that tracks volunteers. There are about 550 records, of which about 100 are updates. I split the csv into two parts, one for updates and one for inserts. When I try update the records, it skipps all of them for being new. I assume the problem is that I am using the Volunteer ID which is the name field and is an autonumber.   

Currently the Volunteer ID's start at 000142 and go to 000305, there is no prefix or anything and I've tried making the column formatted to include the leading zeros or not to. I'm a bit stumped and any help would be good. 

  • May 23, 2012
  • Like
  • 0

I have a visualforce page that creates a new user and contact, I'm updating the controller class to also add a sharing rule for the new user. However, I am now getting the error "Entity is not org-accessible". I'm told this error is due to typing in an entity wrong, like only 1 _ or such but I simply can not find the typo in my code. Any help or ideas? 

 

here is the new code that is causing the error. 

 

 

Volunteer__Share vShare = new Volunteer__Share();
vShare.ParentId = vID; // The volunteer record that we need to give access to.
vShare.UserOrGroupId = u.Id; // The user to which access is being granted
vShare.AccessLevel = 'Edit';
vShare.RowCause = Schema.Volunteer__Share.RowCause.Contact__c;
Database.SaveResult insertResults = Database.insert(vShare,false); // The false parameter allows for partial processing if multiple records passed into the operation.
// Error handling - did the insert work as intended.
if(insertResults.isSuccess()){ // Indicates success
System.debug('Recrords for BookShare inserted successfully'); 
}

 

  • June 29, 2012
  • Like
  • 0

Could a hand, this save error is rather vague and does not give a line number (line 0). Save error: Expression cannot be assigned. I am making a trigger that takes a zip code from a record and fills in the district based of a table of zip codes and districts. 

 

trigger VolunteerBeforeInsert on Volunteer__c (before insert) {

for(Volunteer__c a: Trigger.new) {
if (a.District__c == Null && a.Zip_Code__c != Null) {
string sZip = a.Zip_Code__c;
Zip_Code__c oZip = [SELECT Name, District__c FROM Zip_Code__c WHERE Zip_Code__c.Name = :sZip LIMIT 1].get(0);
Distric__c oDistrict = [SELECT id FROM District__c WHERE District__c.Name = :oZip.District__c LIMIT 1];
volunteer__c.District__c = oDistrict.id;
}
}

}

  • May 30, 2012
  • Like
  • 0

Hello, I'm a bit new to sales force. I'm doing a one time update and insert to our custom object that tracks volunteers. There are about 550 records, of which about 100 are updates. I split the csv into two parts, one for updates and one for inserts. When I try update the records, it skipps all of them for being new. I assume the problem is that I am using the Volunteer ID which is the name field and is an autonumber.   

Currently the Volunteer ID's start at 000142 and go to 000305, there is no prefix or anything and I've tried making the column formatted to include the leading zeros or not to. I'm a bit stumped and any help would be good. 

  • May 23, 2012
  • Like
  • 0