• krisk
  • NEWBIE
  • 188 Points
  • Member since 2013

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 43
    Replies

Hi, 

 

I am using Eclipse Juno after  fetch my Project when i click any class following error message is shown :

 

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1079)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:129)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:95)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:859)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:839)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:111)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:319)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:240)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:896)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:630)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:732)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:703)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:697)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:682)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1114)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:67)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:418)
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:385)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:579)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:315)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:985)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3079)
at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:3003)
at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2985)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2981)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2940)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2931)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:655)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:614)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

 

Please Help me for same 

 

Thanks !

Suneel 

  • February 10, 2013
  • Like
  • 0

This si my current Controller:

 

public class CalendarEventController{

public List <Account> getMyAccounts()
{
return [SELECT Id, Name, Region__c FROM Account ORDER BY LastModifiedDate DESC LIMIT 10];
}

public List<ActivityHistory> Actividades {get; set;}
public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
/*for(Integer i = 0; i< accounts.size(); i++ )
{
if(accounts[i] != null)
{
Actividades.add(((List<ActivityHistory>)accounts.get(0).getSObjects('ActivityHistories')));
}
}*/
Actividades = (List<ActivityHistory>)accounts.get(1).getSObjects('ActivityHistories');


for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

}

 

As you may see im trying to get all the events from every account we have.

 

This is the apex code that im trying to use in order to display it on my visualforce page:

 

<apex:pageBlock>
<apex:pageBlockTable value="{!Open}" var="lista">
<apex:column value="{!lista.Subject}" headerValue="Subject"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

I keep getting the same error: Error: Unknown property 'VisualforceArrayList.Subject'

 

Please help me with this test class.... Below is the code I am trying to get working... the class itself seems to work ok as it does decode incoming emails for me.  But the problem is I am trying to get the test class portiion working and it simply will not compile for me. IF you look below where I have remarked out the lines that failed with //// 4 comment bars. each one of the below //// is giving the error unexpected token.... is there a solution for this... I need to build a test code for the email program shown at the Example Code Below..  Thanks in advance for any ideas.

 

Example of Code 

 

 

 

//// Error: Compile Error: unexpected token: ',' at line etc....
//// Each line below that I have added //// gave the above error....


@IsTest
private class EmailDemoReceiveHandlerTests {

       // Create a new email and envelope object
       Messaging.InboundEmail email  = new Messaging.InboundEmail();
       Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
      
       // Set up your data if you need to
      
       // Create the email body
       
      //// email.plainTextBody = 'This should become a note';
      //// email.fromAddress ='test@test.com';
       String contactEmail = 'jsmith@salesforce.com';
      //// email.ccAddresses = new String[] {'Jon Smith <' + contactEmail + '>'};
      //// email.subject = 'Dummy Account Name 123';
      
       EmailDemoReceive edr = new EmailDemoReceive();
      
       Test.startTest();
       Messaging.InboundEmailResult result = edr.handleInboundEmail(email, env);
       Test.stopTest();
      
       ////System.assert (result.success, 'InboundEmailResult returned a failure message');
      
       Account [] accDb = [select ID from Account where name=:email.subject];
       System.assertEquals (1, accDb.size(),'Account was not inserted');
       Contact [] cDb = [select firstname,lastname from Contact where email=:contactEmail];
       System.assertEquals (1, cDb.size(),'Contact was not inserted!');
       Contact c = CDb[0];
       System.assertEquals ('Jon', c.firstName);
       System.assertEquals ('Smith', c.LastName);
       Note [] nDb = [select body from Note where ParentID=:accDb[0].id];
       System.assertEquals (1,nDb.size(), 'A note should have been attached');
       System.assertEquals (email.plainTextBody, nDb[0].body);
      
   }
}

 

 

I'm working with a VF page and Apex controller and I want to be able to do SOQL queries that are limited to 200 results but that start the results at different places in the total query results.  In other words have queries that would get me the first 200 results, the second 200 results and so on...  BUT, I want to be able to jump around so that the user could jump straight from the 1st page of results (records 1-200) to the 5th page of results (query for results 1,000 to 1,200).  Is that possible?  I cannot query *all* the records and then just return 200 to the page at a time because the query returns too much data.  So, I'd want to run the query again each time but getting a specific subset.   Kind of like a row limit but starting at a certain record count.  

 

