• Seth Partridge
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Trying to create an Apex trigger that updates the Opportunity splits to evenly distribute the percentage of the sale to each Opportunity Team Member. I'm using a split that validates to 100%, and I'm getting this error every time, even though it adds up to 100%.

I was getting an error with the trigger, so I looked up the split records (2 team member, 35% and 65%) that I created manually on the opportunity with a SOQL Query.  I tried editing the individual split records to 100 and 0 percent. I get the following error when I click Save Rows. This was the same error I was getting in my trigger.

User-added image

​​​​​​​Thanks for your help!
I keep getting this error, and don't know why - help! :
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_ARGUMENT_TYPE, The argument is null or invalid.: []

when I run this test:
@istest 
public class UpdateCheckboxAgreementContentDocTest {
    @isTest static void testcheckboxaddPDFcd() {
        // Insert Company
        Account acc=new Account(name='testing');
        insert acc;
        // Insert Contact
        Contact con=new contact(lastname='testinggvs',accountid=acc.id,leadsource='Walk In');
        insert con;
        // Insert Pricebook
        Pricebook2 pb = new Pricebook2(name='test',IsActive = true);
        insert pb;
        // Get Standard Pricebook
        Pricebook2 standardPB = new Pricebook2(
            Id = Test.getStandardPricebookId(),
            IsActive = true
        );
        // Insert Product Agreement Terms
        Product_Agreement_Terms__c pat = new Product_Agreement_Terms__c(name = 'MAP');
        insert pat;
        // Insert Product
        Product2 p = new Product2(Name='MAP Build',Productcode='MACP',Product_Agreement_Terms__c=pat.Id,IsActive = true);
        insert p;
        // Insert Standard Pricebook Entry
        PricebookEntry standardPBE = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = standardPB.Id,UnitPrice = 0,IsActive = true);
        insert standardPBE;
        // Insert Pricebook Entry
        PricebookEntry pbe = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = pb.Id,UnitPrice = 0,IsActive = true);
        insert pbe;
        // Insert Opportunity
        Opportunity opp = new Opportunity(Name='AAA Test',StageName='Agreement Sent', CloseDate=date.parse('02/02/2018'),MAP_Start_Date__c=date.parse('02/02/2018'),MAP_End_Date__c=date.parse('02/02/2018'),Pricebook2Id = pb.Id,Payment_Method__c='Interac',Signing_Contact__c=con.id,accountid=acc.id);
        insert opp; 
        // Insert Opportunity Line Item
        OpportunityLineItem oli = new OpportunityLineItem(OpportunityId = opp.Id,UnitPrice = 1,Quantity = 1,Product2Id = p.Id);
        insert oli;
        // Insert CD to opportunity
        ContentVersion contentVersion1 = new ContentVersion(Title = 'ContentAgreement0',PathOnClient = 'ContentAgreement0.pdf',VersionData = Blob.valueOf('Test Content'),IsMajorVersion = true,ContentLocation='S ');
        system.debug('contentVersion Value equals: '+ contentVersion1);
        insert contentVersion1;
    }
    @isTest static void testcheckboxremovePDFcd() {
        // Insert Company
        Account acc=new Account(name='testing');
        insert acc;
        // Insert Contact
        Contact con=new contact(lastname='testinggvs',accountid=acc.id,leadsource='Walk In');
        insert con;
        // Insert Pricebook
        Pricebook2 pb = new Pricebook2(name='test',IsActive = true);
        insert pb;
        // Get Standard Pricebook
        Pricebook2 standardPB = new Pricebook2(
            Id = Test.getStandardPricebookId(),
            IsActive = true
        );
        // Insert Product Agreement Terms
        Product_Agreement_Terms__c pat = new Product_Agreement_Terms__c(name = 'MAP');
        insert pat;
        // Insert Product
        Product2 p = new Product2(Name='MAP Build',Productcode='MACP',Product_Agreement_Terms__c=pat.Id,IsActive = true);
        insert p;
        // Insert Standard Pricebook Entry
        PricebookEntry standardPBE = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = standardPB.Id,UnitPrice = 0,IsActive = true);
        insert standardPBE;
        // Insert Pricebook Entry
        PricebookEntry pbe = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = pb.Id,UnitPrice = 0,IsActive = true);
        insert pbe;
        // Insert Opportunity
        Opportunity opp = new Opportunity(Name='AAA Test',StageName='Agreement Sent', CloseDate=date.parse('02/02/2018'),MAP_Start_Date__c=date.parse('02/02/2018'),MAP_End_Date__c=date.parse('02/02/2018'),Pricebook2Id = pb.Id,Payment_Method__c='Interac',Signing_Contact__c=con.id,accountid=acc.id);
        insert opp; 
        // Insert Opportunity Line Item
        OpportunityLineItem oli = new OpportunityLineItem(OpportunityId = opp.Id,UnitPrice = 1,Quantity = 1,Product2Id = p.Id);
        insert oli;
        // Insert ContentVersion to opportunity       
 	    ContentVersion contentVersion = new ContentVersion(
            Title = 'ContentAgreement1',
            PathOnClient = 'ContentAgreement1.pdf',
            VersionData = Blob.valueOf('Test Content'),
            IsMajorVersion = true
        );
        insert contentVersion;
        contentVersion = [Select ContentDocumentId from contentVersion where Title= 'ContentAgreement1'];
        ContentDocument cd = new ContentDocument(id=contentVersion.ContentDocumentId);
        // Insert ContentVersion2 to opportunity       
        ContentVersion contentVersion2 = new ContentVersion(
            Title = 'ContentAgreement2',
            PathOnClient = 'ContentAgreement2.jpg',
            VersionData = Blob.valueOf('Test Content'),
            IsMajorVersion = true
        );
        insert contentVersion2;
        contentVersion2 = [Select ContentDocumentId from contentVersion where Title= 'ContentAgreement2'];
        ContentDocument cd2 = new ContentDocument(id=contentVersion2.ContentDocumentId);
        //Create and populate review opportunity record
        Opportunity oppReview =  new Opportunity();
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('Content Added, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==True);
        // Delete ContentDocument
        delete cd;
        //Populate review opportunity record
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('cd deleted, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==False);
        // Delete ContentDocument2
        delete cd2;
        //Populate review opportunity record
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('cd2 deleted, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==False);
    }
}


for this trigger:
trigger UpdateCheckboxAgreementContentDocument on ContentDocument (after insert, after delete) {
    Set<Id> setOpportunityId = new Set<Id>();
    List<Opportunity> lstOpp = new List<Opportunity>();
    if (Trigger.isInsert) {
        for(ContentDocument cd: trigger.new){
            // this 006 check was in the sample code I found
            if(String.valueOf(cd.ParentId).startsWith('006')) {
                setOpportunityId.add(cd.ParentId); 
            }
            // Check ContentDocument to see if PDF
            if(cd.FileExtension.endsWithIgnoreCase('pdf')) {
                for(Opportunity opp: [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id IN:setOpportunityId]){
                    // check the box on the opportunity
                    opp.Agreement_Attached_as_Content_Document__c = True;
                    // add the opportunity to the list variable to update
                    lstOpp.add(opp);
                }
            }
        }
    }
    else if (Trigger.isDelete) {
        //new id variable for checking in delete scenario
        id oppId = null;
        boolean PDFStillAttached = null;
        for(ContentDocument cd: trigger.old){
            // this 006 check was in the sample code I found
            if(String.valueOf(cd.ParentId).startsWith('006')) {
                oppId = cd.ParentId; 
            }
            // Check other ContentDocuments to see if there are any other PDFs attached
            List<ContentDocument> lstCds = ([SELECT ID, FileExtension From ContentDocument where ParentId=:oppId]);
            if (lstCds.size()>0) {
                for (ContentDocument lstCd: lstCds) {
                    if(lstCd.FileExtension.endsWithIgnoreCase('pdf')) {
                        PDFStillAttached = True;
                    }
                }
                for(Opportunity opp: [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id IN:setOpportunityId]){
                    // check the box on the opportunity
                    If(PDFStillAttached=True){
                        opp.Agreement_Attached_as_Content_Document__c = True;
                    }
                    else {
                        opp.Agreement_Attached_as_Content_Document__c = False;
                    }
                    // add the opportunity to the list variable to update
                    lstOpp.add(opp);
                }
            }
            else {
                Opportunity opp= [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id=:oppId];
                    opp.Agreement_Attached_as_Content_Document__c = False;
                // add the opportunity to the list variable to update
                lstOpp.add(opp);
                system.debug('lstOpp equals: '+ lstOpp);
            }
        }
    }
    // Update opportunity if opportunity list size greater than 0
    if(lstOpp.size()>0) {
        update lstOpp;
                system.debug('lstOpp updated: '+ lstOpp);
    }
}

 
Hi,

I'm trying to get an sObject list that I'm creating in my Apex controller to output on a VisualForce page, but nothing is appearing on my VisualForce page. Can you help? :)

