Questions tagged [apex-code]

A proprietary Java-like programming language for the Force.com Platform, not to be confused with Oracle's Application Express (oracle-apex).

From the Salesforce.com page What is Apex?:

Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com​ API. Using syntax that looks like Java and acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pages. Apex code can be initiated by Web service requests and from triggers on objects.

For questions that are related to this tag you can use shorter tag - .

(Please use to refer to Oracle Application Express.)

Useful links:

Force.com Apex Code Developer's Guide

1514 questions
0
votes
1 answer

Link on current Visualforce page to render as PDF

I have a custom built list report page created using Visual force. A link on each row opens up the object details in a new visual force page. I need to have two buttons. One to save/open the current page with all of its information as a PDF and the…
Richard N
  • 895
  • 9
  • 19
  • 36
0
votes
2 answers

Visualforce -> Can "Apex:column"'s value attribute call a function to reformat what is being displayed?

I have written a dynamic search page to search custom object records. I use a SOQL query and bind the results to a data table. I need to change the output text on one of the columns, based on the value returned. Example: If the SOQL returned…
Richard N
  • 895
  • 9
  • 19
  • 36
0
votes
2 answers

Apex - SalesForce - Writing Test case for a Trigger

Hello Folks, I am really new to Apex Development and currently trying to write a test case for this trigger. Any kinds of help is really appreciated! trigger Milestone1_Expense_Trigger on Milestone1_Expense__c (before insert, before update) { …
subodhbahl
  • 415
  • 9
  • 22
-1
votes
1 answer

Incompatible key type SET for MAP: save Error

i have a map Map map1= new Map(); I am assigning values into this map map1.put(aList[j].id,err.getMessage()); // err is the database.error and aList is a list of accounts. i am trying to loop through all the map…
Prady
  • 10,978
  • 39
  • 124
  • 176
-1
votes
1 answer

Salesforce:Add record to a field which is dependent on the input of other field

I have an object named 'Salary'. There are three fields in it- 'Add Salary', 'Month' and 'Available Salary'. Also there is a lookup relationship from Salary object to 'User Name' object. For every user there is a salary record for every month.…
aset01
  • 19
  • 1
  • 2
-1
votes
1 answer

batch process to sync opportunity contact roles with custom object

since opportunity contact roles doesnt have an option to write triggers, i am using a batch process to sync it with my custom object. Opp and OpportunityContactRole are related with oppid, Project and customobj are related by projectid Project and…
Prady
  • 10,978
  • 39
  • 124
  • 176
-1
votes
1 answer

How to add the ability of comments on Knowledge base Article?

How do I add the ability of comments in a Salesforce.com (SFDC) knowledge base articles? Is SFDC providing us any standard stuff for this?
Kp Gupta
  • 483
  • 2
  • 7
  • 23
-1
votes
2 answers

Changing customer portal user profiles in Salesforce using Apex

I have a portal user and two profiles assigned to the portal. I want to run a trigger to change the profile whenever some conditions are met. Is this possible?
MxLDevs
  • 19,048
  • 36
  • 123
  • 194
-1
votes
1 answer

How to write to an existing Excel file in Oracle Apex 22?

I was trying to write in Excel file that is already located on the server. I'm using Oracle Apex 22. Is it avalibale? I was trying to write in excel file. but I couldn't find the way I have been searching for a while. Thanks in Advance.
MSamy
  • 1
-1
votes
2 answers

Salseforce Apex classes support Apache axis Stub authentication

We have converted a WSDL file of a Web serivice into the salesforce apex classes. The Web Service is receiving the authentication credentials in Apache axis Stub authentication username and password format. Below is the sample Apache axis Stub…
Ajay Dubedi
  • 208
  • 2
  • 11
-1
votes
1 answer

how to use json on httprequest setBody

here is my apex class I am getting this error DEBUG|{"status":400,"error":"There was a problem in the JSON you submitted [5132df156cbaf320d27f8e06f3b61656]: logged with error code"} public class makeCallOutIC1 { public String getContent(String…
Ruby Khan
  • 19
  • 3
-1
votes
1 answer

Unable to upload file as blob to table using Oracle APEX

I have a application built using Oracle APEX 20.x. The issue is need to programmatically upload the (.pdf,.txt,.png,.jpeg,.jpg) as a BLOB to table I heard about the APEX_APPLICATION_TEMP_FILES. How to utilize this table to upload my file as BLOB to…
-1
votes
1 answer

Salesforce change the format of created data in apex class

I have the following apex code that displays the created date of records: for(let i=0; i
-1
votes
1 answer

Can someone help in Bulkifying the below Apex code. The purpose here is to Remove Product Sharing When user is removed from AccountTeamMember

The purpose here is to Remove Product Sharing When user is removed from AccountTeamMember. List acctmListProd = [Select id,UserId, AccountId, TeamMemberRole FROM AccountTeamMember…
sac777
  • 1
  • 1
-1
votes
1 answer

getting values from javascript to apex code

I need to get a value from a javascript variable into a text field in a visualforce page. I got it using a command button.But I was wondering if there is any other way of getting it,cz i dun want an onclick event. Thanks in advance
devika
  • 3
  • 1
  • 3