• kevohara
  • NEWBIE
  • 50 Points
  • Member since 2011
  • CTO
  • LevelEleven


Badges

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 51
    Replies

Hi All,

 

I'm very (very) new to Apex code development but am trying to accomplish a simple task. I have a custom button that points to a VisualForce where I intend to call a short code through a controller. I need the block of code to take a simple action: update the record owner Id (on the Account object) to the current user's ID who has just clicked the button. Simply, this button allows someone to 'claim' an Account. 

 

Any help at all would be greatly appreciated - I'm failing miserably at writing the code!

 

Thx.

Hi, need help with assigning a picklist value to a string. Something like this

 

Reference_Key2__c = TEXT(Dispute_New__c.Status__c)

 

where 'status__c' is a pick list and Reference_Key2__c is a string.

I feel like I periodically run into this issue and feel quite certain that this is a bug. Maybe someone can help.

 

In my controller, I have a Map that looks like this...

 

Map<String, List<CustomObjectWrapper>> objMap;

 My key is a category field for my Custom Object wrapper which looks like this...

 

public class CustomObjectWrapper {
  public boolean selected {get; set;}
  public Custom_Object__c customObject {get; set;}
}

 

 What I am doing in my Visualforce page is create a pageBlockTable for each of the keys (my category) in the map. The values are put into a table and the Description__c field is available for editing. Here is an example.

 

<apex:repeat value="{!objMap}" var="category" >
  <apex:pageBlock title="Category: {!category}">
    <apex:pageBlockTable value="{!objMap[category]}" var="obj">
      <apex:column value="{!obj.customObject.Name}" />
      <apex:column value="{!obj.customObject.Category__c}" />
      <apex:column headerValue="Description">
        <apex:inputField value="{!obj.Description__c}"/>
      </apex:column>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:repeat>

 

Now here is the weird part...

 

I have save button on the page that simply updates the records. 99% of the time the records update with no problem. However, when there are two keys in the map of category "VOE" and "Reference", the controller misplaces the values for the Description__c field. The descriptions get saved on the incorrect records. Anything other than the combination of those two keys works fine! Completely bizarre.

 

I've read a bit about some dynamic VF issues with Maps but I don't see anythin definitive in the "Known Issues" list on the community site. Does anyone know if this is indeed a bug? And if so, are there any workarounds?

I am using v24.0 of the IDE. I have some test classes that have some initilization code in a static block. In this block I am inserting a record. I realized after the fact that I was not setting a required field on the record I was inserting. The odd thing is that this insert is failing silently and not showing an error. This behavior started after I updated the IDE to v24. v23 shows the uncaught exception as it should.

 

Has anyone else experienced this issue? When I open up the Test Runner Debug Log I can see the exception but I am not being prompted like in the past. This is making debugging really hard.

 

P.S. Before someone asks, I am not wrapping this in a try/catch block. :)

I am creating a validation "before" trigger that I am using to validate fields before inserting a record.  What I want to do is to create a log record every time a validation fails.  Ideally, I would want to:

 

1) Display the validation error to the user in typical fashion using the addError() method.

 

2) Insert a Log record into my custom object called "Log__c" to record the incident.

 

I can't find it in the docs, but the usage of the addError() method seems to disallow any DML...even to my custom object.  Whats weird is that I am not getting an exception on my insert statement.  In fact, the debug logs show that the insert was executed successfully, however, no record is actually created in my Log object.  My guess is that there is a rollback occurring when addError() is used.

 

I thought that executing my DML in a asynchronous method would circumvent this so I moved the log insertion into an @future method.  This didn't help either.

 

Is there a way I can perform this insert when my before trigger calls an addError() method on a field?

I am having a really strange issue with String.match() javascript functions in visualforce pages.  Consider the following JS function...

 

function testRegex() {
  
  var str = 'Product A - $125.99';
  priceMatches = str.match(/\$(.*)/g);
  alert(priceMatches[0]);

}

 

