• Jake Backues
  • NEWBIE
  • 40 Points
  • Member since 2015
  • Independant Contractor, Architect
  • Jebenuity, LLC


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 24
    Replies
Hi Everyone,

Can someone please tell me when cloning an 'Opportunity with Products' should the 'OpportunityLineItem before update or insert Trigger' get executed?
It appears that the OpportunityLineItem trigger is NOT firing when I clone a 'Opportunity with Products'. I can tell because the SalesPrice is not being calculated correctly which should occur when the Trigger executes and calls the apex class that does the calculation. Thanks.
My org has decided to use arrays over lists to reduce our overall code. We have a large amount of it. I have a SOSL query that returns and array of an array of SObjects. How can i use arrays instead of lists for the return value?

I get errors when doing this
SObject[][] searchList = [
            FIND :query IN ALL FIELDS RETURNING 
            Opportunity(Id, Name WHERE RecordType.Name In :recordTypeNames, 
            Service__c(Id, Name WHERE RecordType.Name In :recordTypeNames AND Status__c IN :serviceStatuses)
        ];

 
In my helper js class, what is the difference between calling methods using the passed in helper from my parameters or calling a method using this? Is one better than the other? does one kick off a new asynchronous process and one stays synchronous with the current process?
 
({ 
    doInit : function (component, event, helper) {
        helper.getContacts(component, event);
        this.getContacts(component, event);
    },
    
    getContacts: function(component, event) {

    }
})

 
So I just made my new TP, found the settings to rename it. clicked on the Launch your hands-on org after making sure it was the default hands on org and I get an error:
This site can’t be reached
cunning-raccoon-380385-dev-ed.lightning.force.com’s server DNS address could not be found.

I have my normal DE org connected as well and it takes me to the login page for that org where I can log in successfully. Not sure what I'm missing?
Any help is appreciated, Thanks!
I currently have an invocable method being called by a flow. the invocable method return a List<List<String>> in order to send back a list of options, in this case paper types, in a specific order. The flow gets this list returned as a Collection, but I need it to be a dynamic list of options.

Does anyone know how to convert the Collection to this or have my invocable method return this type to the Visual Workflow?
My org has decided to use arrays over lists to reduce our overall code. We have a large amount of it. I have a SOSL query that returns and array of an array of SObjects. How can i use arrays instead of lists for the return value?

I get errors when doing this
SObject[][] searchList = [
            FIND :query IN ALL FIELDS RETURNING 
            Opportunity(Id, Name WHERE RecordType.Name In :recordTypeNames, 
            Service__c(Id, Name WHERE RecordType.Name In :recordTypeNames AND Status__c IN :serviceStatuses)
        ];

 
I have created the lightning component and want to display it on VF page and render as PDF. For this, I have created a Lightning Dependency App and added it to VF page using $Lightning.createComponent(String type, Object attributes, String locator, function callback). 
I have followed steps mentioned in the following documentation: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm
But nothing is displayed in PDF.

Here is the code:
App:
​<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="c:AccountSnapshotComponent"/>
</aura:application>

VF Page:
<apex:page renderAs="pdf" standardStylesheets="false">
    <apex:includeLightning />
    <div id="lightning" />
    <script>
        $Lightning.use("c:AccountSnapshotApp", function() {
            $Lightning.createComponent("c:AccountSnapshotComponent",
                                       { label : "Press Me!" },
                                       "lightning",
                                       function(cmp) {
                                           // do some stuff
                                       });
        });
    
    </script>
</apex:page>

 Please help to display data in PDF format.
In my helper js class, what is the difference between calling methods using the passed in helper from my parameters or calling a method using this? Is one better than the other? does one kick off a new asynchronous process and one stays synchronous with the current process?
 
({ 
    doInit : function (component, event, helper) {
        helper.getContacts(component, event);
        this.getContacts(component, event);
    },
    
    getContacts: function(component, event) {

    }
})

 
So I just made my new TP, found the settings to rename it. clicked on the Launch your hands-on org after making sure it was the default hands on org and I get an error:
This site can’t be reached
cunning-raccoon-380385-dev-ed.lightning.force.com’s server DNS address could not be found.

I have my normal DE org connected as well and it takes me to the login page for that org where I can log in successfully. Not sure what I'm missing?
Any help is appreciated, Thanks!
Hi Everyone,

I have the formula field below which works great. Basically if Account_Number__c contains '-1' it will populate ShippingStreet, else, BillingStreet.
IF(  CONTAINS(Account_Number__c , "-1") , ShippingStreet , BillingStreet)

Now, I want to add default address field so a third condition. So what I'm looking for is if Account_Number__c contains '-1' populate ShippingStreet, else, Billing​Street, if Billing Street is blank populate ShippingStreet.
Running into a strange issue -- I have developed several lightning components that are displayed in Lightning App Builder. I added a second one that has all the same "implements=" as the other ones, but for some reason is not showing as an option in App Builder. Given the fact that other components are showing up - any ideas/thoughts on things to check? Here is my aura:component line:
 
<aura:component controller="SecureSiteController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">

 
I currently have an invocable method being called by a flow. the invocable method return a List<List<String>> in order to send back a list of options, in this case paper types, in a specific order. The flow gets this list returned as a Collection, but I need it to be a dynamic list of options.

Does anyone know how to convert the Collection to this or have my invocable method return this type to the Visual Workflow?
Within a flow, I'm trying to pass a collection variable as input to an Apex element.  However, when I configure the Apex element, the collection variable does not show up as a selectable value in the Source dropdown.  In fact, there is not even a section within the dropdown for Collection Variables.  Anyone know why?

Collection Variables not selectable as input

Here are some relevant details:
  • The @InvocableMethod method that's being invoked accepts a list of Strings as its parameter (even though the name of the param is 'idList').
  • In the flow, record lookups populate various variables with record Id values.  A collection variable has been declared with Data Type = Text and Input/Output Type = Input Only.  An assignment variable is used to add the values of a couple of the Id variables into the collection variable.
  • I have double-checked by searching for the collection variable by name within the Inputs dropdown, and have confirmed it is not found.
I've been referencing this article but so far can't find any explanation:  https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_designer_elements_apex.htm
@Lauren Grau - Just curious on how many badges can you get in total...Admin and Dev. 
While developing in Apex, I need to retrieve sandbox name in my code.  How do I do this in Apex?  Thanks in advance.

Hello,

 

I am wrote this really simple trigger to stop the changing of the ownership of open activities.  Whenever account owner changes in SF, it changes all of the open activitiy owners of tasks to the new owner of the account.   We don't want that to happen.  Here's my code:

 

 

trigger StopTaskOwnerChange on Task (before update) {

    List<Task> updateTask = new List<Task>();
    
        for(Task t : trigger.new){
            if(t.ownerId != t.CreatedById)
                updateTask.add(t);
        }
        
        for(Task t : updateTask){
        t.ownerId = t.CreatedById;
        }

 


I am thinking this problem with this is probably has to do with timing of the execution of the trigger.  I know salesforce automatically changes all of the activity ownership automatically, and I am wondering if I'm firing my trigger before salesforce automatically changes the Owners so it looks the owner is not changing.

 

 

 

Hi All,

I am facing this issue.

Anyone have any idea how to solve this.

public void SaveChanges()
{
List<Account> AccountList = [Select Id, Name,(Select Id From Contacts) From Account where Id=:this.AccountId];


if(AccountList.size() > 0)
{
Account UpdateAccount = AccountList[0];
UpdateAccount.Name = this.Name;
UpdateAccount.AccountNumber = this.AccountNumber;
update UpdateAccount;

if(AccountList[0].Contacts.size() > 0)
{
Contact UserContact = AccountList[0].Contacts[0];
UserContact.FirstName = this.FirstName;
UserContact.LastName = this.LastName;
UserContact.Email = this.PersonalEmailId;
update UserContact;
}
else
{
Contact UserContact = new CanGeneral__c(AccountId = AccountList[0].Id,FirstName = this.FirstName,
LastName = this.LastName, Email = this.PersonalEmailId);
insert UserContact;
}
}
}

I'm using a trigger to submit custom object records for approval as soon as they are created.  Here is the code that submits the record(s):

 

 

trigger modSubmitter on Modification__c (after Insert) { Approval.ProcessSubmitRequest[] reqs = new Approval.ProcessSubmitRequest[]{}; for(Modification__c m : Trigger.New){ if(m.Status__c!='Approved'){ Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); req1.setObjectId(m.id); reqs.add(req1); } } if(reqs.size()>0) Approval.ProcessResult[] result = Approval.process(reqs); }

 

 

 I then try inserting a record and it fails because an exception is thrown, error is "MANAGER_NOT_DEFINED".  All users involved in the process have managers defined in their user records... plus the approval process doesn't look at the manager field on any users anyhow... it just uses 'related user' lookup fields for all steps.

 

The API docs just say that this error means there is no manager for the approval process, which doesn't help much.  I scoured the Apex guides to see if there were more Approval methods available for somehow defining a "manager" for the request, but there is nothing.

 

Any ideas?

 

Cannot see the Phone icon in the Console and also softphone is not visible on the home page or any othe tab? Why
1) Installed CTI Adapter
2) Call Center Setup done and user assigned.
3) Layout of the Softphone assigned to the user.

Let me know what i am missing.

Thanks
Sanjay