Totally crazy?

Hello,

 

I have a really basic issue: When a specific boolean field = true on a contact object, I want the ID of that contact to populate into a field on the associated Account object. I don't think this should be too hard but I am really new to Apex so I appreciate all the help I can get!

 

here's the code I have so far:

trigger Secondary on Contact (after update) {
List<Contact> cons = new List<Contact>();
    List<Contact> consToSecondary = new List<Contact>();
    
    for(Contact c:trigger.new){
        if(c.SecCon_Checkbox__c != null && c.cv__Head_of_Household__c != true){
            cons.add(c); 
        }
    }
    
    for(Contact c: cons){
    c.Account.cv__Secondary_Contact__c = c.Id;
    consToSecondary.add(c);
    }
    
    update consToSecondary;
}

 The code compiles alright but when I try to test it I get this error: 

 

Error:Apex trigger Secondary caused an unexpected exception, contact your administrator: Secondary: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Secondary: line 12, column 1

 

Any help is appreciated, and thank you!

I have 2 custom objects related by a related list definition (called Holdings):

1. financial_acct__c

2.Holding__c

 

I need to display in the follwoing format in a VisualForce Page: (The tables are related by AccountId)

 

financial acct: XXX

      Holding1

      Holding2

 

financial acct: YYY

      Holding3

      Holding4

 

Once way I tried was to pass the finacial account id into a method getRelated() which would bring back a list of the related holdings. But when I tried to pass the

Account Id by using a <apex param> it was null when I debugged it in the method. I had declared the param variable as Public String myKey(get{}:,set{}}

 

When I debugged it in the class, it said myKey was null. When you do the "assignto=myKey"  in the <apex:param tag, doesn't that put the value in the variable?

 

 

 

 

 

Can you please help me out, I have been trying everything!

 

Hello.. Iam newbiee to salesforce.com..

i have a problem in comparing the the value that i give in vf to the value already stored in an object.

 

My programming seems to be Clumpzy..Plz humour me..

 

Here is the code which i have written..

 

vf page :- 

 

  <apex:page controller="test3con" showHeader="false" sidebar="false">

        <apex:form >
                <apex:sectionHeader title="Game ON!!!" subtitle="Salesforce A Day..."/>
                      <apex:pageblock >

                 <apex:pageblockTable value="{!id}" var="g" >

              <apex:column value="{!g.Question__c}"/><br/>

                     </apex:pageblockTable><br/>
              Answ:- <apex:inputText value="{!ans}"/> <br/><br/>
               <apex:messages />

<br/>
                    <apex:commandButton value="Submit" action="{!click}"/> &nbsp;&nbsp;
                 <apex:commandButton value="Refresh" action="{!refresher}"/>

         </apex:pageblock>
      </apex:form>
</apex:page>

 

 

Controller :-

 

 

public class test3con {

public PageReference refresher() {

pagereference pr = new pagereference('/apex/test3');

return pr;
}


public PageReference click() {
project__c g = new project__c();


if( g.Answer__c == ans ){

ApexPages.Message errMs= new ApexPages.Message(ApexPages.Severity.ERROR, 'Correct Answer');
ApexPages.addMessage(errMs);
insert g;
system.debug('----------'+g.Answer__c);
return null;
}
else
{
ApexPages.Message errMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Wrong Answer');
ApexPages.addMessage(errMsg);
return null ;
}

 

}
public String ans { get; set; }


public List<project__c> id {get; set;}
Public test3con() {

id = [SELECT Question__c FROM project__c where ID ='a0090000009huAz' ];

}

}

 

ID ='a0090000009huAz'   this is record id in the object "project__C"

Iam mission out something herer..which iam unable to understand. iam unable to compare the value which i give in that textfeild..to that value stored in that object..as record....  

 

Kindly help me out in solving this problem

 

Regards

 

Pardha saradhi.

 

 

  • February 01, 2013
  • Like
  • 0

Has anyone tried screen scraping license details to make dynamic allocations or freeing up user licenses based on last login etc?

 