When I call this function from the Firebug console when this function is in a <script> tag on the Visualforce page, the alert box is blank.  When I look at the object, it shows an array with a single blank value:

 

[ " " ]

 

I copied/pasted the exact same function into a plain html page on my desktop.  When I call that function from Firebug I get the expected alert:

 

$125.99

 

Has anyone else had problems with this?  I should note that my VF page has jQuery and jQuery UI running as well, but this should make no difference.

 

This is driving me nuts.  Any ideas?

We have a solution that includes a custom object hanging off of Leads.  We have built a trigger that uses an "after update" action to populate an Opportunity lookup on that field when the lead is converted.  It basically check to see if the Lead "IsConverted", then grabs the "ConvertedOpportunityId" to populate the lookup on this custom object.

 

This has worked fine for months until yesterday when we introduced a time dependent WF rule on that custom object.

 

Now when we convert leads, we get this error.  It references our WF rule, but then also has a bunch of jibberish that I do not understand.  Here is the error.

 

Error: System.DmlException: Update failed. First exception on row 0 with id 00Q4000000ZAxfHEAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0H40000002rHJZEA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, The formula in the "Auto NDA DDP to DocuSign" rule or process is invalid due to the following:
java.sql.SQLException: ORA-20025: ORA-06512: at "SNEEZY.SACCESS", line 1237 ORA-06512: at "SNEEZY.CACCESS", line 2133 ORA-06512: at "SNEEZY.CACCESS", line 2064 ORA-06512: at line 1 : SQLException while executing plsql statement: {call cAccess.check_entity_access_ncu(?,?,?,?,?,?)}(common.request.SqlUserInfo@8f11af, common.request.SqlBtSettingsInfo@19ccfdf, 00Q4000000ZAxfH, 1, true, false): [] Trigger.LeadTrigger: line 104, column 9: [] (System Code) External entry point

 

Does anyone have a clue what is causing this?  And FYI, line 104 in the trigger is the update statement for the custom object after we have populated the Opportunity lookup.

 

And what the heck is SNEEZY??

 

Thanks.

I am sort of struggling to figure out what best practices are for testing time and date dependent apex.

 

Example:

 

I have an apex class that generates something like customer statements.  The class sets a date variable using System.today() and figures out the month.  Based on the month, it responds differently.  In December, for example, it calculates a year end summary but does not calculate this any other month of the year.

 

When writing unit tests, I need to be able to test every month to make sure it's repsonding correctly.

 

How have others addressed this?  I could have a testMode Boolean variable that I could set to tell the class to use the System date (testMode = false) or a supplied date in another variable (testMode = true).  

 

Is this considered best practices?

I am trying to develop a VF controller extension that works with Leads and Opportunities.  In my constructor I am checking the sObjectType of the standard controller then handling everything else according to whether its a Lead or an Opportunity.  For some reason, I am getting an "invalid field Lead.sObjectType" error when saving in the IDE.  I get no such error with the Opportunity.sObjectType.  How is this possible?

 

 

public class EventsController {
	
	private final Lead lead;
	private final Opportunity opp;	
	
	public EventsController(ApexPages.StandardController controller) {
		
		
		sObject record = controller.getRecord();
		Schema.sObjectType objType = record.getSObjectType();
		
		if(objType == Lead.sObjectType) {
			
			//Process the lead 
					
		} else if (objType == Opportunity.sObjectType) {
			
			//Process the opportunity
					
		}
		
					
	}

}

 

Again, only the Lead.sObjectType is giving me problems.  I tested it with only the Opportunity.sObjectType and it works fine.

 

Any suggestions?

 

 

 

We have a custom web service built in Salesforce and are connecting to it with .NET.  After adding the WSDL as a web reference in Visual Studio, we are able to create the required Enumerations and pass them into the web service.

 

