• KidNiki
  • NEWBIE
  • 60 Points
  • Member since 2011

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

I have to write a trigger for checking the last modified date of an object before update. I need to compare the old value with the new value and if the new date is smaller, the trigger show be discarded (i.e. no update).

 

How to get both(old and new) values of a field?

Also, if the condition is true how to discard the trigger from updating?

 

Need Help.

Hello,

 

I have a formula that uses the case function to add up values based on whats selected in a series of picklists:

 

CASE( q1__c , "YES", 1, 0)+CASE( q2__c , "YES", 1, 0)+CASE( q3__c , "YES", 1, 0)+CASE( q4__c , "YES", 1, 0)

 It does nothing and the formula field always comes back as 0, regardless of what I have selected.  Can anyone help me??

 

Thank you

Hello,

 

I've read through the docs and I've seen it used in code but I still don't fully comprehend when to use it.  I have an object with 34 pick lists on it, I want to loop through those, without having to write 34 if statements.  They are numbered like so, "q1__c", "q2__c", etc.  Could I use sObject.describe to get a count of these and then loop through them?

 

Thank you in advanced!

Hello,

 

I have been working on a visual force page that would allow some mobile users in my org to submit cases.  I havent gotten it all finished yet, but I was going to try and implament this via a VF page through a site and then set up the users as Customer Portal Users.  Anyway, I have some reservations about all this and wanted to know if anyone could tell me whether or not I could build an HTML5 mobile app that would allow these "Platform" users to submit Cases.  The Objects I need access to are: Accounts and Contacts and then of course Cases (Im currently using a method that uses the Schema object to get pick list values from the Case object).  Anyway, is this possible?  Again, these people dont really need CRM access, but the ability for them to submit a Case via a mobile app would be nice!

 

Thank you in advance!

 

If I have a button on the accounts page that is set to open an email template.  Can I use a trigger to set some fields on the account once the email is sent via a trigger?

 

Thank you! :smileyhappy:

 

 

Can anyone help me with this please?  I've gone all over the net looking at the different articles out there on how to return the id of an Apex component but nothing works and its kill'n me!  I know my static resource is working because I was able to do some basic jQuery on an HTML element.  No dice on the Apex stuff though :smileysad:

 

code:

 

<apex:page id="page" showHeader="false">
<apex:includeScript value="{!$Resource.jQuery}" />

<script type="text/javascript">

	     
	     	
	     $(document).ready(function(){
	     
	     $('[id$=":testLbl"]').value("New Value");
	        
   			
   	});
     
       
    </script>
   
    
<apex:outputLabel value="My Label Test!" id="testLbl"/>
<apex:outputPanel id="panel">
</apex:outputPanel>

</apex:page>

 

 

 

Is it possible to return the label value of the selected item in a selectlist to the controller.  Sorry, Im new at this and couldn't find anything.

 

I just want to know what the label of the currently selected item is instead of the value (which I need different for something else)

 

Thank you

Okay, I searched and couldn't find this so Im gonna have to ask.  Im building a VF page and I would like to keep certain things hidden and then unhide them based on the results of SOQL query's or code in the controller. 

 

I have an inputText component that the user uses to search with and a hidden selectList that I only want to be visible if the search returns more than one result.  Can I set this like I would an asp.net component in the controller or do I have to do this via JS somehow?  I have some other lists and fields I would like to do this with as well.

 

here is my code so far:

 

VF:

<apex:selectList id="dealerSelect" value="{!initStr}" size="1" disabled="true" rendered="false">
                <apex:selectOptions value="{!dealers}" />
            </apex:selectList>

 Controller:

if(dealerIDs.Size() > 1){
					//pageRef.
					ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, 'From Name: ' + dealerIDs[1].Name));
				}
				} catch(Exception e){
				ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, 'Error' + e));
				}

 The messages are there as references for myself right now.

 

 

Thank you!

 

Okay we have an external program that makes a soap connection and then updates the Account Object.  We were getting the

 


System.Exception: Too many SOQL queries: 101 error

 

So I changed the code to be bulk and use a map.  Anyway, I have the new code in Production and we are still getting this error, on the same line accessing the same outside class method. My code does everything in the trigger and doesn't even access the method anymore, beyond that the line number it says the error is on is a comment line in my trigger.  I have been messing with this for about a week... HELP!!!

 

 

Also, I have pushed this to production twice and it is valid and active.

 

Thank you!

 

 

 

 


Hello,

 

Im trying to write a trigger that updates a field with either the manager or the DelegatedApprover's name.  I used a list to pull all of the id's in to query the database and then a map to gather the info from the User Object.  The problem that I am running into is that when I run my query it returns everything but the referenced stuff.

 

here is my query/code:

 

for (SFDC_Expense_Header__c Expnse : Trigger.new){
		
		exRoleId.add(Expnse.OwnerId);
		
		
	}
	
	Map<id, User> usr = new map<id,User>([Select UserRoleId, Manager.Username, DelegatedApproverId.Username From User where id in  :exRoleId]);

 