If so, please share.

  • October 11, 2013
  • Like
  • 0

Need some advise regarding Force.com migration tool as to what are the best practices and what are the supported versus unsupported Metadata API component types

 

So if the tool allows for repetitive deployments, can it do a wholesale retrieve and deploy from one org to another org? 

 

Or even for that matter from Development Org - Subversion and Subversion - Testing Org

 

I am not able to find  much documentation in this regard. Please advise. 

 

 

  • March 28, 2013
  • Like
  • 0

Hi guys

 

Don't know if I missed something or if there are some reasons for that.

 

I was trying to create a before update trigger for contact but I was encountering some problems, and it turned out it's because the Contact.Name requires NULL.

 

I have a contact whose last name is "LastName" and whose first name is "FirstName".  I assume underneath, the Name attribute of this contact is set to "FirstName LastName".

 

The trigger code is like this:

trigger testcontact on Contact (before update) 
{
  for (Contact c : Trigger.old)
    system.debug('old ' + c.name + ' ' + c.firstname + ' ' + c.lastname) ;

  for (Contact c : Trigger.new)
    system.debug('new ' + c.name + ' ' + c.firstname + ' ' + c.lastname) ;
}

 

When I opened up this Contact, and without editing anything, just hit Save, this is what's in my debug log:

[25]DEBUG|old null FirstName LastName

[28]DEBUG|new null FirstName LastName 

 

Anyone has any idea why Contact.Name returns null and not the actual name of the contact?  I understand this is a formula field, but when I do a soql like this:

SELECT Name FROM Contact WHERE LastName = 'LastName'

it does return me 'FirstName LastName'.

 

So I don't know why I can't access this inside a trigger.

 

Thanks

 

 

Hi all,

 

I am new for salesforce coding,

I have a problem,

I want to encrypt a value in apex

also I want to reverse a string using apex code.

I've to write a Simple validation in my Custom VF/Apex code where a formula field (Grand Total which depends on 3 other fields) should not exceed a set number. If it does I would write a condition in my Apex code & add a error message to page. 

My Issue is that I think formula fields are only evaluated once the record is saved & when the page loads again & that's the reason I can't check for the modified Grand Total field in my apex code when User saves a record. 

 

Any workaround this , can this be achieved through After Trigger ?

Please help.. i'm stuck on this. Can't figure out which is wrong with my coding. I received an error '

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

Any help will be appreciated. Thanks

 

This is my code:

 

