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.

0
votes
1answer
431 views

What are the possible ways to get record id from the current page if constructor fails to get record id?

If the constructor failed to get the current page record id for an existing record using apexpages.currentpage().getparameters().get('id') ?
-2
votes
1answer
25 views

System.QueryException: unexpected token: nullnull

I am doing a query from a field in custom settings. And updating the leads Here is my apex code public with sharing class textInputsConsecond implements Schedulable { public list<Lead> ...
1
vote
1answer
402 views

How do we check if an item exists in selectoption

I am trying to avoid having duplicate selectoptions which are populated in apex. There are couple of places from which the selectoptions are getting populated and there is a possibility of getting ...
1
vote
0answers
19 views

CRUD/FLS Enforcement for configuration tables like FiscalYearSettings

Is Field Level Security enforcement a requirement for querying tables like 'FiscalYearSettings' and 'Period'? or only for tables like Opportunity and Contact. Our app need to display the fiscal year ...
0
votes
0answers
8 views

Live Agent offline Support

Can we show a custom link using offline chat page.I have a requirement just to show a custom link if i open the support form. Is there a standard setting that we can achieve the requirement. In ...
0
votes
0answers
20 views

Invalid type for implements System.Schedulable Class

I have the following class which I try to schedule from the anonymous window but this gives the error: invalid type:abc_RiskSchedulerProcessor Class global class abc_RiskSchedulerProcessor ...
0
votes
1answer
16 views

Repeated invocations of Trigger Handler. Logs not helpful

I have a method in a trigger handler that's being called in a recursive but seemingly untraceable fashion. The following log entries just repeat over and over until I reach maximum stack depth. 01:...
1
vote
2answers
398 views

Duplication prevention logic need for trigger bulk insert?

I wrote a trigger to find the duplicate and add error in the trigger.Before insert context Set<string> appnameSet = new set<string>(); for(test1__c test : trigger.new) { appnameSet.add(...
-1
votes
0answers
30 views

How Can I store Rich Text Area field(Image) of a custom object into document object [on hold]

I have trigger to insert document record when ever account record is created and I have one custom field Image__c which is Ritch Text Area data type, I am storing images in Image__C field, How can get ...
0
votes
1answer
403 views

How to hide nooverride=1 from user

I have override the case detail page with custom VF page in my org. Now for some users i want the overridden page and for some users i want the standard detail page. So i am redirecting in controller ...
0
votes
0answers
15 views

how to upload attcahment from visualforce page to document object? [on hold]

Here i have an contract standard object and document standard object and created a record in contract object and attached a file (doc or pdf) in note & attachment list. create a custom button(move)...
-2
votes
1answer
362 views

Assign Value to record from button click

I have two buttons: <apex:form > <apex:commandButton styleclass="btn-lg btn-data" value="Vote Up" action="saveUP"/> <apex:commandButton styleclass="btn-lg btn-data" value="Vote ...
1
vote
2answers
423 views

Visualforce Search Page - Dependent Picklists

I'm working on building a custom search visualforce page and I've run into a problem. I have added 2 picklists (one controlling and one dependent) as filtering fields. However, when I go to the VF ...
-1
votes
0answers
39 views

Getting Weird error in VF Page

On click of a custom lookup, i am trying the below error. Error: Pg:idForm:idPgBlk:idRoleSec:j_id150:0:check1: An error occurred when processing your submitted information. I have no clue with this ...
1
vote
1answer
397 views

Exporting CSV using Reports.NotificationActions

I am trying to include a custom action on future run reports to automatically export the csv content with the report scheduled. I have had success with sending the email in this way, but am ...
0
votes
1answer
17 views

How to get callback result — lightning component

apex public class Edit_Controller { @AuraEnabled public static List<OpportunityLineItem> ItemList {get; set;} @AuraEnabled public static List<PriceBookEntry> Oppline(List<String> ...
1
vote
1answer
415 views

Creating records and saving through custom page and controller

I have a custom object account plan which is related to Account object via lookup relationship. i want to create account plan records and save them to db. Account plan records can be created by ...
1
vote
1answer
435 views

Need to access the Period for a custom fiscal year, when PeriodLabel is null when SOQLing on the Period object

We have a Salesforce org where they are using a custom fiscal year. The following results in a correct week number, but a null PeriodLabel: select Id, Number, PeriodLabel from Period When going ...
0
votes
0answers
9 views

How to access the Schedule ID for each instalment of a LineItemSchedule

I have Products that have schedules with just one revenue amount (and date) and there are some that have two installments. When exporting this LineItemSchedule object, I can only see the second ...
0
votes
0answers
14 views

Insufficient access rights on cross-reference id in a managed package procedure

I have added a changing Opportunity owner logic inside Opportunity before triggers. And this is causing issue in a managed package procedure when I amend a contract in Salesforce cpq package. The ...
0
votes
0answers
29 views

Test Class for Dynamic SOQL [duplicate]

Pretty new with salesforce dev. So forgive me. I am doing a SOQL query and then updating records. The trick here is . I am grabbing my query from two custom fields which are in the Custom Settings . ...
0
votes
0answers
19 views

Review Code - Account Merge [on hold]

Based on suggestion by @SFDCFOX to my question here, I tried to implement the logic as suggested Can someone please review my code and give me suggestions. ? I know there are fundamental flaws in ...
0
votes
0answers
56 views

Apex heap size too large: 12289287

I have three objects Contact, Item and Prefarance. Prefarance is the object which is child for both Contact and Item. My scenario: When the Contact field " Type" is RA, I want to upsert records into ...
4
votes
2answers
3k views

How to parse XML data to JSON? How to deserialize XML to Apex class?

I Have Xml data as Follows String Data_XML = '<?xml version="1.0" encoding=""?> <book><price>100</price><Items>2</Items> </book>'; I wanted to deserialize ...
3
votes
2answers
205 views

Illegal Integer but only after threshold

We are deploying a tiered schedule for pricing related to products based on a firms assets under management. The tiers have breakpoints based on these aum fields (currency). In apex I have a method ...
0
votes
1answer
34 views

SOQL to return COUNT value via Apex

I am trying to return the SOQL listed values into a field using an Apex Trigger:- Object: Name = RPA__c Fields: Business_Area__c (picklist) VALUES = Finland Managed Services, UK Managed Services ...
0
votes
1answer
427 views

Issues with saving custom attachment object file due to coding

I have created a custom object with button for customized attachment related list on the Contact object. However, when I go to create the actual record and upload the file, the Contact name does not ...
2
votes
0answers
30 views

Field is not writable on custom Big Object in APEX

I'm trying to read a set of records from a custom Big Object, update a long text field (not part of the object index), and then upsert back. When trying to update the value of the field I get 'Field ...
-2
votes
0answers
11 views

Insert records related to a common object related to two objects in Lookup relation [duplicate]

I have three Objects Contact, Item and Preferance. Prefarance is the common object which has lookup relation with Item and Contact. Type is field on Contact. I am writing a query on Item based on ...
1
vote
2answers
18 views

Batch Apex… which Object is iterable?

I'm dealing with the CampaignMember standard object, and a custom object called Binding__c. I need to create a new Binding__c record for each CampaignMember record, and there might be 25K of those -- ...
0
votes
0answers
10 views

Add Specific Attachments to Docusign envelope

I have Docusign for Salesforce set up with a Lightning Component custom button the generates the URL reqd to select the correct template, fill in various merge fields and redirect to Docusign. What i ...
0
votes
1answer
402 views

Unable to get Last Login Date/Time of user on Contact Object

I am trying to populate the User's Last Login time on contact so I had created a Date/Time field Last_Login_Time__c. I had read multiple articles that it is not possible through formula field/Process ...
3
votes
1answer
3k views

How can I create a new Account any time an “orphaned” Contact is created?

I am trying to create a new Account any time a new Contact is created (where the Contact does not have an Account assigned to it) and assign the Contact to the Account via the standard Contact->...
2
votes
3answers
2k views

SOQL - Check if record exists without throwing null error

I am trying to check and see if a user has a record in another object. I am pretty sure that the way I have it coded right now will throw a null pointer exception if no record is found. How do I do ...
0
votes
1answer
22 views

Date is Subtracting 1 day after converting to other format

For some reasons, the Date is subtracting one day whenever it is converted to other formats, I don't have any idea why this is happening. I am using .addDays(1) to temporarily solve the issue, but I ...
0
votes
0answers
18 views

Setting Picklist values dependency using metadata api

I have created two picklist values using metadata api and able to insert the values in the both the picklists, but I have to set the dependency between them, like one is controlling and other would be ...
0
votes
0answers
16 views

Automating New Starters [on hold]

fun one here for you. We're trying to automate our "new starters" which is essentially a new user, the whole idea behind this is to create a page layout as exact to the new starter form that our HR ...
0
votes
1answer
2k views

How to create a new record from a CSV file attachment processed by the email service in salesforce

My requirement is that I need to create new records / update existing records based on the data from an email attachment consisting of .csv file format that is parsed to the Email Service that I've ...
2
votes
1answer
16 views

Does For update lock subquery records?

I tried searching a little bit but haven't found the answer yet. Suppose I am having a query: Select Id, Name, (Select Id, Name From OpportunityContactRoles) From Opportunity For Update Will the ...
1
vote
1answer
400 views

Get custom multiselect checkbox values in apex

How can I fetch the check-boxes that are selected on my Visualforce Page page if these check-boxes were created dynamically using JavaScript without any apextags? <apex:form> <table ...
0
votes
2answers
405 views

how to get alignment properly in vf page?

how to get selected field value(screenshot) display properly?like field,value same row.
0
votes
1answer
21 views

MIXED_DML error only on UpsertResult has errors

In a @Future method (because of other MIXED_DML problems) we are upserting users and collecting the results. We then want to send an email once the transaction is complete. If everything works well, ...
0
votes
1answer
123 views

test class coverage for return statement

How do i cover code coverage for a return statement.I am not using pagereference. if(atleastoneselected==false){ errMsg='No contacts Selected';//not covered return page....
0
votes
0answers
7 views

How to bind two lenses in a Wave Dashboard

I have a dashboard which shows orders and order line items of selected users. I have a lens which has orders ranked. Like 1st order as 1, 2nd order as rank 2, so on and so forth. It is filtered to ...
0
votes
0answers
22 views

Sending Data from Controller to Javascript Function

I have a form that I wrote in VF page and use to send data to another place outside SF. When a user has filled the form - I want to store the data in SF and only then send the data. Because I need ...
0
votes
1answer
412 views

Trigger on child object to update parent object field

I need to update a field on Opportunity. Opportunity is related to OpportunityProduct. I've a workflow on OpportunityProduct where Evaluation Criteria is set as Evaluate the rule when a record is ...
1
vote
2answers
415 views

Salesforce record and attachement export to ftp folder

I want to export record(Contact) with image(attachment ) into ftp folder. The export format for record are excel, xml and txt. Image in the form of jpeg. Each record should have separate file. For ...
0
votes
0answers
5 views
0
votes
1answer
435 views

Criteria-Based Sharing Rules Limited To 50 [Per Object]

For those familiar with the subject, how would you go about circumventing the limit of 50 criteria-based Sharing rules? Is there an Apex-based solution for critera-based Sharing? Is there some OTHER ...
0
votes
1answer
410 views

field integrity exception: RowCause (Specified value is reserved and cannot be used)

I have a OWD Case is Private and its child Object (Payment also Private). I have Lookup relationship with Case and Payment object.. When Case is created its owner will changed as per the Case ...