Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [apex]

Questions relating to Apex, the native programming language for the Force.com platform. Use it for general questions on syntax, errors, constructs, and rules of use. Most questions should include a code *excerpt* to help answerers understand specifically what has gone wrong or why you need help.

1
vote
1answer
74 views

Enable Partner User Not available on Contacts

I cannot see Enable Partner User option on Contact detail page under Manager External User Button. There are Partner Community Licenses available but still I cannot see enable partner user option ...
0
votes
2answers
40 views

Validation Rule to check PRIORVALUE

I am writing one validation rule where status is Pending/In Progress and I am changing any value from record then I need to throw an error 'you cannot edit the record'. AND(OR( ISPICKVAL( Status , '...
0
votes
0answers
19 views

I want to update account field as same field is available in opportunity custom object

Requirement is -: I want to update custom account assigned csd field everytime i create new opportunity. it suppose to update field with new csd along with available assigned csd but it is overriding ...
1
vote
2answers
26 views

how to make phone field unique

i want to make phone field unique for this i have tried triggers but i want to write validation rule for this i have written something like AND( CONTAINS( VLOOKUP( $ObjectType....
0
votes
0answers
24 views

Store data in Session.Cache every time a user logs in

I'm trying to store some user data in the Session.Cache every time a user logs in. This is the code: public static String orgPartitionNamespace = 'local.Cache'; public static boolean isEnabled = ...
0
votes
1answer
26 views

Salesforce CPQ: Product Setup scenario

I'm trying to setup the below product set up in salesforce CPQ. Product: BAG Now, I need to set up the price of this particular BAG product based on the Colour in the line editor. For Ex: If the ...
0
votes
1answer
35 views

Does anybody notice that the object permissions is not applied on public site guest profile?

I built VisualForce page with form to Insert and update account records, it works like a charm, but when I checked account object permission for guest profile, I found there's no read nor create ...
0
votes
0answers
19 views

Salesforce CPQ: Sum up the options price in bundle product(main product)

I've been trying different models in salesforce cpq. Am trying to achieve the usecase I have in salesforce CPQ. I want to sum up all the options price and show in the main product while adding into ...
-3
votes
1answer
21 views

Set contains (Filed name from Map<String, Schema.SObjectField> fieldMap ) not working

I have a below code to check the filed name inside the set to filed name inside the map. Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.Test__JobApp__c.fields.getMap(); set&...
0
votes
0answers
18 views

Nullpointer exception for the second time in Actionfuntion Visualforce page

Whenever i click on lookup first time i am getting the contact id, But when i click on the same lookup and select any other contact then its throwing error. Please need some help <apex:...
-1
votes
1answer
30 views

Write a program to display a Position and all its related Job Applications [closed]

public class positionwithjob { public static void posjob{ list<position__C> pos=[select name,(select name from job_applications__r) from position__c]; for(position__c p:pos) ...
0
votes
1answer
9 views

update Activity Score on Contact and Account

I want to calculate Activity Score on Contact and Account should be updated based on following formula. Contact/Account Activity Score = Count of Meetings * 3 + Count of calls * 2 + Count of Emails *...
0
votes
1answer
17 views

Apex Code for Account Owner update based on Region of the user

Account Owner Lookup field needs to be updated based on the Region field of the user. Admin Will run the anonymous apex, If the users region and Account's Field Dealer Code Values match the Account ...
0
votes
2answers
80 views

Many Lookup Relationship for One Object

I have the case of an object having two lookup relationship and I call for a list containing both relationship as follows. This is my Setup code public static List<Job_Application__c> ...
0
votes
2answers
33 views

Execution order of Trigger, Workflow and Process

I have a question regarding the execution order of Trigger, Workflow and Process. I know there are plenty of resource there but none of them match my case. Right now our project have bunch of trigger ...
1
vote
3answers
34 views

List index out of bounds and remove list item?

I have a csv file with data in each row that gets upserted into both the standard "Contact" object and a custom object called "Certification" by looping over the rows in the csv file. As part of the ...
0
votes
1answer
27 views

Prevent certain profiles from approving accounts

I have a requirement to prevent certain user profiles from approving accounts. Wrote below trigger which is partially working. However getting below error when a user in Standard User profile tries to ...
-1
votes
1answer
25 views

need to write trigger on activity (Task and event)

I have following requirement, Update Activity “Type” field with following: Type = Call, if Subject starts with "Call" case-insensitive. Type = Email, if Subject starts with "Email" case-insensitive. ...
1
vote
1answer
38 views

Getter Block execution without VF reference

My understanding of the Getter Setter is that getter is invoked if the particular variable is being referenced in VF Page. However for the following code I see that Getter is getting called even if ...
0
votes
1answer
16 views

Assign a record as a look up object before insertion

I am attempting to write an api endpoint meant to upload many objects of one type. This object, MyObject, contains a lookup field that looks up another MyObject record for translation reasons. ...
0
votes
1answer
41 views

Batch class to create a CSV file

first of all, thank you for your cooperation, right now I'm having problems changing my class to a batch class, the class that I will post below works, it creates a CSV file on "SageExtractFiles__c" ...
2
votes
1answer
58 views

Can't update record in test method

I'm trying to make a test class for an Apex class that runs a report and add functionality for it (send some emails and stuff). The problem is that I need to add records (contacts) for that report to ...
-1
votes
0answers
15 views

Want To download the conga template and send email at the same time?

In my visualforce page there is a button"generate pdf & send email" after clicking on the button template should be download and at the same time email should be sent, here template is downloading ...
0
votes
1answer
20 views

Could not resolve field 'Name' from <apex:inputField> value binding '{!cs.Name}' in page ProductCaseExternal

Trying to build a webpage for teams to be able to submit cases and attachments. For some reason I am getting a "Could not resolve field 'Name' from value binding '{!cs.Name}' in page ...
0
votes
1answer
28 views

PageReference with Spinner

I have two-page references, on the first page I am performing a DML operation which takes time around 1,2 seconds, and then it goes to the next page. What I want is a loading symbol for those 2 ...
0
votes
1answer
12 views

getting recursion for Salesforce 2 Salesforce Integration using REST API in Case object

I am doing salesforce to salesforce integration between two orgs using REST API. I created REST API classes in two different org that update/insert/delete records. Insert and Delete works fine. But in ...
-1
votes
2answers
40 views

Call a trigger in anonymous window

I have a requirement like if the candidate is also a lead, then in leads i have to insert a flag field. this i have done for the records which were newly inserted. now for the existing records i have ...
0
votes
1answer
27 views

Apex Unit Testing List<Case>

I have a method public static List<Case> findCase (Id recordId) that returns List<Case> details. I wrote the following Test and it passed. List<Case> details = ...
1
vote
1answer
26 views

Is there any way to get the first and last business day of the month using Apex code or a formula field? [closed]

For example, if the first of the month is a Saturday, then I'd like to know the 3rd is the first business day of the month. Likewise for the last day of the month.
2
votes
0answers
19 views

Implementing CPQ Electronic Signature Plugin

We are currently using the old CPQ Docusign plugin that was created by Steelbrick. Last year Docusign released a new plugin. Problem is they didn't make it behave the same way as the old plugin and we ...
0
votes
0answers
9 views

Opening the subTab with the field update by the Apex method via visualforce page

I have a list of records displayed (in my case a list of surveys). I want when the user clicks on the link (it can be a button) the system opens the survey record as subTab with the simultaneous ...
0
votes
2answers
19 views

Delete button is disabled due to time out issue

I have a page where websites are built by the users. When an user tries to delete the site from the page, the page is throwing error stating there is some issue and the delete button is disabled ...
0
votes
1answer
36 views

Pagination next button not working Using Visualforce Page

Pagination is not working while clicking on next button Apex Code: /* Date:21/01/2019 Auther:SudhanshuDescription:Account Search input box * / public class AccountEmailAlert { public Integer ...
0
votes
1answer
27 views

Unknown property when using html-data-id attribute in apex:dataTable

I am getting a unknown property error, when using the var from data table in a html-data-id attribute, it is working in apex attributes perfect. I can't figure out how to make it work for html-data-id ...
0
votes
2answers
20 views

TestMethod do not support Web service callouts

I want to invoke a Process from the record base Process using invocable apex which invokes Process by making an HTTP request to the Rest API. But when I try that it's causing many of our existing ...
0
votes
1answer
31 views

Visualforce Error - The dependent picklist requires its controlling field on the page

We've got a custom object called Cost__c. We've got a custom VFP for this. I want to add a dependencies between two fields, Product_Type__c and Total_Number_of_Pages__c. Both fields are on the VFP (...
0
votes
2answers
49 views

Salesforce DX Project Structure Clarification

I am having trouble understanding the capabilities of a scratch org. I am in need of someone to take a look and see if it is set up incorrectly or if I am understanding it's capabilities wrong. My ...
0
votes
0answers
14 views

Class.cache.PlatformCacheDelegateWrapper.getSessionPartitionDelegate

Current org uses Sage Financials package. There is a batch class, which inserts a list of SageTransactions in chunks, but sometimes, the following error is got: s2cor.Sage_INV_Trade_Doc_Trigger: ...
0
votes
0answers
17 views

Approval process email from mobile / ipad

: I am using the standard approval process process email . When the manager gets the email for approval and he is clicking on the link of approval process, in ipad then it redirects to safari instead ...
-1
votes
1answer
38 views

Fields can see in workbench but when i query it says no such column on entity

I can see the Mediumphotourl field for the user object in the workbench but when i try to query it i am getting an error No Such column 'MediumPhotoUrl' on entity 'USER'
4
votes
0answers
43 views

How to create custom rules for PMD Apex static code analyzer?

How can I create custom rules for PMD? For example, if I want to create a rule to say 'all code should be in allman style and therefore, any line with { should be the only character on the line', how ...
0
votes
1answer
21 views

Trigger to Update a Parent Record based on a value in a child record

I need to update the Order record when it's status changes to Activated. I want to set the custom field, invoice_Due_date__c based on a related record's value. The related record is child record in ...
0
votes
2answers
30 views

Salesforce server IP which is making callout

I have a batch process which makes a HTTP call out to third party, but because of IP restriction third party is denaying the request. Is there any way to get Salesforce server Client IP from where ...
0
votes
1answer
25 views

How to add 'LIMIT :' to String in Database.query?

I have Database.query that sorts records by a few filters (or any filter). I want to set the limit for it. How should a write it? return Database.query('SELECT Id, Name FROM Stereo_System__c' + ...
1
vote
1answer
25 views

Get Values in Already Created Picklist

im trying to retrieve the values in a picklist (using code) that was created without code. i want to be able to assign the already created values to a custom object's field in apex. any idea how to ...
0
votes
1answer
33 views

How to Re Render an outputPanel on a button click?

So basically I'm making a visualforce page and there is a section that needs to be re rendered on a button click. From what I've read on the internet I can use outputpanel to achieve this. What I need ...
1
vote
1answer
27 views

Email to Case (Using thread Id)

I am working on email to case. My requirement is whenever a user is sending mail from outside to salesforce generated email address, case should be created and reply back to user with case id in ...
0
votes
2answers
43 views

how to call javascript function from action function?

found error after clicking button'Genrate invoice' Error:: Uncaught SyntaxError: Unexpected token ** how to resolve this?? visual force page:: <apex:page standardController="Payment__c" ...
0
votes
0answers
17 views

Steelbrick CPQ: Editing/ Inserting new quotelines post quote creation via amender api

As far as I can see from steelbrick API(s) here I see that the API provides a way to read quote/ quote line items. https://developer.salesforce.com/docs/atlas.en-us.cpq_dev_api.meta/cpq_dev_api/...
0
votes
1answer
30 views

SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: []

I am getting this error message: Message: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: [] Stack Trace: Class.MessagingHelper.send: ...