public class InvoiceController {

public class MissingAccountException extends Exception {}
public class NoLineItemsException extends Exception {}


public Account account {get; private set;}
public Opportunity opportunity {get; private set;}
public Invoice__c order {get; private set;}
public OpportunityLineItem oppLineItem {get; private set;}
public Invoice_Line_Item__c[] invoiceLineItems {get; private set;}
public Invoice_Line_Item__c invoiceLineItem {get; private set;}
public List<Invoice_Line_Item__c> lineItems= new List<Invoice_Line_Item__c>();
private integer itemCount=0;

private PriceBookEntry pbEntry;

public InvoiceController() {

Boolean ShowPartner=false;
Id id = ApexPages.currentPage().getParameters().get('id');
//Id accountId=ApexPages.currentPage().getParameters().get('aId');
Id opportunityId = ApexPages.currentPage().getParameters().get('oId');

opportunity = (opportunityId == null) ? new Opportunity() :
[SELECT name, accountID, CloseDate, Description, StageName, Pricebook2Id FROM Opportunity WHERE id = :opportunityId];

if (opportunity.AccountId != null){
account =new Account();
account= [SELECT name, accountnumber, billingstreet, BillingCity, BillingState, BillingPostalCode, BillingCountry,ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry, phone, fax FROM account WHERE id = :opportunity.AccountId] ;
}else {
throw new MissingAccountException('Cannot create an invoice from this opportunity: Please assign an account to the opportunity.');
}

invoice = (id == null) ? new Invoice__c() :
[SELECT Invoice__c.Name FROM Invoice__c WHERE id = :id];

{

//Pre-populate Opportunity and account information
invoice.Name=Opportunity.Name;
invoice.AccountId__c=opportunity.AccountId;
invoice.OpportunityId__c = opportunity.id;
invoice.Status__c='New';

//Retrieve the PriceBook name for Prepopulation in order
string pbID = opportunity.Pricebook2Id;
PriceBook2 pb = (opportunity.Pricebook2Id == null) ? new PriceBook2() :
[Select Id, Name from Pricebook2 where Id=:pbID];
invoice.Pricebook__c=pb.Name;

//Create a new Invoice_Line_Item__c and populate a row for each oppLineItem that exists

integer i = 0;
Invoice_Line_Item = new Invoice_Line_Item__c[0];
for(OpportunityLineItem opp: [SELECT Id, SortOrder, PricebookEntryId, Description, Quantity, ListPrice, UnitPrice, TotalPrice, ServiceDate FROM OpportunityLineItem WHERE Opportunityid = :opportunityId])
{

string pbeID = opp.PricebookEntryId;
pbEntry = (pbeId == null) ? new PriceBookEntry() :
[Select Id, Name, Pricebook2Id, Product2Id, ProductCode from PricebookEntry where Id=:pbeID];


invoiceLineItem = new Invoice_Line_Item__c();
invoiceLineItem.Invoice__c=invoice.Id;
invoiceLineItem.Invoice__c = i+1;
invoiceLineItem.ProductId__c = pbEntry.Product2Id;
invoiceLineItem.Name = pbEntry.Name;
invoiceLineItem.Quantity__c = opp.Quantity;
invoiceLineItem.List_Price__c= opp.ListPrice;
invoiceLineItem.Sales_Price__c=opp.UnitPrice;
invoiceLineItem.Total_Price__c=opp.TotalPrice;
invoiceLineItem.add(Invoice_Line_Item);
i++;
}
itemCount=i;
if (itemCount == 0) {
throw new NoLineItemsException('Unable to create Invoice: Products must be added to the Opportunity before creating an Invoice.');
}
System.Debug('Finished Page Load');

}
public PageReference cancel() {
return (new ApexPages.StandardController(opportunity)).view();
}
//saves invoice and child invoices
public PageReference save() {
System.Debug('Running Save Method');

try
{
insert invoice;
System.Debug(invoice.id);
for(Invoice_Line_Item__c li: invoiceLineItems)
{
li.Invoice__c=invoice.id;
}
insert invoiceLineItems;
//If the Opportunity Stage is not 'Closed Won' then update it
if (Opportunity.StageName != 'Closed Won'){
Opportunity.StageName='Closed Won';
update Opportunity;
}
}catch(System.DMLException e)
{
ApexPages.addMessages(e);
return null;
}

// After Save, navigate to the default view page:
return (new ApexPages.StandardController(invoice)).view();
}

public PageReference loadHelpPage(){
PageReference pg = new PageReference('/apex/CreateInvoiceHelp');
return pg;
}


}

 

 

  • February 10, 2013
  • Like
  • 0

I'm trying to create a single pageblocktable where Columns="3" that will move every 4th item to a new row in the table.

 

I thought that by assigning the Columns attribute that SFDC would automatically move the 4th column to a new row, but instead they just start piling up on the right side of the screen, after the first 3 columns display correctly.

 

Currently I'm having to close each pageblock table after three columns, then and start a new data table underneath it. This is working, but it doesn't seem right to have to do that.

 

I've alsdo tried using the dataTable, but the same problem happens.

 

Here's my VF example:

<apex:pageBlockTable value="{!Service}" var="SVC" columns="3" columnsWidth="400px,400px,400px" width="100%" align="center">
         <apex:column >
           <apex:facet name="header">CustomerID: </apex:facet>
              <font size="3" color="black">{!Order.CustomerID__c}</font>
         </apex:column>
         <apex:column >
           <apex:facet name="header">MVNO: </apex:facet>
              <font size="3" color="black">{!Order.CustomerID__r.MVNO_Partner__r.Name}</font>
         </apex:column>
         <apex:column >
           <apex:facet name="header">Transaction Type: </apex:facet>
              <font size="3" color="black">{!Order.OrderType__r.OrderTypeDescription__c}</font>
         </apex:column>
         </apex:pageBlockTable> 
         <br/>
                  
