• Harsh Dhruv 10
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
<apex:page standardController="Quote" extensions="abcController" sidebar="false">
    
    <apex:detail />
    
    <div class="relatedList">
        <apex:relatedList list="QuoteDocuments" rendered="{!$User.Quote__c != 'STD' || $User.Quote__c == ''}"/>
        <apex:relatedList list="ActivityHistories" rendered="{!$User.Quote__c != 'STD' || $User.Quote__c == ''}"/>
    </div>
    
</apex:page>


I have two different user and both have different profile as mentioned below,

1. User - Nail
   Profile - Company Manager
2. User - Cristiana
   Profile - System Administrator

for 1st User it's working fine as expected but when i login using 2nd user it will give me an error :

 'ActivityHistories' is not a valid child relationship name for entity Quote

Can anybody know about this ? what's wrong in profile or code ?
 
I have the following apex method and this method i am going to use in custom detail button but the problem is it will give me an error as following :

User-added image


Apex Method :
 
public pagereference StartSync(){
    try{
        opp = [Select Id, AccountId from Opportunity where id =: Quote.OpportunityId];

        opp.SyncedQuoteId = Quote.Id;
        opp.Tax__c = Quote.Tax__c;
        opp.Freight_Amount__c = Quote.Freight__c;

        update opp;
        pagereference pg = new Pagereference('/apex/QuoteDetail?id='+this.Quote.Id);
        pg.setRedirect(true);
        return pg;
    }Catch(Exception e){
        return null;
    }
}

Javascript :
 
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} 
sforce.apex.execute("QuoteGroupCreateController","StartSync",{});



Can anybody tell what i am doing wrong in this ?