• Hector Diaz
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 13
    Replies
Hi
anyone can help me to verify if my "and" function goes well, because doesnt work my code.
tks in advance

<apex:page standardController="QA_Order_Control__c" rendered="{(!QA_Order_Control__c.Line_Item_Brands_Opp_B__c== 'EMC')&&(!QA_Order_Control__c.OPS360_Status__c=='01.SentToOpps') }">


 <script type="text/javascript">
  { window.alert("Ponte Chingon"); }
 </script>
</apex:page>
Hi
I have a trigger but for unknown reason doesnt fire, exists some functionallity in "Developer Console"  figure out how or why stopps the trigger execution.
tks in advance
Hi
My trigger fires every time when the record its updated, how to prevent because i need to fire just once.
thanks in advance.

trigger QARejectUpdatesOppStage1_RAMU_VINIT_3 on QA_Order_Control__c(after insert,before update){
system.debug('===========');

//Unlock opportunity
//Update the opportunity stage to '08. Delivery  Invoiced' for 17.Invoiced QAOC and update the QAOC to the opportunity page
Map<Id,Id> oppQAIdMap=new Map<Id,Id>();
for(QA_Order_Control__c qaoc:Trigger.New){
    if(qaoc.Status__c=='17. Invoiced'&& qaoc.Country_user__c=='MX') {
        oppQAIdMap.put(qaoc.Opportunity__c,qaoc.id);
    }   
}
//Update fields
list<Opportunity> listOpps=new list<Opportunity>();
listOpps=[Select id,StageName,QA_Order_Control__c from Opportunity where id IN:oppQAIdMap.keySet()];
for(Opportunity opp:listOpps){
    opp.StageName='08. Delivery Invoiced';
        opp.QA_Order_Control__c=oppQAIdMap.get(opp.id);
        opp.Block_Sales_Team__c= false;
        opp.Advise__c=false;
        //update this field
        opp.CloseDate=date.today();
}

if(!listOpps.isEmpty()){
    try{
        update listOpps;
    }catch(System.Dmlexception e){
         system.debug (e); 
    }
}
   
}

 
Hi
i have a text field separate by semicolon, for example

word1;word2;word3;word4;word5

and i want a custom formula field for each word, for example

field A  populated by word1
field B  populated by word2
field C  populated by word3
field D  populated by word4
field E  populated by word5

i have these formula, but only works with one semicolon
LEFT(textfield__c, (FIND(",", textfield__c)-1))

RIGHT(textfield__c, (LEN(textfield__c) – FIND(",", textfield__c)))


Thanks for your help


Hi 
i have created this simple trigger but i don't know how to do a test class.
please help me, it looks simple trigger and i suppose that is a simple test class.

