• charleshoward
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
We have a setup where there is a custom object called Competitor.
On our Opportunity page, we have a lookup table field called Primary Competitor (a required field) to the Competitor object called Primary Competitor.
 
I have written a trigger on the Opportunity object that does some evaluations when an Opportunity is inserted/updated.
 
I wrote up a test method to test the trigger. However, I get the following error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
 
 
Basically, this is the code of the test method:
Integer size = 5;
List<Opportunity> opp = new List<Opportunity>();
for (Integer i = 0; i < size; i++)  {
   Opportunity o = new Opportunity();
   o.ownerId = '00530000000kFvU';
   o.name = 'Opportunity Test: ' + i;
   o.Primary_Competitor__c = 'a1K50000000Caz4EAC';
   o.accountId = '0015000000L3FPk';
   o.closeDate = System.today() + 150;
   o.stageName = 'Quotation';
   opp.add(o);
}
insert opp; 
 
When I run the test method I get the error listed above. If I comment out the line that adds the Primary Competitor to the Opportunity, then I do not have the error.
 
I've been looking around as to why the error is happening but I'm not having any luck in solving it. Any advice would be appreciated.
 
Thanks in advance
Warren

Hello,

 

We have Entitlements turned on in a Sandbox environment.  In the Case object there is now a standard field labeled "Entitlement Name", with an API name of "Entitlement".  I've upgraded Eclipse to the latest version, and deleted and re-created my project for the Sandbox environment.

 

I'm trying to pull the Entitlement lookup field into a custom VisualForce page for editing Case records.  The Page uses the Standard Controller with an Extension.  When I add an apex:inputField like this:

 

  <apex:pageBlockSection>

    <apex:inputField value="{!Case.EntitlementId}"/>

  </apex:pageBlockSection>



I get an error message saying "Invalid field EntitlementId for SObject Case"

 

If I go into the Extension, and bring up the autofill list of fields on the private final Case record "EntitlementId" shows up as an available field.  However, if I try to do something to test it's accessibility like:

 

cse.EntitlementId = null;

 

Then I get the same error message saying that EntitlementId is not a valid field for Case.

 

I tried creating the Trigger that is provided in this post: http://wiki.developerforce.com/page/Default_Entitlement_on_Case_with_Triggers and I didn't get an error from it.

 

Does anyone have any idea what's going on here?  I'm inclined to think it's an Eclipse issue, but I'm not sure....

We have overridden the View button on Assets with a VF page.  On the new Asset Detail VF page we included the Cases related list and the associated New button.  The Case New button is also overridden and goes through a VF page that acts as a routing controller and then on to a custom VF Parent Case page.  

 

(Asset:View) -step1-> [VF:AssetDetail] -step2-> (Case:New) -step3-> [VF:CaseRouting] -step4-> [VF:ParentCaseNew]

 

There is code in the controller for the ParentCaseNew screen to pull the Asset id from the url and automatically select the correct Asset in a data table with checkboxes.



If I initiate the process by clicking into an Asset from an Account or from a list of search results, then it doesn't auto-select the Asset when I get to the Parent Case screen even though the parameter for the AssetID is in the url.  

 

On the other hand, if I manually enter the url to view an Asset, or the system routes to the Asset page from another visualforce page, then I can click the New button and the ParentCaseNew screen selects the Asset correctly.

 

I've narrowed it down to the sfdc.override parameter being present in the url of the Asset Detail screen.  If I manually remove this parameter from the url for the Asset Detail page in the address bar and press enter to reload the page, then everything works from there.

 

I've also figured out that even though the url that gets returned in Step 4 doesn't include the sfdc.override parameter, SalesForce automatically sticks it onto the end if the original Asset page's url had it.

 

Does anyone have any idea why this would be causing a problem?  Any ideas how to fix it/work around it?

 

Here's the url for the Asset screen that doesn't work:

http://c.cs4.visual.force.com/apex/AssetDetailViewReplacement?id=02i50000000ngW6&sfdc.override=1

and the url for the version that works:

http://c.cs4.visual.force.com/apex/AssetDetailViewReplacement?id=02i50000000ngW6

 

The url that gets returned from the VF:CaseRouting page in step 4 is:

http://c.cs4.visual.force.com/apex/CasePage?core.apexpages.devmode.url=1&def_account_id=00130000003Z5aQ&def_asset_id=02i50000000ngW6&ent=null

&retUrl=/apex/AssetDetailViewReplacement%3Fid%3D02i50000000ngW6&save_new=null

 

