You need to sign in to do that
Don't have an account?

Entity is not org-accessible at line 1 column 1
Hello!
I am having an error when I try to save my code. This is stating that the object I am referencing is not accessible. If anyone has any Ideas please let me know! this has me stumped!
trigger AutoCreateCommissionableUser on pymt__PaymentX__c (after insert) {
List<Commissionable_User__c> CU = new List<Commissionable_User__c>();
for (pymt__PaymentX__c newPayment: Trigger.New) {
if (pymt__PaymentX__c.pymt__Contact__c <> null) {
CU.add(new Commissionable_User__c(
RecordTypeId = [select Id from RecordType where Name = 'Payment' and SobjectType = 'Commissionable_User__c'].Id,
Payment__c =Payment.Id,
Commissionable_User__c =pymt__PaymentX__c.Owner.Id ,
Owner=pymt__PaymentX__c.Owner.Id
));
}
}
insert CU;
}
Issue resolved! My call was not correct for my syntax
trigger AutoCreateRecurringCommissionableUser on pymt__Payment_Profile__c (after insert) {
List<Commissionable_User__c> CU = new List<Commissionable_User__c>();
for (pymt__Payment_Profile__c newRecPayment: Trigger.New) {
if (pymt__Payment_Profile__c.pymt__Contact__c <> null) {
CU.add(new Commissionable_User__c(
RecordTypeId = [select Id from RecordType where Name = 'Recurring Payment' and SobjectType = 'Commissionable_User__c'].Id,
Recurring_Payment__c =newRecPayment.Id,
Commissionable_User__c = newRecPayment.CreatedById
));
}
}
insert CU;
}
All Answers
Kevin,
In your for loop, you assign newPayment to the trigger value, but nowhere in the following code do you use newPayment. Perhaps:
Issue resolved! My call was not correct for my syntax
trigger AutoCreateRecurringCommissionableUser on pymt__Payment_Profile__c (after insert) {
List<Commissionable_User__c> CU = new List<Commissionable_User__c>();
for (pymt__Payment_Profile__c newRecPayment: Trigger.New) {
if (pymt__Payment_Profile__c.pymt__Contact__c <> null) {
CU.add(new Commissionable_User__c(
RecordTypeId = [select Id from RecordType where Name = 'Recurring Payment' and SobjectType = 'Commissionable_User__c'].Id,
Recurring_Payment__c =newRecPayment.Id,
Commissionable_User__c = newRecPayment.CreatedById
));
}
}
insert CU;
}