• zettahertz
  • NEWBIE
  • 30 Points
  • Member since 2011

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

I have three custom objects Product , Order ,  Order Entry

 

 

Order Entry has master detail with Order  and a  lookup to Product

 

 

I have a field called Revenue on Order Entry which needs to be  calculated based on  the  Category of Order 

 

 

I mean to say on Order I have a field called  Category  and based on this field I need to calculate the revenue  on Order Entry 

 

************

Trigger should execute upon Order Entry creation and whenever Order__r.Category__c is changed according to the following logic:

 

 

2.       IF(Order__r.Category__c <> "Event", Product__r.Invoice_Rate_Blend__c * Quantity__c, Product__r.Invoice_Rate_Event__c * Quantity__c)

 

 

 

I am struck as how do I do it do it  on an insert as well as an  update  as the Order field  is not changed  on the Order Entry but a particular field on Order is changed .

 

Hello everyone,

 

I'm facing an issue with inputtext.  I don't get why the immediate=true make the inputtext return null all the time.  It works fine when immediate=false.  Here's a very simple plage that demonstrates it:

VF Page:

<apex:page controller="TestControllerExt">
 
 <apex:form >
  
  Text Entered: <apex:inputText value="{!input}" /> 
  
  <apex:commandButton action="{!doSomething}" 
                      rerender="panelToRerender" 
                      value="Rerender" 
                      immediate="true"/> <!-- when set to true, it returns null -->
 
 </apex:form>
 
 <apex:outputPanel id="panelToRerender"> 
  {!output } 
 </apex:outputPanel>

</apex:page>

 

Controller:

public with sharing class TestControllerExt {

    public String input{get; set;}
    public String output { get; set; }

     public void doSomething (){
        output = 'Entered value: ' + input;
    } 

}

 


Output:
When immediate=false:
Entered value: test

 

When immediate=true:
Entered value: null

 

I don't quite get what's going on.  Is this a bug? Or that's just how immediate=true works?  All i see in the document is that it bypasses validation rules, which is what I want.

 

OK. I am new to this, but am missing something dumb. I know.

 

Class is ScottClass

 

I want to make a method that performs an account merge function.

Basically, I have two different fields on Accounts with the same number in it. I want to pull them together and merge them.

I can do it one by one, but I'm trying to make it a method.  I know it should be possible.

 

public class ScottClass {

public void mergeBasing (string ERPSTring){
Account masterAcct = [SELECT Id, SAPCIBER__c FROM Account WHERE SAPCIBER__c = :ERPString LIMIT 1];
Account mergeAcct = [SELECT Id, ERPBasing_C__c FROM Account WHERE ERPBasing_C__c = :ERPString LIMIT 1];
merge masterAcct mergeAcct;
}
}
ScottClass.mergeBasing('6763');

 

-------------- I know the queries are right, because I know this works:

public String ERPString = '14138';
Account masterAcct = [SELECT Id, SAPCIBER__c FROM Account WHERE SAPCIBER__c = :ERPString LIMIT 1];
Account mergeAcct = [SELECT Id, ERPBasing_C__c FROM Account WHERE ERPBasing_C__c = :ERPString LIMIT 1];
try {
merge masterAcct mergeAcct;
} catch (DmlException e) {
// Process exception here
}

I have three custom objects Product , Order ,  Order Entry

 

 

Order Entry has master detail with Order  and a  lookup to Product

 

 

I have a field called Revenue on Order Entry which needs to be  calculated based on  the  Category of Order 

 

 

I mean to say on Order I have a field called  Category  and based on this field I need to calculate the revenue  on Order Entry 

 

************

Trigger should execute upon Order Entry creation and whenever Order__r.Category__c is changed according to the following logic:

 

 

2.       IF(Order__r.Category__c <> "Event", Product__r.Invoice_Rate_Blend__c * Quantity__c, Product__r.Invoice_Rate_Event__c * Quantity__c)

 

 

 

I am struck as how do I do it do it  on an insert as well as an  update  as the Order field  is not changed  on the Order Entry but a particular field on Order is changed .

 

We fix defects and move the fixes to prod and we have deployments very frequently. We have many test cases and to deploy the code to prod it is taking almost 2 hours. If we did any mistake or if any of the test class fails for what ever reason it might be, still we have to wait for the two hours and fix the problem and again start the deployment and again we need to wait for two hrs and fix it and start the deployment again.....Its so painful to do it as we have frequent releases...

Is there any way that we can stop the deployment in the middle as soon as we see any test class failing other than to wait till all the test classes get executed.

 

Pls help...

Hi folks,

       Here is the code for my task but it's nt working, here is my task, if you go to solutions in case realated list, and when you click on find solutions and select any solution then it gets attached to the case and the casecontact gets the solution as an email, iam not able to figure out what needs to be done in this code to get executed, can anyone help me out with this please.

 

trigger solutionInsert on Solution (after insert) {

 List<Id> sIdList;
 Map<Id,String> userMap = new Map<Id,String>();
 Map<Id,Id> caseMap = new Map<Id,Id>();
 
 for(Solution s:Trigger.New)
 {
  sIdList.add(s.id);
  }
 if(sIdList.size()>0)
 {
  List<Case> cList = [select c.id,c.Owner.Email,c.Owner.Name,c.OwnerId,(select cs.caseId,cs.SolutionId from CaseSolutions cs)  from Case c where c.id in:sIdList limit 1];
 
  for(Case c:cList)
  {
   userMap.put(c.OwnerId,c.Owner.Email);

   caseMap.put(c.OwnerId,c.CaseSolutions.SolutionId);
  }
 
  for(Solution s: Trigger.New)
  {
    Id sId = s.Id;
    Id oId = caseMap.get(sId);
    String emailId = userMap.get(oId);
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    String[] toAddresses = new String[] {emailId};
    mail.setToAddresses(toAddresses); 
     
  }
}
}
Thanks
Sam

 

Hi,
 
I want to create a lookup field as below using Visualforce. How can i acheive this?

 
Any help on this will be appreciated.
 
Thanks,
OnDemand