          <apex:pageBlockTable value="{!Service}" var="SVC" columns="3" columnsWidth="300px,300px,300px" width="100%" align="center">
         <apex:column >
           <apex:facet name="header">ServiceID: </apex:facet>
              <font size="3" color="black">{!SVC.Name}</font>
         </apex:column>
         <apex:column >
           <apex:facet name="header">&nbsp;MVNO Market </apex:facet>
              <font size="3" color="black">&nbsp;{!SVC.MVNOMarketId__r.DisplayName__c}</font>
         </apex:column>
          <apex:column > &nbsp;
          </apex:column>
       </apex:pageBlockTable>

 I'm not really that fluent in HTML, so I'm kind of winging it here as far as formatting a page to look half-way decent. The above works as far as organizing the fields in more or less aligned rows. Width, Columnswidth, and align are kind of sketchy as well. Align doesn't seem to move anything. I realize I am probably using these wrong, but again, I'm having to trial-and-error this thing into shape.

 

Any help is appreciated.

 

ODB

 

 

 

Hi, 

 

I am using Eclipse Juno after  fetch my Project when i click any class following error message is shown :

 

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1079)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:129)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:95)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:859)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:839)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:111)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:319)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:240)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:896)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:630)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:732)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:703)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:697)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:682)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1114)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:67)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:418)
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:385)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:579)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:315)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:985)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3079)
at org.eclipse.ui.internal.WorkbenchPage.access$22(WorkbenchPage.java:3003)
at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2985)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2981)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2940)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2931)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:655)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:614)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

 

Please Help me for same 

 

Thanks !

Suneel 

  • February 10, 2013
  • Like
  • 0

The below trigger creates opportunity records once order__c records meet certain criteria. The order__c table has a field called Opportunity_Name__c that I would like to populate with the opportunity Id that is generated in the trigger. Can someone show me how to do this?

 

trigger createNewOpportunity on Order__c (after update) {

    Id orderRT = [SELECT Id FROM RecordType WHERE SobjectType = 'Order__c' and Name = 'Order'].Id;
    Id oppRT = [SELECT Id FROM RecordType WHERE SobjectType = 'Opportunity' AND Name = 'CDA'].Id;
    Id TTO = [SELECT Id FROM Account WHERE Agreement_Company_Code__c = 'W'].Id;
       

    List<Opportunity> o = new List<Opportunity>();
        for (Order__c order: Trigger.New){
            if (order.Contact__c <> Null && order.Account__c <> Null && order.RecordTypeId == orderRT && order.Status__c == 'Open'){
                getOppNumber controller = new getOppNumber();
                string oppNumber = controller.generateOpportunityNumber(TTO);
                o.add(new Opportunity(
                    RecordTypeId = oppRT,
                    Record_Sub_Type__c = 'Confidential Agreement',
                    AccountId = order.Account__c,
                    Opportunity_Number__c = oppNumber,
                    StageName = 'Initial Contact',
                    Name = order.Account__r.Name + ' - ' + order.PI_Name__c + ' - ' + oppNumber.removeStart('D'))); 
             }
       }
       insert o;            
}

 

  • February 05, 2013
  • Like
  • 0

Hello,

 

I have 1000 list of product names like

Name:

8 online

12 lives

34 services

Additional

Pages

Landing

Build

 

Now i need to build a list which can be filtered based on the straight alphabet.

A | B | C | D | .....| Other |

 

so query will be

 

Query: [ Select Name from Catelog__c where Name Like :string ]
//:string will get the param by selection like A% or B%  

 But i am strugling to make solution if the current page get param value == 'Other' then Query should display non-alphabetic values.

 

Any solution?

 

Thanks

 

 

 

 

 

This si my current Controller:

 