The problem is that the Apex web service is getting null values for all of the Enumeration variables.  We tested this in Java and we do not have an issue there.

 

Is there a problem with Enumerations being sent over from .NET?  I am not a .NET developer so I do not know how .NET normall handles this.

I am building a Lead prioritization class for a client.  To give a background, here are the requirements.

 

1) Sales reps are assigned one lead at a time

2) Leads are held in queues until they are assigned

3) Leads are dynamically prioritized, then assigned programatically at the time of request based on numerous factors...including time of day

 

So I have a pretty awesome class that does this prioritization and dishes one lead out at a time.  My only concern is that with the expected volume of Lead requests, there could be a possibility of accidentally re-assigning a lead to another rep that was just assigned.

 

Example:

 

Rep A makes a request for a lead.  At nearly the same time, so does Rep B.  

 

During the request, the appropriate queue is queried by the Prioritization class and about 50 records are returned.  Some calculations are performed and the list of Leads are prioritized and reordered.  The class then assigns the top Lead to the rep by updating that single record.

 

So if Rep A and Rep B make a request at the same time, it's possible that the class queries the same 50 records for each rep.  I need to make sure that if a lead is assigned to a rep, it is no longer available to anyone else to be reassigned.

 

Do I need to introduce locking or some other keyword or modifier?  Am I overthinking this?  Any help is appreciated.  

Hi,

 

I did a lot of googling and I am struggling to find out how to call my custom webservice method from Java.  I have set up my project to use WSC and the partner WSDL.  I have downloaded the WSDL for my custom class containing the webservice but I'm not sure what to do with it or how to call it.  

 

Can someone walk me throught the steps?  For reference, I have this project set up in eclipse and I am able to connect to the API using the WSC and partner wsdl.  I just need to know how to incorporate the custom WSDL, and how to call my service.

I am using CLIq to build a CLI Data Loader Job.  I keep getting exceptions that tell me that the field mappings are invalid for the fields in the CSV that should not be mapped.  I get the following exception...

 

 

Exception occured during loading
com.salesforce.dataloader.exception.MappingInitializationException: Field mapping is invalid: Street2 => 

Exception occured during loadingcom.salesforce.dataloader.exception.MappingInitializationException: Field mapping is invalid: Street2 => 

 

 

For some reason, it does not like the fields that arent mapped.  I am really confused why this is happening because the SDL file workes in the Data Loader GUI, but not the CLI.  

 

Here is my process-conf file...

 

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
	<bean id="paLeadInsert" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false">
		<description>Created by Dataloader Cliq.</description>
		<property name="name" value="paLeadInsert"/>
		<property name="configOverrideMap">
			<map>
				<entry key="dataAccess.name" value="C:\dataloader\cliq_process\paLeadInsert\read\paLeadInsert.csv"/>
				<entry key="dataAccess.readUTF8" value="true"/>
				<entry key="dataAccess.type" value="csvRead"/>
				<entry key="dataAccess.writeUTF8" value="true"/>
				<entry key="process.enableExtractSuccessOutput" value="true"/>
				<entry key="process.enableLastRunOutput" value="true"/>
				<entry key="process.lastRunOutputDirectory" value="C:\dataloader\cliq_process\paLeadInsert\log"/>
				<entry key="process.mappingFile" value="C:\dataloader\cliq_process\paLeadInsert\config\paLeadInsert.sdl"/>
				<entry key="process.operation" value="insert"/>
				<entry key="process.statusOutputDirectory" value="C:\dataloader\cliq_process\paLeadInsert\log"/>
				<entry key="sfdc.bulkApiCheckStatusInterval" value="5000"/>
				<entry key="sfdc.bulkApiSerialMode" value="5000"/>
				<entry key="sfdc.debugMessages" value="false"/>
				<entry key="sfdc.enableRetries" value="true"/>
				<entry key="sfdc.endpoint" value="https://test.salesforce.com/services/Soap/u/21.0"/>
				<entry key="sfdc.entity" value="Lead"/>
				<entry key="sfdc.extractionRequestSize" value="500"/>
				<entry key="sfdc.insertNulls" value="false"/>
				<entry key="sfdc.loadBatchSize" value="100"/>
				<entry key="sfdc.maxRetries" value="3"/>
				<entry key="sfdc.minRetrySleepSecs" value="2"/>
				<entry key="sfdc.noCompression" value="false"/>
				<entry key="sfdc.password" value="ENCRYPTEDPASSWORD"/>
				<entry key="sfdc.timeoutSecs" value="60"/>
				<entry key="sfdc.useBulkApi" value="false"/>
				<entry key="sfdc.username" value="username@test.com"/>
			</map>
		</property>
	</bean>