trigger Block_Unblock_RejectionsTriger on QA_Order_Control__c (before insert,before update) {


for (QA_Order_Control__c objqaoc : Trigger.new)

{
if  (objqaoc.Reject_team__c!=null  )

   {
    objqaoc.Was_Created__c= true;
   
     }
   else {
    objqaoc.Was_Created__c= false;
         }
}


Hi Guys, i need your help, i am new in apex code.
this is the case:
I have 2 Objects
  • Custom Object, called "QA_Order_Control__c"
  • Opportunity Object
I have 2 picklist fields:
  • "Reject_team__c" inside Custom Object
  • "StageName" inside Opportunity
the logic is:
WHEN "Reject_team__c" = "sss" on Custom Object
UPDATE field "StageName" ="10. Rejected by Operations SSS" on Opportunity.




trigger QARejectUpdatesOppStage1 on QA_Order_Control__c(before insert,before update){

List<Id> conIds = new List<Id>();
    List<Opportunity> newAssetlist =  new List<Opportunity>();
   
    for(QA_Order_Control__c cnt:Trigger.new){
    if(cnt.Reject_team__c=='SSS'){
        conIds.add(cnt.Id);
    }
    }
   
List<Opportunity> childAssets = [Select QA_Order_Control__c, StageName FROM Opportunity WHERE QA_Order_Control__c IN:conIds];

for(Opportunity a : childAssets){
        a.StageName='10. Rejected by Operations SSS';
        newAssetlist.add(a);
    }
  
   if(childAssets.size() > 0)
           
    {
   
    try
         {
            update newAssetlist;
         }
             catch (System.Dmlexception e) 
         {
         system.debug (e);
         }
    }   
   
   
}










Hi
anyone can help me to verify if my "and" function goes well, because doesnt work my code.
tks in advance

<apex:page standardController="QA_Order_Control__c" rendered="{(!QA_Order_Control__c.Line_Item_Brands_Opp_B__c== 'EMC')&&(!QA_Order_Control__c.OPS360_Status__c=='01.SentToOpps') }">


 <script type="text/javascript">
  { window.alert("Ponte Chingon"); }
 </script>
</apex:page>
Hi
anyone can help me to verify if my "and" function goes well, because doesnt work my code.
tks in advance

<apex:page standardController="QA_Order_Control__c" rendered="{(!QA_Order_Control__c.Line_Item_Brands_Opp_B__c== 'EMC')&&(!QA_Order_Control__c.OPS360_Status__c=='01.SentToOpps') }">


 <script type="text/javascript">
  { window.alert("Ponte Chingon"); }
 </script>
</apex:page>
Hi
I have a trigger but for unknown reason doesnt fire, exists some functionallity in "Developer Console"  figure out how or why stopps the trigger execution.
tks in advance
Hi
My trigger fires every time when the record its updated, how to prevent because i need to fire just once.
thanks in advance.

trigger QARejectUpdatesOppStage1_RAMU_VINIT_3 on QA_Order_Control__c(after insert,before update){
system.debug('===========');

//Unlock opportunity
//Update the opportunity stage to '08. Delivery  Invoiced' for 17.Invoiced QAOC and update the QAOC to the opportunity page
Map<Id,Id> oppQAIdMap=new Map<Id,Id>();
for(QA_Order_Control__c qaoc:Trigger.New){
    if(qaoc.Status__c=='17. Invoiced'&& qaoc.Country_user__c=='MX') {
        oppQAIdMap.put(qaoc.Opportunity__c,qaoc.id);
    }   
}
//Update fields
list<Opportunity> listOpps=new list<Opportunity>();
listOpps=[Select id,StageName,QA_Order_Control__c from Opportunity where id IN:oppQAIdMap.keySet()];
for(Opportunity opp:listOpps){
    opp.StageName='08. Delivery Invoiced';
        opp.QA_Order_Control__c=oppQAIdMap.get(opp.id);
        opp.Block_Sales_Team__c= false;
        opp.Advise__c=false;
        //update this field
        opp.CloseDate=date.today();
}

if(!listOpps.isEmpty()){
    try{
        update listOpps;
    }catch(System.Dmlexception e){
         system.debug (e); 
    }
}
   
}

 
Hi
i have a text field separate by semicolon, for example

word1;word2;word3;word4;word5

and i want a custom formula field for each word, for example

field A  populated by word1
field B  populated by word2
field C  populated by word3
field D  populated by word4
field E  populated by word5

i have these formula, but only works with one semicolon
LEFT(textfield__c, (FIND(",", textfield__c)-1))

RIGHT(textfield__c, (LEN(textfield__c) – FIND(",", textfield__c)))


Thanks for your help


I am using the below syntax which I have seen posted as a solution but I am getting an error.

IF( INCLUDES(Service_Engineer__c, "Alan Clarkson"), "Alan Clarkson; ","")
&
IF( INCLUDES(Service_Engineer__c, "Alan Eadie"), "Alan Eadie; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Dave Matthews"), "Dave Matthews; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Dean Hunt"), "Dean Hunt; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Paul Beddard"), "Paul Beddard; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Paul Levay"), "Paul Levay; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Richard Hatch"), "Richard Hatch; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Veritek"), "Veritek; ", "")
&
IF( INCLUDES(Service_Engineer__c, "Dave Beswick"), "Dave Beswick; ", "")

The error I am getting is Error: Incorrect parameter type for function 'INCLUDES()'. Expected Picklist, received Text

I am positive the field "Service_Engineer__c" is a multi-Picklist field so i do not know why I am getting this error.

Hi 
i have created this simple trigger but i don't know how to do a test class.
please help me, it looks simple trigger and i suppose that is a simple test class.

trigger Block_Unblock_RejectionsTriger on QA_Order_Control__c (before insert,before update) {


for (QA_Order_Control__c objqaoc : Trigger.new)

{
if  (objqaoc.Reject_team__c!=null  )

   {
    objqaoc.Was_Created__c= true;
   
     }
   else {
    objqaoc.Was_Created__c= false;
         }
}


Hi Guys, i need your help, i am new in apex code.
this is the case:
I have 2 Objects
  • Custom Object, called "QA_Order_Control__c"
  • Opportunity Object
I have 2 picklist fields:
  • "Reject_team__c" inside Custom Object
  • "StageName" inside Opportunity
the logic is:
WHEN "Reject_team__c" = "sss" on Custom Object
UPDATE field "StageName" ="10. Rejected by Operations SSS" on Opportunity.




trigger QARejectUpdatesOppStage1 on QA_Order_Control__c(before insert,before update){

List<Id> conIds = new List<Id>();
    List<Opportunity> newAssetlist =  new List<Opportunity>();
   
    for(QA_Order_Control__c cnt:Trigger.new){
    if(cnt.Reject_team__c=='SSS'){
        conIds.add(cnt.Id);
    }
    }
   
List<Opportunity> childAssets = [Select QA_Order_Control__c, StageName FROM Opportunity WHERE QA_Order_Control__c IN:conIds];

for(Opportunity a : childAssets){
        a.StageName='10. Rejected by Operations SSS';
        newAssetlist.add(a);
    }
  
   if(childAssets.size() > 0)
           
    {
   
    try
         {
            update newAssetlist;
         }
             catch (System.Dmlexception e) 
         {
         system.debug (e);
         }
    }   
   
   
}