public class CalendarEventController{

public List <Account> getMyAccounts()
{
return [SELECT Id, Name, Region__c FROM Account ORDER BY LastModifiedDate DESC LIMIT 10];
}

public List<ActivityHistory> Actividades {get; set;}
public List<List<ActivityHistory>> lista {get;set;}
public List<List<ActivityHistory>> getOpen()
{

lista = new List<List<ActivityHistory>>();
SObject[] accounts = [SELECT Name,
(Select Subject, WhoId,WhatId, ActivityDate, Status, Priority, OwnerId FROM ActivityHistories) From Account];
/*for(Integer i = 0; i< accounts.size(); i++ )
{
if(accounts[i] != null)
{
Actividades.add(((List<ActivityHistory>)accounts.get(0).getSObjects('ActivityHistories')));
}
}*/
Actividades = (List<ActivityHistory>)accounts.get(1).getSObjects('ActivityHistories');


for(SObject o : accounts){
if(o.getSObjects('ActivityHistories') != null){
List<ActivityHistory> element = (List<ActivityHistory>) o.getSObjects('ActivityHistories');
if(element != null){
lista.add(element);
}
}

}

return lista;
}

}

 

As you may see im trying to get all the events from every account we have.

 

This is the apex code that im trying to use in order to display it on my visualforce page:

 

<apex:pageBlock>
<apex:pageBlockTable value="{!Open}" var="lista">
<apex:column value="{!lista.Subject}" headerValue="Subject"/>
</apex:pageBlockTable>
</apex:pageBlock>

 

I keep getting the same error: Error: Unknown property 'VisualforceArrayList.Subject'

I need assistance creating a trigger/class combo that would allow me to send time-dependent email alerts to the Account Owner based on the date value in a Formula (Date) field. Basically, I need the email alert to be sent 14, 7, 3, 1, 0 days before the date value in the formula field only if a picklist field contains a specific value. I realize a workflow rule will not work because there is no update on the record due to the date being a formula field. This formula field date value will change once a month, so the cycle of email alerts will restart each month.

 

Do I need a single class that runs daily and fires the trigger's email alert when TODAY() is 14 days before, then again when TODAY() is 7 days before, etc.

 

Or do I need individual classes, one for each planned email alert?

 

I also need the emails to stop when the action is completed by the Account Owner. But then to start back up when the formula field's date changes.

Within an if statement I want to print a line break to the screen. However, there seems to be no easy way to do this in any forums thus far. I found a few answers, but none of them seem to work within the TRUE argument in my IF conditional statement. Here is a snippet of my code:
{! IF (relatedTo.Budget_In_Stream_Video__c != null, "In-Stream Video", null)}
{! IF (relatedTo.Budget_Interactive_InStream_Video__c != null, "Interactive In-Stream Video", null)}

Outputs

I have tried \n, <br/>, and many others with little or no success. BR() only gives this output:
In-Stream Video_BR_ENCODED_Interactive In-Stream Video

 

Someone please tell me I'm crazy and this isn't that hard and doesn't require some crazy hack...

I am just finishing an apex class that drives a vf page. I have added validation rules requiring the user to either enter a value in the field "kvp_drawing__c" or the user must attach a file to the record  (code included in the same class)/. My problem is that when the user is stopped by the validation rule and corrects the record, the code will return the following error:

 

System.DmlException: Insert failed. First exception on row 0 with id a02R0000008zkXNIAY; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
Error is in expression '{!save}' in component <apex:page> in page newlayoutrequest

 

 

Here is the class:

