• RachaelC
  • NEWBIE
  • 0 Points
  • Member since 2012

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


Here is my code: 


                            <apex:selectList id="conlist" value="{!o.Partner_Contact__c}" size="1" style="width:160px">
                                <apex:repeat value="{!PartnerContactsNew}" var="Lists">
                                    <apex:repeat value="{!Lists}" var="list">
                                        <selectOptions value="{!list.value}">{!list.Label}</selectOptions>
                                    </apex:repeat>
                                </apex:repeat>
                            </apex:selectList>

Can someone please take a look as I am not sure what I am missing here. Thanks! 

I don't understand my compile error, any ideas? see error line below in red (

Error: Compile Error: expecting a semi-colon, found '(' at line 55 column 29)

 

public class ProductRenewalInformationPageController {

public account a {get;set;}
public Boolean editMode {get;set;}
public Boolean editAccess {get;set;}
public Boolean isAdmin {get;set;}

public productRenewalInformationPageController(ApexPages.standardController std){

editMode = false;
if(a == null) a = [
SELECT name, OwnerId, CreatedDate, Product_Domain_Protect__c, Product_EIS_Gold__c, Product_EIS_Platinum__c,
Product_Certification__c, Product_Additional_AM_Services__c,Product_Email_Client_Monitor__c, Product_Professional_Services__c,
Product_EIS_Internal_Use__c, Product_General_Referral__c,Product_EIS_Child__c, Product_Tools_Reseller_API__c, Product_Cert_Referral_Framework__c,
Product_Certification_Referral_Child__c, Product_Tools_Reseller_Framework__c,Product_Inbox_Insight__c, Product_Email_Brand_Monitor__c, Product_Email_Brand_Monitor_Child__c,
Product_Domain_Protect_Child__c, Product_Domain_Secure__c, Product_Domain_Secure_Child__c
FROM account WHERE id = :ApexPages.currentPage().getParameters().get('id')
];

//determine if user can make changes

user u =[select id, profile.name from user where id = :userinfo.getuserid()];

if(u.profile.name == 'Exec Admin' || u.profile.name == 'Finance'){
isAdmin = true;
} else {isAdmin = false;}

if(isAdmin == true){
editAccess = true;
} else {editAccess = false;}

{

// only proceed if the user has edit rights
if(editAccess = true) {

//editMode is used as a view state variable (only Admin and Finance can edit) Initializes as false but once true page rerenders to display inputfields rather than output fields
if(editMode == false) {
editMode = true;
} else {
// this part of the code is where any values that were entered by the use are saved
editMode = false;

update a;
return null;

}

} else {
if(editAccess == false) ApexPages.addMessage (new ApexPages.Message(ApexPages.Severity.ERROR,'You are not authorized to make changes to this page.'));
return null;
}
}

public PageReference save() {
update a;
return (new ApexPages.StandardController(account)).view();
}


}

Here is my code... for some reason, if I don't include the first line, then I get an error that "void" is not recognizable...

However I am getting this directly from DeveloperForce Guide so I am sure that it's me who is incorrect... So, I added the first line but even though now my code will save without giving me an error BUT the word upsert at line 24 should be blue, because it's a DML operation... so why isn't it? I am SO new to writing code so please forgive if this is a very novice question... I am writing this as a class...maybe it is really the trigger?

 

 

public class CreateAssetFromOli {

    public void upsertExample() {

    Opportunity opp = [SELECT Id, Name, AccountId, StageName,

                            (SELECT Id, PricebookEntry.Product2Id, PricebookEntry.Name

                             FROM OpportunityLineItems)

                       FROM Opportunity

                       WHERE HasOpportunityLineItem = true and StageName = 'Finance Approved'

                       LIMIT 1];

                      

    Asset[] assets = new Asset[]{};

 

    // Create an asset for each line item on the opportunity

    for (OpportunityLineItem lineItem:opp.OpportunityLineItems) {

 

        //This code populates the line item Id, AccountId, and Product2Id for each asset

        Asset asset = new Asset(Name = lineItem.PricebookEntry.Name,

                                Line_Item_ID__c = lineItem.Id,

                                AccountId = opp.AccountId,

                                Product2Id = lineItem.PricebookEntry.Product2Id);

                                assets.add(asset);

    }

   

    try {

        upsert assets Line_Item_ID__c;  // This line upserts the assets list with

                                        // the Line_Item_Id__c field specified as the

                                        // Asset field that should be used for matching

                                        // the record that should be upserted.

    } catch (DmlException e) {

        System.debug(e.getMessage());

        }

    }

}

I want to be able to have a custom object or summarize on the Account object (via VisualForce page to be viewed as a tab), which products have been purchased by each client.
I want the information regarding a certain product's current value and start and end dates for the products to always relate to the latest opportunity that includes that particular product line item.

The end dates will be used to triigger generation of renewal opportunties 90 or 180 days prior to the expiration of the end dates...

Has anyone accomplished this or something similar?

 

Thanks,

 

Rachael

My instance of Salesforce shows that I am using only 5.96% of Apex, but at the same time, I am getting this error:

 

System.Exception: Too many script statements: 200001
[statusCode] => CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

 

Are these things totally independent of one another?

 

How can I find out how many script statements I have? Do inactive triggers and classes count against me?

 

Thanks for the help!

 

Rachael

 

Hello all -

I am trying to merge two accounts. Both the accounts, I am using a describe call to get all the fields. In my scenario I am checking if the master account has blank values in any of the fields, I am filling it with the losing account values. However when I merge (Database.merge(masteraccount,loseraccount), I get this error:

salesforce MERGE_FAILED, Invalid field IsPartner for merge: []

I checked few forums, but hardly got anything online.

Can anyone throw some light?

Regards,
Priyanka.

I want to be able to have a custom object or summarize on the Account object (via VisualForce page to be viewed as a tab), which products have been purchased by each client.
I want the information regarding a certain product's current value and start and end dates for the products to always relate to the latest opportunity that includes that particular product line item.

The end dates will be used to triigger generation of renewal opportunties 90 or 180 days prior to the expiration of the end dates...

Has anyone accomplished this or something similar?

 

Thanks,

 

Rachael