and the url that ends up on the ParentCaseNew page is

http://c.cs4.visual.force.com/apex/CasePage?core.apexpages.devmode.url=1&def_account_id=00130000003Z5aQ&def_asset_id=02i50000000ngW6&ent=null

&retUrl=/apex/AssetDetailViewReplacement%3Fid%3D02i50000000ngW6&save_new=null&sfdc.override=1

 

Thanks for any help!

I'm trying to pull the set of records that are child cases of another case (they reference the parent case through the "Parent" standard field) in one query.  I can't seem to find an __r field name for this though.  I'd like to be able to do this:

 

[select Id, (select Id, Report_Status__c from Case.Parent__r) from Case where Id in :referencedWorkOrders]

 

But Parent__r is not recognized, and I'm unable to find anything about what the field name might be in our Enterprise WSDL, or by using the Apex Explorer.

 

Is this possible?  Is it not supported because the lookup from Child Cases to Parent Cases is between records of the same object?  Anyone have any other ideas for how to do this (in one query)?

 

Thanks!

Hello,

 

We have Entitlements turned on in a Sandbox environment.  In the Case object there is now a standard field labeled "Entitlement Name", with an API name of "Entitlement".  I've upgraded Eclipse to the latest version, and deleted and re-created my project for the Sandbox environment.

 

I'm trying to pull the Entitlement lookup field into a custom VisualForce page for editing Case records.  The Page uses the Standard Controller with an Extension.  When I add an apex:inputField like this:

 

  <apex:pageBlockSection>

    <apex:inputField value="{!Case.EntitlementId}"/>

  </apex:pageBlockSection>



I get an error message saying "Invalid field EntitlementId for SObject Case"

 

If I go into the Extension, and bring up the autofill list of fields on the private final Case record "EntitlementId" shows up as an available field.  However, if I try to do something to test it's accessibility like:

 

cse.EntitlementId = null;

 

Then I get the same error message saying that EntitlementId is not a valid field for Case.

 

I tried creating the Trigger that is provided in this post: http://wiki.developerforce.com/page/Default_Entitlement_on_Case_with_Triggers and I didn't get an error from it.

 

Does anyone have any idea what's going on here?  I'm inclined to think it's an Eclipse issue, but I'm not sure....

I'm trying to pull the set of records that are child cases of another case (they reference the parent case through the "Parent" standard field) in one query.  I can't seem to find an __r field name for this though.  I'd like to be able to do this:

 

[select Id, (select Id, Report_Status__c from Case.Parent__r) from Case where Id in :referencedWorkOrders]

 

But Parent__r is not recognized, and I'm unable to find anything about what the field name might be in our Enterprise WSDL, or by using the Apex Explorer.

 

Is this possible?  Is it not supported because the lookup from Child Cases to Parent Cases is between records of the same object?  Anyone have any other ideas for how to do this (in one query)?

 

Thanks!

Hi All,

 

I have develop follwoing items in sandbox and i need it to deploy on the production.

 

1. Custom object [ with record]

2. Triggers

3. Reocrd types

4. Page layout

5  Approval Process 

 

Please let us know how i can deploy all this items into Production.

 

Thanks,

Deep. 

Hi,

I want to add scroll bar in my data table.

Please help me add a scroll bar in my data table in a Visual force Page.

Regards
Vinod

We have a setup where there is a custom object called Competitor.
On our Opportunity page, we have a lookup table field called Primary Competitor (a required field) to the Competitor object called Primary Competitor.
 
I have written a trigger on the Opportunity object that does some evaluations when an Opportunity is inserted/updated.
 
I wrote up a test method to test the trigger. However, I get the following error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id
 
 
Basically, this is the code of the test method:
Integer size = 5;
List<Opportunity> opp = new List<Opportunity>();
for (Integer i = 0; i < size; i++)  {
   Opportunity o = new Opportunity();
   o.ownerId = '00530000000kFvU';
   o.name = 'Opportunity Test: ' + i;
   o.Primary_Competitor__c = 'a1K50000000Caz4EAC';
   o.accountId = '0015000000L3FPk';
   o.closeDate = System.today() + 150;
   o.stageName = 'Quotation';
   opp.add(o);
}
insert opp; 
 
When I run the test method I get the error listed above. If I comment out the line that adds the Primary Competitor to the Opportunity, then I do not have the error.
 
I've been looking around as to why the error is happening but I'm not having any luck in solving it. Any advice would be appreciated.
 
Thanks in advance
Warren