</beans>

 

And here is my SDL file....

 

 

# SDL Mapping File
SearchKey=
BorrowerBirthDate=Borrower_Birthdate__c
MiddleName=
FirstName=FirstName
LoanPurpose=Purpose__c
EmailHId=
HashedSSN=
Zip=PostalCode
LeadSystemId=
City=City
Email=Email
OwnerID=
Street2=
WorkPhone=Work_Phone__c
Street1=Street
CoBorrowerHomePhone=Co_Borrower_Home_Phone__c
Stat60Dt=
CoBorrowerBirthDate=Co_Borrower_Birthdate__c
CellularPhone=Mobile_Phone__c
County=County__c
Suffix=
CLTV=
CoBorrowerMaritalStatus=Co_Borrower_Marital_Status__c
LoanNumber=Loan_Number__c
WorkPhoneExtension=
CoBorrowerLastName=Co_Borrower_Last__c
GCId=GCId__c
LoanAmount=Loan_Amount__c
FICO=
Comments=Description
CoBorrowerFirstName=Co_Borrower_First__c
DOB=
BorrowerMaritalStatus=Marital_Status__c
Zip4=
HomePhone=Phone
State=State
CoBorrowerWorkPhone=Co_Borrower_Work_Phone__c
InterestRate=
LeadTypeCode=Lead_Type__c
EncryptedSSN=
LTV=
CoBorrowerMiddleName=
StatusId=
LastName=LastName
CoBorrowerCellPhone=Co_Borrower_Mobile_Phone__c
BankerName=Banker_Name__c

 

Anyone know how to fix?

 

 

I have an issue that I cant seem to resolve.  I have a Force.com Free Edition org an I am building some Pages in the Sandbox.  I have a simple custom object that is acting sort of like a Hit counter.  It's just got a couple of text fields and a timestamp field right now.

 

My controller is working fine.  The page is rendered and pulls/displays data from another custom object just fine.  The problem occurs when I try to insert a record to this Hit Counter object.  I am routed to the "Required Login" screen.  If I comment out the insert statement, the page is fine.  I am well aware of the permissions that need to be available to the guest user under Sites -> Public Access Settings.  Here is what I know so far...

 

 

  • The object in question has read, create, and edit checked for the guest user
  • The field level security is set to visible for everything and nothing is checked to be read only for the guest user (except for the system fields that you cant change)
  • The guest user has access to all VF Pages
  • The guest user has access to all Apex classes
  • There are no triggers on the custom object
  • There are no validation rules on the custom object.
  • There are no relationship fields on the custom object
  • Sharing rules on the object are public R/W
  • The Controller is not using "with sharing" modifier
The only thing I can think of at this point is that it has something to do with the org being a Free Edition, or the fact that its in the sandbox.
Here is my controller, but I dont think its the problem.
public class LandingPageController {
		
	private String pid;
	
	public Landing_Page__c page {get; private set;}
	public String errormsg {get; private set;}
	private PageReference pageRef = ApexPages.currentPage();
	private Map<String, String> headers = pageRef.getHeaders();
	private Map<String, String> getParams =PageRef.getParameters();		
    