ThanX for the help!

 

Hello,

 

I have a formula that uses the case function to add up values based on whats selected in a series of picklists:

 

CASE( q1__c , "YES", 1, 0)+CASE( q2__c , "YES", 1, 0)+CASE( q3__c , "YES", 1, 0)+CASE( q4__c , "YES", 1, 0)

 It does nothing and the formula field always comes back as 0, regardless of what I have selected.  Can anyone help me??

 

Thank you

Hello,

 

I've read through the docs and I've seen it used in code but I still don't fully comprehend when to use it.  I have an object with 34 pick lists on it, I want to loop through those, without having to write 34 if statements.  They are numbered like so, "q1__c", "q2__c", etc.  Could I use sObject.describe to get a count of these and then loop through them?

 

Thank you in advanced!

Hello,

 

I have been working on a visual force page that would allow some mobile users in my org to submit cases.  I havent gotten it all finished yet, but I was going to try and implament this via a VF page through a site and then set up the users as Customer Portal Users.  Anyway, I have some reservations about all this and wanted to know if anyone could tell me whether or not I could build an HTML5 mobile app that would allow these "Platform" users to submit Cases.  The Objects I need access to are: Accounts and Contacts and then of course Cases (Im currently using a method that uses the Schema object to get pick list values from the Case object).  Anyway, is this possible?  Again, these people dont really need CRM access, but the ability for them to submit a Case via a mobile app would be nice!

 

Thank you in advance!

 

I have to write a trigger for checking the last modified date of an object before update. I need to compare the old value with the new value and if the new date is smaller, the trigger show be discarded (i.e. no update).

 

How to get both(old and new) values of a field?

Also, if the condition is true how to discard the trigger from updating?

 

Need Help.

Can anyone help me with this please?  I've gone all over the net looking at the different articles out there on how to return the id of an Apex component but nothing works and its kill'n me!  I know my static resource is working because I was able to do some basic jQuery on an HTML element.  No dice on the Apex stuff though :smileysad:

 

code:

 

<apex:page id="page" showHeader="false">
<apex:includeScript value="{!$Resource.jQuery}" />

<script type="text/javascript">

	     
	     	
	     $(document).ready(function(){
	     
	     $('[id$=":testLbl"]').value("New Value");
	        
   			
   	});
     
       
    </script>
   
    
<apex:outputLabel value="My Label Test!" id="testLbl"/>
<apex:outputPanel id="panel">
</apex:outputPanel>

</apex:page>

 

 

 

Is it possible to return the label value of the selected item in a selectlist to the controller.  Sorry, Im new at this and couldn't find anything.

 

I just want to know what the label of the currently selected item is instead of the value (which I need different for something else)

 

Thank you

Okay, I searched and couldn't find this so Im gonna have to ask.  Im building a VF page and I would like to keep certain things hidden and then unhide them based on the results of SOQL query's or code in the controller. 

 

I have an inputText component that the user uses to search with and a hidden selectList that I only want to be visible if the search returns more than one result.  Can I set this like I would an asp.net component in the controller or do I have to do this via JS somehow?  I have some other lists and fields I would like to do this with as well.

 

here is my code so far:

 

VF:

<apex:selectList id="dealerSelect" value="{!initStr}" size="1" disabled="true" rendered="false">
                <apex:selectOptions value="{!dealers}" />
            </apex:selectList>

 Controller:

if(dealerIDs.Size() > 1){
					//pageRef.
					ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, 'From Name: ' + dealerIDs[1].Name));
				}
				} catch(Exception e){
				ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, 'Error' + e));
				}

 The messages are there as references for myself right now.

 

 

Thank you!

 

Okay we have an external program that makes a soap connection and then updates the Account Object.  We were getting the

 


System.Exception: Too many SOQL queries: 101 error

 

So I changed the code to be bulk and use a map.  Anyway, I have the new code in Production and we are still getting this error, on the same line accessing the same outside class method. My code does everything in the trigger and doesn't even access the method anymore, beyond that the line number it says the error is on is a comment line in my trigger.  I have been messing with this for about a week... HELP!!!

 

 

Also, I have pushed this to production twice and it is valid and active.

 

Thank you!

 

 

 

 


Hello,

 

Im trying to write a trigger that updates a field with either the manager or the DelegatedApprover's name.  I used a list to pull all of the id's in to query the database and then a map to gather the info from the User Object.  The problem that I am running into is that when I run my query it returns everything but the referenced stuff.

 

here is my query/code:

 

for (SFDC_Expense_Header__c Expnse : Trigger.new){
		
		exRoleId.add(Expnse.OwnerId);
		
		
	}
	
	Map<id, User> usr = new map<id,User>([Select UserRoleId, Manager.Username, DelegatedApproverId.Username From User where id in  :exRoleId]);

 

ThanX for the help!