New answers tagged

0

In Lightning, You can launch the record creation page with default values by providing it to URL. To pre-populate Quote name with Opportunity from related list on Opportunity record, Create a new list button on Quote and add it on Opportunity related list page layout. The custom list button url should be like below. /lightning/o/Quote/new?defaultFieldValues=...


2

Apex doesn't have pattern-based date parsing as many other languages do. So for an unsupported format, and to be sure the code will work whatever locale the user has set, you need to write a few lines of code such as this customParse method: @IsTest private class CustomParseTest { private static Date customParse(String s) { String[] dt = s.split(...


0

You have to remove the unexpected time part : String data = '20/12/2020 00:00:00'; 1.Remove the time part with substring String stringDate = data.substring(0,10); output : DEBUG | stringDate = 20/12/2020 2.Convert the string to date with Date.parse function Date dt = Date.parse(stringDate);


0

You can totally do that (really depends on your process flow), but you could also show the contact field on the opportunity and make it mandatory (trigger or otherwise). This way you will make contact as a required field, regardless of how the new opportunity is being created.


0

No, because workflows cannot trigger from a change in a datatype/formula field. As of January 2021 fields that have the data type = “formula” cannot trigger workflows, and this is a pending idea https://trailblazer.salesforce.com/ideaView?id=08730000000BrIGAA0 Possible workaround: You could however base your workflow on a non-formula field, and you could ...


0

If you're really bound to use only Process Builder, you would need to add a field to the Opportunity object, such as Created_Qualification_Task__c (checkbox). Your Process Builder can then perform a record update to set that box to True when you create the task, and alter your entry criteria to check the value of the checkbox before you create any records. ...


0

We can't give you specific code, as you've not asked a specific question. In the most general sense, you will: Make the Callout Use HttpRequest, Http, and HttpResponse to build, send, and receive a response from the external service. Parse the Data You will then use the JSON class to parse your response, typically via deserialize or deserializeUntyped, ...


2

This is a common problem when trying to write to a field where the relationship is not reparentable. Apex marks the field as read-only to prevent DML errors. To overcome this problem, use the sObject constructor with field initialization list instead of assigning individual fields. OpportunityShare oppShare = new OpportunityShare(OpportunityId = oppId, ...


2

Looks like the instructor failed to explain the data model behind Opportunity share and straight went to show the code. OpportunityShare is a special object in Salesforce which is a junction object between Opportunity and User. You cannot insert entries into this object if the opportunity records are already shared with the users. This is possible by ...


4

OppObj.StageName = 'Quoted' && OppObj.Contact__r.Status__c = 'Sales Qualified') Comparisons for equality use ==. = is an assignment. You have more problems here, though. if(TODAY() - DATEVALUE(OppObj.CreatedDate) <= 365 && You cannot use formula functions like TODAY() and DATEVALUE() in Apex code. Look at the Date and ...


Top 50 recent answers are included