A proprietary Java-like programming language for the Force.com Platform.

learn more… | top users | synonyms

1
vote
0answers
8 views

How to use Data Category Visibility in a data category picklist that generated from code

Problem description: I have a picklist for data categories which I am generating dynamically from apex code, currently because I'm doing it from code using Schema.describeDataCategoryGroups and ...
1
vote
0answers
6 views

Implement Article KnowledgeBase vote stars picking and view stat updating

Problem description: I wanted to show the default preview knowledge article window when user click on an article from an articles list, in a modal window inside users portal site. I use a bootstrap ...
2
votes
1answer
20 views

How to avoid site page view?

After i search Salesforce sites limitation document, i found that max page view count by month. If exceed the max page view, Salesforce will sand billing mail to administrator. But, in my customer ...
0
votes
1answer
15 views

System.ListException: Before Insert or Upsert list must not have two identically equal elements - Deep Dive

I had the following exception thrown at me when trying to process more than one selected records via a custom button in the list view. Class Code global class MerchandiseInventoryClass { ...
1
vote
1answer
15 views

Custom Button to mass update records

I would like to know whether it is possible to put a custom button say "Convert All" in the following view along with "New Merchandise", "Change Owner" buttons. This custom button would act on all ...
0
votes
1answer
17 views

CommandButton action doesn't populate selectList field

I've got a simple VisualForce page with a form that has one custom picklist. My controller successfully populates the custom picklist and the page renders fine. But when I click on the CommandButton ...
0
votes
1answer
22 views

Mock Unit Test for a REST API callout

After attending DF14 I have a fairly solid understanding of the HttpCalloutMock() when unit testing for REST callouts, but I'm having trouble implementing it for the first time. The documentation I've ...
1
vote
1answer
19 views

Test class for VF form can't refer to input: 'variable does not exist'

I am very new to the model-view-controller and have barely been able to get my code functional, but now I'm struggling even more trying to write test code! This is my first wrapper class, controller ...
9
votes
2answers
68 views

Why is =+ (equals plus) valid in Apex?

Just fixed an unfortunate bug. I was trying to concatenate a string. But it kept getting replaced by the string it should have been adding. Couldn't figure it out for a while. I was doing the ...
1
vote
1answer
28 views

Apex trigger not working

I have tried to set the name field of the Volunteer Job object to the case number or an auto increment number and neither seems to be working. I have tried to use a trigger: trigger AddCaseNumber on ...
0
votes
0answers
16 views

debug asynchronous/future processes

I'm trying to debug a the following error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: [] The error occurs when a method is called to create a task when an order ...
1
vote
1answer
26 views

Doubt regarding sets in apex

i have declared a set of id's. I initially added 2 different account id's to set as below Set<id> acctSet = new Set<id>(); acctset.add('001c000000g0ijo'); ...
1
vote
1answer
11 views

Dereferencing a Null Object error

1) This method "ConverttoInventory" is called via Custom Button on Page Layout. 2) The following below is a helper class whose static method "ConverttoInventory" is called with "Merchandise Id" ...
1
vote
0answers
25 views

VisualForce Page to Convert Leads to Opportunities

My colleague and I have been tasked to update our Convert Lead workflow. The process is still the same of converting the leads but we now have new fields and values that the user can choose and we ...
1
vote
1answer
45 views

Dynamically assign a sobject field name

Can i dynamically assign a sobject field a value.? Due to the poor data model setup of existing I am forced to do this My issue is fieldname on object is stored at some other object.Say for eg i have ...
0
votes
0answers
5 views

How to display or customize schedule report options in custom visual force page ?

I need to have some schedule reports functionality in my custom vf-page to let the user setup some scheduled reports. Is it possible to integrate this part of the default Schedule Report Page in my ...
1
vote
1answer
20 views

Apex Trigger - Query on Execution

