• Mystwalker
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies

I've tried a couple solutions found on the boards but I always seem to get CANNOT_INSERT_UPDATE.. error when I try to update a field on a parent object from a ''after update'' or ''after insert'' trigger on the child (''before update'' or ''before insert'' doesn't work).

 

I've put an quick example of how I've made my trigger:

 

trigger opp_update on Child_Object__c (after update, after insert) {

for( Child_Object__c child: Trigger.new){
 ID parent_ID= child.Opportunity__c;
 

Opportunity opp_to_update= [select field_to_update__c from Opportunity where id =: parent_ID];
 opp_to_update.
field_to_update__c = 7777;
 

update opp_to_update;
 }
 
}

 

Does someone have a quick tip to help me solve this?

I've made some changes last week on some of my Appex classes and this morning with the same configuration and when I try to save my changes on the server I get this error message:

 

File only saved locally, not to server

 

So I've created a new project, a new workfolder and  made a checkout of everything and without even changing the code, I still get this error. I have some Appex pages too, but they work fine (compile ans save on server).

 

I notice on ''Monitor Deployment'' that the deployment status is supposedly completed and all my classes have the API version 15 but when I create new classes I can only select API version 16 now. Is this related to my problem?

 

Does some of you knows a good way to fix this?

I'm trying to change a public variable (every function and variable I use are public) :

 

public Integer indexs{get{return index;}set{index= value;}}

 

from my visualforce page with (only this one):

 

<apex:param name="opt" value="0" />

 

I try to update the variable indexs within this function:

 

   public string gethtmltags(){
         if (index==null){index=0;}
          String indexs =ApexPages.currentPage().getParameters().get('opt');
       index = integer.valueof(indexs);

       toOpp ='https://na4.salesforce.com/' + oppList[index].Id;
       coo = ((978-21)*(((opplist[index].Amount-Amountcheck)/(maxamount-Amountcheck)))+21)+','+((282-35)*(1-(oppList[index].Probability)/100)+35)+',6';
    return null;}

 

but when I output the content of indexs it's always null.

 

I would like to know if some of you knows a good way to change  a public variable from a visualforce page.

 

thanks

I've seen a few posts concerning this subject, but is there an alternate way to fetch a conversion rate for money on an web site and save it in a variable to use it in reports?

 

I'm really interested to know if someone knows a good or better method to this or something really close,

 

thanks.

I've created a controller for a custom object to retrieved every contact related to the account that is related to my custom object.

 

                 Account

              ^            |

             /              |

            /               v

Custom_Object     Contact

 

But, I can't fix my the account Id to search for in the SOQL. I get a Illegal assignement for my code below but, I don't seem to find the good way to do it. Does someone has a good hint to help me start?

 

 

public class addon {
  private final Meeting_Preparation__c Meeting_PreparationObj;
  public addon(ApexPages.StandardController controller) {
    this.Meeting_PreparationObj = (Meeting_Preparation__c)controller.getSubject();
  }

  public Meeting_Preparation__c[] getRelatedContact() {
       ID Custom_Account_ID = Meeting_Preparation__c.Account__r.id;
    Contact[] contactList =
      [ SELECT Name, Title, MobilePhone, Relationship__c, Owner.Name, CreatedBy.Name

        FROM Contact

        WHERE Account.Id = :Custom_Account_ID];
 

   return contactList;
 }
}

I created an custom object to quickly generate a meeting briefing and

I'm currently using this line of code to display opportunities, contacts and activities related to an account:

 

<apex:detail subject="{!Account_Review__c.Account__r.Id}" relatedListHover="true"  />

 

But I would like to access each of these informations (opportunities, contacts and activities) seperatly at different sections in my review instead of all of it at the end. I would also like to be able to display all informations without the need to press "show more" severals times. 

 

Is there someway to do that with the professional edition using visualforce?

I've tried a couple solutions found on the boards but I always seem to get CANNOT_INSERT_UPDATE.. error when I try to update a field on a parent object from a ''after update'' or ''after insert'' trigger on the child (''before update'' or ''before insert'' doesn't work).

 

I've put an quick example of how I've made my trigger:

 

trigger opp_update on Child_Object__c (after update, after insert) {

for( Child_Object__c child: Trigger.new){
 ID parent_ID= child.Opportunity__c;
 

Opportunity opp_to_update= [select field_to_update__c from Opportunity where id =: parent_ID];
 opp_to_update.
field_to_update__c = 7777;
 

update opp_to_update;
 }
 
}

 

Does someone have a quick tip to help me solve this?

I've made some changes last week on some of my Appex classes and this morning with the same configuration and when I try to save my changes on the server I get this error message:

 

File only saved locally, not to server

 

So I've created a new project, a new workfolder and  made a checkout of everything and without even changing the code, I still get this error. I have some Appex pages too, but they work fine (compile ans save on server).

 

I notice on ''Monitor Deployment'' that the deployment status is supposedly completed and all my classes have the API version 15 but when I create new classes I can only select API version 16 now. Is this related to my problem?

 

Does some of you knows a good way to fix this?

I've created a controller for a custom object to retrieved every contact related to the account that is related to my custom object.

 

                 Account

              ^            |

             /              |

            /               v

Custom_Object     Contact

 

But, I can't fix my the account Id to search for in the SOQL. I get a Illegal assignement for my code below but, I don't seem to find the good way to do it. Does someone has a good hint to help me start?

 

 

public class addon {
  private final Meeting_Preparation__c Meeting_PreparationObj;
  public addon(ApexPages.StandardController controller) {
    this.Meeting_PreparationObj = (Meeting_Preparation__c)controller.getSubject();
  }

  public Meeting_Preparation__c[] getRelatedContact() {
       ID Custom_Account_ID = Meeting_Preparation__c.Account__r.id;
    Contact[] contactList =
      [ SELECT Name, Title, MobilePhone, Relationship__c, Owner.Name, CreatedBy.Name

        FROM Contact

        WHERE Account.Id = :Custom_Account_ID];
 

   return contactList;
 }
}