    public LandingPageController() {
        
        pid = getParams.get('pid');
                
        if(pid != null) {
	        page = [SELECT Id, Name FROM Landing_Page__c WHERE LPN__c = :pid];
        }
        
        if(page == null) {
        	errormsg = 'No page returned!';
        } else {
        	        	
        	Hit__c hit = new Hit__c();
				
			hit.IP_Address__c = headers.get('True-Client-IP');
			hit.LPN__c = getParams.get('pid');
			hit.Timestamp__c = System.now();
			
			insert hit; // <- THIS IS THE PROBLEM   
			   	
        }        

        
    }

}

 

Any ideas?  Thanks in advance.
Also, thanks to my Tweeps for helping me to try to troubleshoot this yesterday!

 

Admittedly, I am not very good at regular expressions.  I was wondering if I could get some help on this.

 

I have an application that brings back a mathematical expression in the form of a string.  Example:

 

 

String test = '(25.4 + 87.2) / (23.8 -1)';

I am trying to match each sub expression contained within the parentheses and calculate those value.  So I am trying to use Pattern/Matcher to find those sub-expressions and cant seem to get the results I am looking for.  Here is what I have so far...

 

 

 

String test = '(25.4 + 87.2) / (23.8 - 1)';

Pattern patt = Pattern.compile('\\((.*?)\\)');

Matcher matcher = patt.matcher(test);

System.debug('MATCHES: ' + matcher.Matches());
System.debug('GROUP COUNT: ' + matcher.groupCount());

 

I would need both of the expressions in the test returned.  The regex that I believe I need is...

 

\((.*?)\)

 

 

I have tested this regex on http://gskinner.com/RegExr/ and it works fine.  I am not getting any result using the Pattern/Matcher.

 

Any assistance would be appreciated.

 

Thanks

 

 

Suppose I have a string that contains an expression...

 

String exp = '25.4 + 10';

 

I want to take this string and use it as an expression, and get a Decimal value.  Is this possible?  How would I do this?

It seems that the new Summer'13 update enforces you to work with 18 character ID's always. For example, this happens in apex:

 

Id Id15 = string.valueOf(Id18).substring(0,15);
System.AssertEquals (Id15,Id18);

 

Pre-Summer that assertion fails, as Id15 is the 15 character Id and Id18 is the 18 character Id.
In our custom code many times we use Custom Setting and Custom Labels to avoid hardcoding recordtypes, profiles and other "constant" values. We usually worked with 15 character Ids as Salesforce (SOQL) sometimes returns 15 and other times returns 18 character Ids.

 

Now it seems the ID type always returns 18 character, if you do something like this the assertion is true:

 

Id Id15 = '012200000005byN';
System.AssertEquals (Id15,'012200000005byNAAQ');

 

As this is happening now with the Summer'13 but not happening before with Spring'13, this invalidates many coding.

We found this problem as Salesforce triggered a deep system error like this Salesforce System Error: 1619326252-34083 (1564369920) (1564369920) trying to compare a SelectOption loaded with record types with a Custom Settings String Id Stored.

 

This is a really weird annoyance. You can take a workaround working always with ID type instead of storing Ids into Strings, and always working with 18 character Ids, wether you hardcode Ids into apex and formulas (not a good approach) or you use custom setting and labels to store the ids.

 

Hope this helps... I lost all morning trying to figure out this.

I'm looking into the option of building a public facing REST based API on force.com but there is one issue about this that sticks out. Unlike public Visualforce pages, in which you can provide a custom URL (sort of, SSL is still not fully branded) there is no way to setup custom URLs for Apex REST or SOAP services. This includes logging in and invoking actions.

 

Even if we could brand these Apex Web Services we would still have the SSL issue. If salesforce.com wants force.com to become a real option for buidling services on it this issue needs to be addressed.

 

In the mean time is anyone familiar with work arounds? A proxy server perhaps that simply redirects requests to salesforce.com? I have no idea if this would work, just throwing out ideas.

 