public with sharing class NewLayout {

    public NewLayout() {
    o = new Opportunity();
    currentrec = new Custom_Layout_Object__c();
    currentarec = new Attachment();
    
    }
    public boolean getmsg(){return msg;}
    public boolean getmsg2(){return msg2;}
    public class EncodingException extends Exception {}
    Apexpages.StandardController c;
    boolean msg = false;
    boolean msg2 = false;
    Public Custom_Layout_Object__c layout {get; set;}
    Public Opportunity o {get; set;}
    Public Custom_Layout_Object__c currentrec;
    Public Attachment currentarec;
    public Blob drawing {get; set;}
    public String contentType {get; set;}
    public String fileName {get; set;}
    Custom_Layout_Object__c cl = new Custom_Layout_Object__c();
    Boolean error=false;
    Integer idx=1;
    
    public NewLayout  (ApexPages.StandardController c){
            o = [select id from Opportunity where id =
                       :ApexPages.currentPage().getParameters().get('oppid')];
                system.debug('*********************000000000:'+ o);                  
         
            currentrec=(Custom_Layout_Object__c)c.getRecord(); 
            system.debug('##########currentrec:'+currentrec);

    }
    
    Public Attachment Attachment{
        get{
            if(attachment == null)
                attachment = new attachment();
             return attachment;
             }
             set;
    }

    public PageReference Cancel() {
        return null;
    }
    
    public PageReference save() {
    
    If(currentrec.KVP_or_Attachment__c == 'KVP Drawing #'){
     If(currentrec.KVP_Drawing__c== null){
      msg=true;
        } else{
    cl.Opportunity__c = o.id;
    cl.Requested_Date_to_Complete_Layout__c = currentrec.Requested_Date_to_Complete_Layout__c;
    cl.Process_Flow_Description__c = currentrec.Process_Flow_Description__c;
    cl.KVP_or_Attachment__c = currentrec.KVP_or_Attachment__c;
    cl.KVP_Drawing__c = currentrec.KVP_Drawing__c;
    cl.App_Test_has_been_requested_completed__c = currentrec.App_Test_has_been_requested_completed__c;
    cl.Quote_Request_is_in_Process__c = currentrec.Quote_Request_is_in_Process__c;
    cl.Customer_has_requested_a_layout_only__c = currentrec.Customer_has_requested_a_layout_only__c;
    cl.Customer_PO_is_pending_layout_request__c = currentrec.Customer_PO_is_pending_layout_request__c;

    insert (cl);    
    }return null;}
    If(currentrec.KVP_or_Attachment__c == 'File Attachment'){
    
     If(drawing != null){

    cl.Opportunity__c = o.id;
    cl.Requested_Date_to_Complete_Layout__c = currentrec.Requested_Date_to_Complete_Layout__c;
    cl.Process_Flow_Description__c = currentrec.Process_Flow_Description__c;
    cl.KVP_or_Attachment__c = currentrec.KVP_or_Attachment__c;
    cl.KVP_Drawing__c = currentrec.KVP_Drawing__c;
    cl.App_Test_has_been_requested_completed__c = currentrec.App_Test_has_been_requested_completed__c;
    cl.Quote_Request_is_in_Process__c = currentrec.Quote_Request_is_in_Process__c;
    cl.Customer_has_requested_a_layout_only__c = currentrec.Customer_has_requested_a_layout_only__c;
    cl.Customer_PO_is_pending_layout_request__c = currentrec.Customer_PO_is_pending_layout_request__c;

    insert (cl);    
    } else {msg2=true;
            return null;} 

    }
     if(drawing!=null){
      Attachment attach=new Attachment();
      attach.Body=drawing;
      attach.Name=filename;
      attach.ContentType=contentType;
      attach.ParentID=cl.id;
    try {
          insert(attach);
      } catch(System.DMLException e) {
          ApexPages.addMessages(e);
          return null;
      }
    }
    PageReference pageRef = new PageReference('/' + cl.id);

     return pageRef;
    }
}

 

Thank you for any advice

I have 2 custom objects related by a related list definition (called Holdings):

1. financial_acct__c

2.Holding__c

 

I need to display in the follwoing format in a VisualForce Page: (The tables are related by AccountId)

 

financial acct: XXX

      Holding1

      Holding2

 

financial acct: YYY

      Holding3

      Holding4

 

Once way I tried was to pass the finacial account id into a method getRelated() which would bring back a list of the related holdings. But when I tried to pass the

Account Id by using a <apex param> it was null when I debugged it in the method. I had declared the param variable as Public String myKey(get{}:,set{}}

 

When I debugged it in the class, it said myKey was null. When you do the "assignto=myKey"  in the <apex:param tag, doesn't that put the value in the variable?

 

 

 

 

 

Can you please help me out, I have been trying everything!

 

Hi,

 

I have a requirement if checkbox is checked then write N/A else TBD if there is nothing yet in the  Doc field. Otherwise it will contain the same name filled into the  Doc field.

 

I have written the below code,but eventhough checkbox is check it is not displaying N/A it is displaying TBD Only.

 

Can anyone please guide how can i modify the below formula so that it will display N/A if checkbox is checked.

if( checkboxreq__c,"N/A", BLANKVALUE( Doc__r.Name , "TBD" ))

 

Thanks in advance.