I would like to do understand the following trigger execution. trigger MerchandiseTrigger on Merchandise__c (before insert) { Merchandise__c[] m = Trigger.new; for(Merchandise__c mer ...
0
votes
1answer
18 views

Traverse Parent Object on Map Get Method

I'm looking to retrieve the string value for the Inventory_Stage__c field in the following logic. The code is incomplete, but I'll post the relevant stuff of what I have. Any help in doing this would ...
1
vote
1answer
29 views

Updating OpportunityLineItem fields issue

I've written a trigger that updates some fields on the Opportunity Product object with Product values when the Opportunity reaches 95% probability. The trigger works when I edit and save the ...
6
votes
2answers
48 views

Best Design for an easily maintained Unit Test?

I'm attempting to design a Unit Test Utility that we can use across our 15++ UE Orgs. I'm aiming to accomplish the following goals: Reads from a declaratively-maintained map of required field/values ...
0
votes
3answers
52 views

Assertion failed, expected null

I'm currently trying to test my trigger but it keeps expecting null instead of date.today(). Can anyone help me? Trigger: Trigger UpdateLastSurveySent on Case (after insert, after update) { ...
1
vote
1answer
20 views

Custom Lookup on VF Page

This is my VF Page. <apex:page standardController="Account"> <apex:form > <apex:pageBlock title="{!account.Name}" > <apex:pageblockSection > <apex:inputField ...
-1
votes
1answer
34 views

Writing a test method to increase code coverage

I have been trying for about a week to figure out how to write a test method that will increase my code coverage and cannot figure it out. This is the code I have. public class ConvertToVolunteerJob ...
2
votes
1answer
25 views

How can I get system apex classes using SOAP API (or any other API)

Is it possible to get a list of system apex classes like String, Datetime etc. and a list of their methods, fields etc. using soap or metadata or tooling api in java?
0
votes
2answers
20 views

Database.Delete Error

List<Contact> c = [SELECT ID FROM Contact WHERE AccountId !='00190000016ozwL']; System.debug(c.size()); Database.SaveResult[] srList = Database.delete(c, false); This is anonymous apex ...
1
vote
1answer
20 views

share a file to a community user through APEX

I want to share/post a document to a Community user through APEX . Suggest some work around for this through APEX code.
2
votes
1answer
18 views

How to prevent update if validation rules are not successfully passed?

Is it possible to check, before update an object, if the validation rules for this object are respected ? I try to update some objects and I have the error below : ...
2
votes
1answer
32 views

how can we raise Salesforce Sites hours

i am facing a issue for salesforce sites function. As i know, salesforce sites function in production org have 60h per day. but, my customer said that the 60 hours pre day can not match the ...
1
vote
1answer
148 views

Best Practice on Triggers

I have the following trigger logic built in Contact object during Create event. If Mobile Phone is given and Home Phone is not given while creating a contact, then set the Mobile as Home Phone ...
2
votes
1answer
30 views

apex cpu time limit exceeded error in salesforce

How can i handle this error in salesforce ? i know that it occurs due to inner loops my code is for(tblproperty__c t:CheckAvailability) { for(tblpropertyamenities__c te: CheckPropertyAmenity) ...
2
votes
1answer
32 views

The input text <apex:inputtext> in a repeat (for loop) doesn't work with the validation required field

I have a custom object Team member contains four text fields First Name , Surname, location and job title and First Name and Surname is a required fields (When i create them i make them required). ...
3
votes
1answer
16 views

apexrest: controlling HTTP error codes on exceptions

Is it possible to control what HTTP error code apexrest returns when an exception occurs in the code? By default it returns a 500 error and a developer who's working on the system that's consuming ...
4
votes
2answers
59 views

Test Class SeeAllData=true Annotation

I am creating a test class that will test my controller class which uses almost 5 to 8 objects that has many DML statements like insert and delete, however I am feeling a little bit worried about not ...
0
votes
2answers
16 views

How to extract all Chatter messages of a user in Apex

I want to do some language analysis based on Chatter messages and never manipulated Chatter with Apex code before. How would I get all the Chatter message text of a certain user? Would I need to ...
2
votes
1answer
16 views

Constructor not defined error when deploying to production

i'm getting a bit lost in the weeds with the error I'm getting when trying to deploy this simple test class to production. In the sandbox, it compiles fine and runs fine test-wise, but when it comes ...
1
vote
1answer
34 views

Salesforce API login Status=Server Error, StatusCode=500

In the past i implemented following example http://developer.force.com/cookbook/recipe/verifying-password in order to login a user via API: I've exactly same code and it worked for 1year. Now it ...
6
votes
2answers
94 views

List of Features and Limits which can be activated/increased by the support

There are a lot of features which can be activated and limits which can be increase if you contact the support. As an examples you can log a case to do the following: Activate: Organization ...
2
votes
1answer
22 views

Populating standard name field with a case number

I am trying to populate the standard name field of an object with the case number. I have tried to use an apex class to accomplish this. Here is the code I used: GW_Volunteers__Volunteer_Job__c ...
0
votes
1answer
18 views

How to minimize the view state of the custom visual force page.

How to minimize the view state of the custom visual force page. I have a custom VF page where I have a map that contains the list of sObject names. I need to make it available on the VF page to access ...
1
vote
0answers
9 views

Add value in dashboard filter using apex code

I have one filter criteria which gets changed for every report that i am using in my dashboard. I cheeked about adding filter in dashboard. But a user needs to add the filter values manually. I ...
0
votes
1answer
29 views

Retrieving Record from Top Level of a Nested For Loop

Still very much a trigger noob, so if there's a more efficient way to accomplish this, please let me know. Basically, this trigger should be creating a new 'In' inventory transaction every time an ...
1
vote
2answers
61 views

How to determine UTC for a date/time represented in a time zone other than the current user's time zone?

How do you determine the UTC of a civil date/time represented in a time zone other than the current user? I know this occurs automatically when using the DateTime.newInstance() method but it's always ...
1
vote
1answer
26 views

Verify getChildElement() is not null

As a follow up to my previous post: REST API calls to 3rd Party (Pardot), multiple @future callouts There are two responses I expect back when I attempt this Web Service callout to Pardot: 1) ...
1
vote
2answers
27 views

Null Value for method called by command button

Following is my VF page: <apex:page standardController="Case" extensions="ctrlClaim"> <!--read--> <style> .customPopup{ background-color: white; ...
1
vote
0answers
5 views

Setting Channels on Knowledge Articles from Apex

I'm actually creating a knowledge article from my apex class and I need to provide access to our external users (i.e. community / portal users) so that they could access these newly created knowledge ...
7
votes
1answer
62 views

Should I add Sandbox support to VFFiddle? [on hold]

I'm working on some updates to to VF Fiddle. I want to gauge the interest in running fiddles in sandbox and get some feedback on the security concerns. Because fiddles are not reviewed they could ...
2
votes
1answer
10 views

Counting Activities (Open/Closed Tasks and Open/Closed Events) Compile Error: expecting a colon, found 'system.now'

Issue: Below is a part of my class for updating Activity Count fields. I want to only select the id's from closed Tasks and also closed Events. I have no clue why my two lists below give me the ...
1
vote
1answer
26 views

Custom Object Creation Trigger failing in Test only due to null Opportunity.Account.Name value

We have written a trigger that creates a custom object Opportunity Labor upon the insertion of an Opportunity. It works quite well in all aspects in the Sandbox, though fails during Apex testing due ...
3
votes
1answer
70 views

How to identify Advanced currency is enabled in apex class?

I need to write some apex code when advanced currency management going to enable in our company. Because salesforce supports only for a limited objects that supporting dated currency rates.Previously ...
0
votes
2answers
34 views

Increase test coverage for query IsSandbox =true

I am checking for sandbox with help of query select Id from Organization where IsSandbox =true limit 1 but now in production and developer org my code coverage is going down to 33% as this query is ...