Thanks,

Jason

I feel like I periodically run into this issue and feel quite certain that this is a bug. Maybe someone can help.

 

In my controller, I have a Map that looks like this...

 

Map<String, List<CustomObjectWrapper>> objMap;

 My key is a category field for my Custom Object wrapper which looks like this...

 

public class CustomObjectWrapper {
  public boolean selected {get; set;}
  public Custom_Object__c customObject {get; set;}
}

 

 What I am doing in my Visualforce page is create a pageBlockTable for each of the keys (my category) in the map. The values are put into a table and the Description__c field is available for editing. Here is an example.

 

<apex:repeat value="{!objMap}" var="category" >
  <apex:pageBlock title="Category: {!category}">
    <apex:pageBlockTable value="{!objMap[category]}" var="obj">
      <apex:column value="{!obj.customObject.Name}" />
      <apex:column value="{!obj.customObject.Category__c}" />
      <apex:column headerValue="Description">
        <apex:inputField value="{!obj.Description__c}"/>
      </apex:column>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:repeat>

 

Now here is the weird part...

 

I have save button on the page that simply updates the records. 99% of the time the records update with no problem. However, when there are two keys in the map of category "VOE" and "Reference", the controller misplaces the values for the Description__c field. The descriptions get saved on the incorrect records. Anything other than the combination of those two keys works fine! Completely bizarre.

 

I've read a bit about some dynamic VF issues with Maps but I don't see anythin definitive in the "Known Issues" list on the community site. Does anyone know if this is indeed a bug? And if so, are there any workarounds?

I am using v24.0 of the IDE. I have some test classes that have some initilization code in a static block. In this block I am inserting a record. I realized after the fact that I was not setting a required field on the record I was inserting. The odd thing is that this insert is failing silently and not showing an error. This behavior started after I updated the IDE to v24. v23 shows the uncaught exception as it should.

 

Has anyone else experienced this issue? When I open up the Test Runner Debug Log I can see the exception but I am not being prompted like in the past. This is making debugging really hard.

 

P.S. Before someone asks, I am not wrapping this in a try/catch block. :)

Is there a one-step way to wipe-out an org?

I was able to do a one-step deploy by using the migration tool. Now, I want to do a one-step undeploy.

I tried renaming the package.xml to destructiveChanges.xml as I read over there, but it doesn't work. I got errors like these:

Error: workflows/Domain__c.workflow(Domain__c):Cannot delete a workflow object;

Workflow Rules and Actions must be deleted individually

Warning: destructiveChanges.xml:No CustomObject named: * found
Warning: destructiveChanges.xml:No ApexPage named: * found
Warning: destructiveChanges.xml:No ApexComponent named: * found
Warning: destructiveChanges.xml:No StaticResource named: * found

What I'm doing right now is to create a new org each time a new to do a fresh deploy.

I really hope this is already implemented, if not please advise me in where to ask this to salesforce technical support.

Thanks!

  • September 26, 2011
  • Like
  • 0

ı have more than 1 before trigger for the same object. Can anyone knows a good template for that? Both of them works great in Sandbox but I receive null pointer error from the test code.

  • September 26, 2011
  • Like
  • 0

I have a client who wants to use Salesforce for two completely different things - one group will use one set of tables (objects), and the other group will use another set of tables. There is no interaction between to two sets of functionality.

 

One set of functionality is already developed and working. The other is my job.

 

Should I just create new objects and pages inthe existing application, and then set up profiles so that one group sees their stuff, and the other group sees their stuff? Or should I create two completely different applications?

 

If the latter, how do I get to a screen with an essentially blank application. When I click on the link to create a new applicatication, I just get sent to developer.force page.

 

Thanks in advance for any help.

I am creating a validation "before" trigger that I am using to validate fields before inserting a record.  What I want to do is to create a log record every time a validation fails.  Ideally, I would want to:

 