Also, I can see debug logs for my Visualforce page, but not for the Apex controller. Is it possible to view Apex controller debug logs?

Thanks for your help!

Controller code
public class OpportunityPDFController {
    public contact con{get;set;}
    public Opportunity opp{get;set;}
    public MAP_Submission__c mapsub{get;set;}
    public signature__signature__c sig;
    public String attachmentid { get; set; }
   	//variable to add terms to in loop
    public List<Product_Agreement_Terms__c> signingterms{ get; set; }
    public OpportunityPDFController(Apexpages.StandardController controller){
        Id oppId = ApexPages.currentPage().getParameters().get('parentid');
        Id sigId = ApexPages.currentPage().getParameters().get('Id');
        if(oppId<>null && sigId==null){
            try{
                opp=[select id,name,Rich_Terms__c,amount,account.name,account.Legal_Business_Name__c,account.billingstreet,account.billingcity,account.billingstate,account.billingcountry,account.billingpostalcode,Payment_Method__c,Credit_Card_Number__c,Credit_Card_Expiry_Date__c,CV_Code__c,Name_On_Card__c from opportunity where id=:oppId];
                List<OpportunityLineItem> l_co = [SELECT Id, Product2Id FROM OpportunityLineItem WHERE OpportunityId = :opp.Id];
				Set<Id> products= new Set<Id>();
                for(OpportunityLineItem am_co : l_co) {
                    if (products.contains(am_co.Product2Id)) {
                        system.debug('product Found');
                    }
                    else{
                        products.add(am_co.Product2Id);
                        system.debug('Product missing loop id added: ' + products); 
                    }
                }
                //Create Sku tracking variable
                product2 sku = new product2();
                //Create Product Agreement Terms Set variable
                Set<Id> pats= new Set<Id>();
                for(Id pId : products) {
                    product2 p = [SELECT Product_Agreement_Terms__c, ProductCode FROM Product2 WHERE Id = :pId ];
                    //asign loop varaible to outer variable
                    sku = p;
                    system.debug('p PID = ' + p.Product_Agreement_Terms__c);
                    system.debug('p Sku = ' + p.ProductCode);
                    if (pats.contains(p.Product_Agreement_Terms__c)) {
                        system.debug('Product Terms Found: ' + p.ProductCode);
                    }
                    else{
                        pats.add(p.Product_Agreement_Terms__c);
                        system.debug('Product terms missing loop id added: ' + pats + ' ' + p.ProductCode); 
                    }
                }

                //review set of terms and compile them in the terms variable ---- Loop to add only MACP
                for(String patId : pats) {
                    //Create a new ProductAgreementTerms variable
                    Product_Agreement_Terms__c t = [SELECT Id,Rich_Terms__c,Understand_Checkbox_Required__c FROM Product_Agreement_Terms__c WHERE ID =:patId];
                    //Update terms variable with existing terms, line break, and new terms
                    if (sku.ProductCode=='MACP') {
						signingterms.add (t);
                        system.debug('t = ' + t + ' and signingterms = ' + signingterms);
                    }
                    else {}
                }
                
				//review set of terms and compile them in the terms variable ---- Loop to add only MAPI
                for(String patId : pats) {
                    //Create a new ProductAgreementTerms variable
                    Product_Agreement_Terms__c t = [SELECT Id,Rich_Terms__c,Understand_Checkbox_Required__c FROM Product_Agreement_Terms__c WHERE ID =:patId];
                    //Update terms variable with existing terms, line break, and new terms
                    if (sku.ProductCode=='MAPI') {
						signingterms.add (t);
                         system.debug('t = ' + t + ' and signingterms = ' + signingterms);
                    }
                    else {}
                }                
                //review set of terms and compile them in the terms variable ---- Loop to add everything else
                for(String patId : pats) {
                    //Create a new ProductAgreementTerms variable
                    Product_Agreement_Terms__c t = [SELECT Id,Rich_Terms__c,Understand_Checkbox_Required__c FROM Product_Agreement_Terms__c WHERE ID =:patId];
                    //Update terms variable with existing terms, line break, and new terms
					signingterms.add (t);
                     system.debug('t = ' + t + ' and signingterms = ' + signingterms);
                }
                
               
                
            }
            catch(Exception e){system.debug('$$$Exception :'+e);}
            try{
                mapsub=[select id,name,Client_Contact__r.name,Client_Email__c,Client_Phone_1__c	,Client_Phone_1_Ext__c,Invoice_Recipient__r.name,Invoice_Recipient_Email__c,Invoice_Recipient_Phone__c,Invoice_Recipient_Phone_Extension__c,Map_Link__c from MAP_Submission__c where MAP_Opportunity__c=:opp.id];              
            }
            catch(Exception e){system.debug('$$$Exception :'+e);}
        }

VF Page Code
<apex:page standardController="signature__Signature__c" extensions="OpportunityPDFController" id="pg"  docType="html-5.0" standardStylesheets="true">

<!-- other code preceeding this trimmed --

 <apex:repeat value="{!signingterms}" var="term" id="theRepeat">
    				    <apex:outputText value="{!term.Rich_Terms__c}" id="theValue" escape="false" /><br/>
                        <apex:form>
                        	<apex:inputCheckbox label="I understand and agree" rendered="{!term.Understand_Checkbox_Required__c!=False}" />
                        </apex:form>
    				</apex:repeat>

I keep getting this error, and don't know why - help! :
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_ARGUMENT_TYPE, The argument is null or invalid.: []

when I run this test:
@istest 
public class UpdateCheckboxAgreementContentDocTest {
    @isTest static void testcheckboxaddPDFcd() {
        // Insert Company
        Account acc=new Account(name='testing');
        insert acc;
        // Insert Contact
        Contact con=new contact(lastname='testinggvs',accountid=acc.id,leadsource='Walk In');
        insert con;
        // Insert Pricebook
        Pricebook2 pb = new Pricebook2(name='test',IsActive = true);
        insert pb;
        // Get Standard Pricebook
        Pricebook2 standardPB = new Pricebook2(
            Id = Test.getStandardPricebookId(),
            IsActive = true
        );
        // Insert Product Agreement Terms
        Product_Agreement_Terms__c pat = new Product_Agreement_Terms__c(name = 'MAP');
        insert pat;
        // Insert Product
        Product2 p = new Product2(Name='MAP Build',Productcode='MACP',Product_Agreement_Terms__c=pat.Id,IsActive = true);
        insert p;
        // Insert Standard Pricebook Entry
        PricebookEntry standardPBE = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = standardPB.Id,UnitPrice = 0,IsActive = true);
        insert standardPBE;
        // Insert Pricebook Entry
        PricebookEntry pbe = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = pb.Id,UnitPrice = 0,IsActive = true);
        insert pbe;
        // Insert Opportunity
        Opportunity opp = new Opportunity(Name='AAA Test',StageName='Agreement Sent', CloseDate=date.parse('02/02/2018'),MAP_Start_Date__c=date.parse('02/02/2018'),MAP_End_Date__c=date.parse('02/02/2018'),Pricebook2Id = pb.Id,Payment_Method__c='Interac',Signing_Contact__c=con.id,accountid=acc.id);
        insert opp; 
        // Insert Opportunity Line Item
        OpportunityLineItem oli = new OpportunityLineItem(OpportunityId = opp.Id,UnitPrice = 1,Quantity = 1,Product2Id = p.Id);
        insert oli;
        // Insert CD to opportunity
        ContentVersion contentVersion1 = new ContentVersion(Title = 'ContentAgreement0',PathOnClient = 'ContentAgreement0.pdf',VersionData = Blob.valueOf('Test Content'),IsMajorVersion = true,ContentLocation='S ');
        system.debug('contentVersion Value equals: '+ contentVersion1);
        insert contentVersion1;
    }
    @isTest static void testcheckboxremovePDFcd() {
        // Insert Company
        Account acc=new Account(name='testing');
        insert acc;
        // Insert Contact
        Contact con=new contact(lastname='testinggvs',accountid=acc.id,leadsource='Walk In');
        insert con;
        // Insert Pricebook
        Pricebook2 pb = new Pricebook2(name='test',IsActive = true);
        insert pb;
        // Get Standard Pricebook
        Pricebook2 standardPB = new Pricebook2(
            Id = Test.getStandardPricebookId(),
            IsActive = true
        );
        // Insert Product Agreement Terms
        Product_Agreement_Terms__c pat = new Product_Agreement_Terms__c(name = 'MAP');
        insert pat;
        // Insert Product
        Product2 p = new Product2(Name='MAP Build',Productcode='MACP',Product_Agreement_Terms__c=pat.Id,IsActive = true);
        insert p;
        // Insert Standard Pricebook Entry
        PricebookEntry standardPBE = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = standardPB.Id,UnitPrice = 0,IsActive = true);
        insert standardPBE;
        // Insert Pricebook Entry
        PricebookEntry pbe = new PricebookEntry(Product2Id = p.Id,Pricebook2Id = pb.Id,UnitPrice = 0,IsActive = true);
        insert pbe;
        // Insert Opportunity
        Opportunity opp = new Opportunity(Name='AAA Test',StageName='Agreement Sent', CloseDate=date.parse('02/02/2018'),MAP_Start_Date__c=date.parse('02/02/2018'),MAP_End_Date__c=date.parse('02/02/2018'),Pricebook2Id = pb.Id,Payment_Method__c='Interac',Signing_Contact__c=con.id,accountid=acc.id);
        insert opp; 
        // Insert Opportunity Line Item
        OpportunityLineItem oli = new OpportunityLineItem(OpportunityId = opp.Id,UnitPrice = 1,Quantity = 1,Product2Id = p.Id);
        insert oli;
        // Insert ContentVersion to opportunity       
 	    ContentVersion contentVersion = new ContentVersion(
            Title = 'ContentAgreement1',
            PathOnClient = 'ContentAgreement1.pdf',
            VersionData = Blob.valueOf('Test Content'),
            IsMajorVersion = true
        );
        insert contentVersion;
        contentVersion = [Select ContentDocumentId from contentVersion where Title= 'ContentAgreement1'];
        ContentDocument cd = new ContentDocument(id=contentVersion.ContentDocumentId);
        // Insert ContentVersion2 to opportunity       
        ContentVersion contentVersion2 = new ContentVersion(
            Title = 'ContentAgreement2',
            PathOnClient = 'ContentAgreement2.jpg',
            VersionData = Blob.valueOf('Test Content'),
            IsMajorVersion = true
        );
        insert contentVersion2;
        contentVersion2 = [Select ContentDocumentId from contentVersion where Title= 'ContentAgreement2'];
        ContentDocument cd2 = new ContentDocument(id=contentVersion2.ContentDocumentId);
        //Create and populate review opportunity record
        Opportunity oppReview =  new Opportunity();
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('Content Added, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==True);
        // Delete ContentDocument
        delete cd;
        //Populate review opportunity record
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('cd deleted, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==False);
        // Delete ContentDocument2
        delete cd2;
        //Populate review opportunity record
        oppReview = [Select Id,Agreement_Attached_as_Content_Document__c from Opportunity where ID=:opp.Id];
        system.debug('cd2 deleted, oppReview.Agreement_Attached_as_Content_Document__c Value equals: '+ oppReview.Agreement_Attached_as_Content_Document__c);
        System.Assert(oppReview.Agreement_Attached_as_Content_Document__c==False);
    }
}


for this trigger:
trigger UpdateCheckboxAgreementContentDocument on ContentDocument (after insert, after delete) {
    Set<Id> setOpportunityId = new Set<Id>();
    List<Opportunity> lstOpp = new List<Opportunity>();
    if (Trigger.isInsert) {
        for(ContentDocument cd: trigger.new){
            // this 006 check was in the sample code I found
            if(String.valueOf(cd.ParentId).startsWith('006')) {
                setOpportunityId.add(cd.ParentId); 
            }
            // Check ContentDocument to see if PDF
            if(cd.FileExtension.endsWithIgnoreCase('pdf')) {
                for(Opportunity opp: [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id IN:setOpportunityId]){
                    // check the box on the opportunity
                    opp.Agreement_Attached_as_Content_Document__c = True;
                    // add the opportunity to the list variable to update
                    lstOpp.add(opp);
                }
            }
        }
    }
    else if (Trigger.isDelete) {
        //new id variable for checking in delete scenario
        id oppId = null;
        boolean PDFStillAttached = null;
        for(ContentDocument cd: trigger.old){
            // this 006 check was in the sample code I found
            if(String.valueOf(cd.ParentId).startsWith('006')) {
                oppId = cd.ParentId; 
            }
            // Check other ContentDocuments to see if there are any other PDFs attached
            List<ContentDocument> lstCds = ([SELECT ID, FileExtension From ContentDocument where ParentId=:oppId]);
            if (lstCds.size()>0) {
                for (ContentDocument lstCd: lstCds) {
                    if(lstCd.FileExtension.endsWithIgnoreCase('pdf')) {
                        PDFStillAttached = True;
                    }
                }
                for(Opportunity opp: [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id IN:setOpportunityId]){
                    // check the box on the opportunity
                    If(PDFStillAttached=True){
                        opp.Agreement_Attached_as_Content_Document__c = True;
                    }
                    else {
                        opp.Agreement_Attached_as_Content_Document__c = False;
                    }
                    // add the opportunity to the list variable to update
                    lstOpp.add(opp);
                }
            }
            else {
                Opportunity opp= [Select Id, Agreement_Attached_as_Content_Document__c from opportunity where Id=:oppId];
                    opp.Agreement_Attached_as_Content_Document__c = False;
                // add the opportunity to the list variable to update
                lstOpp.add(opp);
                system.debug('lstOpp equals: '+ lstOpp);
            }
        }
    }
    // Update opportunity if opportunity list size greater than 0
    if(lstOpp.size()>0) {
        update lstOpp;
                system.debug('lstOpp updated: '+ lstOpp);
    }
}

 
Hi,
Just wondering, how this "{!(contactList.size != 0)}" syntax is working. I knew List.size() is always used. in this example '()' is missing. Any idea??

EXAMPLE:
<apex:pageBlockTable value="{!innerContactList}" var="innerCont" <strong><font color="#ff0000">rendered="{!(contactList.size != 0)}"</font></strong>>

Thanks.
 
  • December 22, 2014
  • Like
  • 0