• C_Gibson
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi,

 

I have a master object KC_Sales_c and a child object Pro_Forma_c

 

I have created an Apex trigger so that every time a KC Sales record is added a Pro Forma is automatically created.


Is it correct?

 

Thanks

 

trigger CreateProForma on KC_Sales__c (before insert) {

//1. Create collection of new Pro Formas
List<Pro_Forma_c> newProForma = new List<Pro_Forma_c>();

//2. Iterate through the new sales

for (KC_Sales_c sale : trigger.new) {

//2a. For each sales, create a new pro forma
Pro_Forma_c freshProForma = new Pro_Forma_c();
freshProForma.KC_Sales_c = sale.id;
freshProForma.Name = sale.Name_c;

// NO NO!
// insert freshProForma;

//2b. Add the new ProForma to the collection
newProForma.add(freshProForma);

}

//4. Save the new ProFormas

insert newProFormas;

}

  • June 18, 2013
  • Like
  • 0

I have a create opportunity call in which I am trying to recreate the standard functionality that auto-populates the Primary Campaign source field with the most recent campaign related to the contact.  Does anyone know how I could add to my call to have it do this?

Hi

 

I have a pageblocktable with  a button in each row. and Id is one of column in my table. I want to pass that Id to the button.

 

That means, I want to get the column(id) value from page to controller and add to button url.

 

But i am getting the param value as null...

 

Here is my piece of code:

 

 

<apex:pageBlockTable value="{!Results}" var="transaction" title="Payment Methods" >
 <apex:column headerValue="Id" value="{!transaction.tranId}" id="transactid"/> 
        <apex:column headerValue="Last 4 digits" value="{!transaction.cardnum}"/> 
        <apex:column headerValue="Card Type" value="{!transaction.cardname}"/>
        <apex:column >
    <apex:commandButton action="{!VTerminal}" value="Virtual Terminal" />
                            <apex:param name="para" value="transactid" assignTo="{!para}"/>
    </apex:column>

 

</apex:pageBlockTable>

 

 

Here is the piece of controller:

 

 

public String para{get;

set{ 

para = value;

System.debug('set parasss'+para);

}

}

 

 

 

public PageReference Vterminal() 

    {

        transactvalue=new List<CnP_Transaction__c>();

        System.debug('param valueeeeeeeee'+para);

     transactvalue  =[SELECT Id,Name FROM CnP_Transaction__c WHERE Id =:para];

            p=new PageReference('/apex/VirtualTerminal');

     return p;

 

 

    }

 

In the debug statement of param valueeee I always got null value..

 

Can any one of you advice me please

Excuse me, as I'm seasoned Java programmer but new to Apex.

 

In Java you would have an import statement, like "import mypackage.thiscompany.com.*;"  The import statement is at top of class, right below package declaration.

 

How do you do an "import" in Apex?

 

What I want to do is reference another class for utilities.    Specifically there are some SFDC code share classes for JSON that I want to use from ANOTHER Apex class.  How to I point to those JSON classes in my own Apex class?

 

http://developer.force.com/codeshare/apex/ProjectPage?id=a0630000002ahp4AAA

 

Another example might be for JavaMail or JDOM; what if a person wanted to use those 3rd party packages via an import?

 

Hi i want to Export a SalesForce Object from 1 salesforce to another salesforce how can i achieve this.
 
 
Thanks
Anand.

I have a create opportunity call in which I am trying to recreate the standard functionality that auto-populates the Primary Campaign source field with the most recent campaign related to the contact.  Does anyone know how I could add to my call to have it do this?