1) Display the validation error to the user in typical fashion using the addError() method.

 

2) Insert a Log record into my custom object called "Log__c" to record the incident.

 

I can't find it in the docs, but the usage of the addError() method seems to disallow any DML...even to my custom object.  Whats weird is that I am not getting an exception on my insert statement.  In fact, the debug logs show that the insert was executed successfully, however, no record is actually created in my Log object.  My guess is that there is a rollback occurring when addError() is used.

 

I thought that executing my DML in a asynchronous method would circumvent this so I moved the log insertion into an @future method.  This didn't help either.

 

Is there a way I can perform this insert when my before trigger calls an addError() method on a field?

Hi All,

 

I'm very (very) new to Apex code development but am trying to accomplish a simple task. I have a custom button that points to a VisualForce where I intend to call a short code through a controller. I need the block of code to take a simple action: update the record owner Id (on the Account object) to the current user's ID who has just clicked the button. Simply, this button allows someone to 'claim' an Account. 

 

Any help at all would be greatly appreciated - I'm failing miserably at writing the code!

 

Thx.

Hi all,

 

This may end up being a dumb question, but I'm very grateful for any help! I have a trigger that I'm trying to test, and though it works when I test it manually via a UI case update, I can't get the test to work at all.

 

The trigger is designed to catch cases before update and, if the associated asset has changed, update a field on the case to match a corresponding field on its asset. Here's a snippet of the test:

 

[test cases and assets created and inserted above, including optedInAsset and caseForOptedOutAsset ...]

Case updatedVersion1 = [Select Id, Opt_In__c, AssetId from Case where Id=:caseForOptedOutAsset.Id limit 1];

updatedVersion1.AssetId = ID.valueOf(optedInAsset.Id);

update updatedVersion1;

updatedVersion1 = [Select Id, Opt_In__c, AssetId from Case where Id=:updatedVersion1.Id limit 1];

System.assertEquals(true, updatedVersion1.Opt_In__c);

[...]

 

For some reason, this assert always fails, though, again, it works smoothly in the UI. I don't seem to even be able to force it--it's like the "before update" trigger is being ignored, and the AssetId field is just being updated without firing any trigger.

 

Is there anything that could cause a trigger to not fire or be somehow truncated in the context of an Apex test?

 

Thanks again!

 

  • September 25, 2011
  • Like
  • 0

I wanted to know if there's a traditional way of using ajax within VF. I get the ease of using VF functions but it will be a nightmare to separate out the code if you decide to move to another platform and reuse the same front end code. For instance, we have an app that temporarily use Salesforce but eventually will move to its own portal because SF cannot meet all of our needs. I want my javascript/css to be completely separated from VF so when it's time to move, it will be a simple as swapping our URL's inside the javascript files for the Ajax requests.

 

Thai

I am trying to import google analytics data (date, page views, visitors) on a daily basis, and want past data available for reporting / dashboards (kind of like historical invoices).

 

What are the best practices around doing this?

 

I created a custom object and custom fields, but it seems like that will be overwritten daily, and won't give me a nicely formatted excel-style list with columns.

 

Is there a way to create a custom related list, or should I create custom fields within the activity lists and use those?

 

My longer term plan is to have a number of different custom metrics, imported daily, so I want to start off correctly.

 

thanks in advance.

  • September 20, 2011
  • Like
  • 0

1.       What are the Cloud Srevices available in salesforce?

  • September 15, 2011
  • Like
  • 0
Hi,

I am trying to migrate profiles from one salesforce org to the other through eclipse. I have included all possible components in the project from the source org and when I deploy the profile to the target development org using the 'deploy to server wizard' of eclipse. It deploys on the profile on the target org but there are certain mismatches in the deployed profile. These mismatches are related to tabviibilities, standard object permissions and general user permissions. 

Is there a bug here in the metadata deployment of profiles or am I missing something here ?

Thanks in advance.