• devin cafe
  • -18 Points
  • Member since 2019

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 38

How can I solve this scenario:-

Create an Object called Product, Subscriber, Product Bundle, Product To Product Bundle Junction
Fields on Product & Product Bundle
Lookup To Opportunity
Lookup To Subscriber

Fields on Product To Product Bundle Junction
Lookup to Product
Lookup to Product Bundle

Field on Subscriber
Lookup to Opportunity

Create a trigger on Subscriber to add Products based on Products or Products Bundles associated on Opportunity.



Hi there,

Alert showing in Security Alert are difference depend on orgs (production, sandbox, developer edition). Why?

Thanks & Regards,

i have an lightning component which holds an VF-Page as iframe. I want to read a specific field in this iframe.

it is simple HTML Textfield:
<input id="textfield" type="text" name="testtext" value="test"/>

is that possible?

In the component controller i tried simply:
var iframe = component.find("vfframe");
    console.log("IFRAME", iframe.getElement("textfield"));
but it is not working.

any ideas?


We have a custom reset password functionality for our portal users and we need to add 2FA (mobile verification code) authentication method while resetting this password.

How we can achieve this?
Hi all.

We are using an email input component on a screen flow. The email component has some validation but in order to avoid errors we want to add an additional rule.

Today one of our partners was able to post their email as "email@gmail". The validation didn't catch this invalid email. I tried using the component and it catches "email@gmail." or "email@".

How can I add a regular expression or other form of validation to catch an invalid email like "email@gmail"?

Thanks in advance.

Hi everyone,

I'm doing a rest call to retrieve attachments out of Salesforce. The first call would get the information of the attachment which has the URL to the body of the attachment. From there, I take the URL of the body and do another call to retrieve the contents of the attachment.

The calls are successful, however, when getting a response back, the response.getBody() return a string that does not translate to anything. When saving to a file or reuploading or encoding it, it always ends up to be gibberish or a broken file.


My questions are:

 what kind of content does the GET method return for the URL: https://SOME_ORG.salesforce.com/services/data/v20.0/sobjects/Attachment/SOME_ID/body

Am I missing anything to get the correct format? The headers that are being included in the final call for my attachment body are Content-Type, Authoriatization, and Accept


I also forgot to mention that postman is able to retrieve and display the content just fine. The issue is that the rest call returns a binary string and I am unable to translate it back to the actual content itself.

for(Apttus_Billing__Invoice__c invoice:invoiceObjectList1) // loop over invoices
                  List<InvoiceLineItems> listToStoreLineItems = new List<InvoiceLineItems>();
                  APTS_InvoiceJournalWrapper invoiceJournWrapper= new APTS_InvoiceJournalWrapper();
                  Decimal Sum=0;
                                    invoiceJournWrapper.AccountingJournalID=String.valueOf(invoice.Name + '_' +myDate);
                                    invoiceJournWrapper.JournalNumber=String.valueOf(invoice.Name + '_' +myDate);
                  list<Apttus_Billing__InvoiceLineItem__c> invlineitems=[Select id,Apttus_Billing__AssetLineItemId__r.Apttus_Config2__ProductId__r.ProductCode,Apttus_Billing__AssetLineItemId__r.Apttus_Config2__OptionId__r.ProductCode,Apttus_Billing__InvoiceId__r.Name,Apttus_Billing__ProductId__r.Name,Apttus_Billing__InvoiceId__r.CurrencyIsoCode,
                                                             from Apttus_Billing__InvoiceLineItem__c where Apttus_Billing__InvoiceId__c=:invoice.id and Apttus_Billing__Type__c='Contracted' and Apttus_Billing__Amount__c!=0];
                   InvoiceLineItems FirstInvItems= new InvoiceLineItems();

I have a requirement to sent Email alert to all account in account hierarchy when the child account do something.

I want to send alert to all level(to Parent,Grand parent...)

how to set the recipient in Email alert by configuration?

Is their is any difference between one to many or many to one relationship and what is the difference between owner and created by??
I am starting with Reports and Dashboards superbadge, and to solve this I created a new playground as recommended. It created a new playground but when I click launch I am not able to see the default page but it takes me to login page. Now I am not aware of the username and password to login to this new TP as it did not ask me one and created by itself. I also tried using the username from manage my hands-on-org option in the dropdown and tried to forgot password but it cannot recognize the username at all. Also, I tried to clear browser cache and even that did not help. Please help whether I am missing anything else for this. 

User-added imageUser-added imageUser-added imageUser-added image
I have a need for a feild in an object which accepts only unique values for each record created or updated. So, i want to achieve this using process builder to trigger when ever a new record is created and flow to check if that unique field is not having the value which has been entered. Can anyone help me with this ?
Just getting started here, crash course in Packaging for a new org we are building.

Created a scratch org, made some basic changes:
  • 5 x Account Record Types
  • 6 x Custom Text/Number Fields
  • Amended a Layout
  • Gave Sys Admin Profile field permissions.
Pulled the changes into my VS and Repository.

Now want to create a package and configured package.xml as:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

Get the following error :

Account.Client: Picklist value: Advertisement in picklist: AccountSource not found

Lots of reading and links and changes and variations but still can't get it working.  Do I have the order wrong?  Do I need to do something else first?  Everything i have read suggests it is the right approach.
  • January 03, 2020
  • Like
  • 0
Can anyone tell why getting this error.Here is my code
public class insertclass 
   public static void insertMethod(string LastNameOfAccount)
       List<Account> acclist = New List<Account>();      
           account acc = new account();
           acc.name = LastNameOfAccount;
         insert acclist;
       List<Account> acc1 = New List<Account>();
       acc1 = [SELECT Name,Id From Account Where name =:LastNameOfAccount];
       Id accountId;
       for (Account acc23: acc1)     
           accountId = acc23.Id ;
         List<Contact> conlist = New List<Contact>();
         for(integer i = 0; i<2; i++)
            Contact con = new contact();
            con.Firstname = 'Test'+ string.valueOf(i);
            con.Lastname = 'Ramesh';
            con.accountId =  accountId ;
         insert conlist;
                    List<opportunity> opplist = New List<opportunity>();
error line >        for(integer i = 0; i<2; i++)
            opportunity opp = new opportunity();
            opp.Firstname = 'Test'+ string.valueOf(i);
            opp.Lastname = 'Ramesh';
            opp.accountId =  accountId ;
         insert opplist;
Thanks is advance.
Hi  All,
When we are executing batch apex, few records are not inserted to the database due to some invalid data (let say 10 out of 100000 records are failed) how to process those 10 records. 

Thank you,
Hi All

Im doing Aura Components Specialist Superbadge. Im not able to see the boat in my page. Im new to aura components.

Please look at the code and suggest me.

<aura:component controller="BoatSearchResults" Implements="flexipage:availableForAllPageTypes">
    <aura:attribute name="boats" type="Boat__c[]"/> 
    <aura:method name="search" action="{!c.search}">
        <aura:attribute name="boatTypeId" type="String"/>
    <aura:attribute name="boatTypeId" type="String"/>
    <div class='slds-m-around_medium'>
        <lightning:layout horizontalAlign="center" verticalAlign="center" multipleRows='true'>

            <aura:if isTrue="{!v.boats.length > 0}">
                <aura:iteration items="{!v.boats}" var="bot">
                    <lightning:layoutItem flexibility="grow" class="slds-m-around_small">
                        <c:BoatTile boat="{!bot}" />
                <aura:set attribute="else">
                    <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto" padding="around-small">
                        <ui:outputText value="No boats found" />
    search: function(component, event, helper){ 
        var params = event.getParam('arguments'); 
        var arg = component.get('c.doSearch');
    doSearch : function (component, event, helper){ 
    onSearch : function(component, event) {
        var boatTypId = component.get("v.boatTypeId");
        var action = component.get("c.getBoats");

        action.setCallback(this, function(response){
            var state = response.getState();
            if(state === "SUCCESS"){
                var res = response.getReturnValue();
                component.set("v.boats", res);
                console.log("Failed with state: " + state);   


Thanks in advance
Sameena S
I currently have apex class in lightning component that is getting a specific Queue Id to assign as owner of the record the component is launched from.

This is the current  way I'm getting the id, but I'm guessing there is a better way to do this, any ideas?
Group marketingQueue = [SELECT id,Name FROM Group WHERE Type = 'Queue' and DeveloperNAME = 'MarketingProspectLeads'];
         	ID marketingQueueId = marketingQueue.id;
            //l.OwnerId = UserInfo.getUserId();
            l.OwnerId = marketingQueueId;

I just need to make sure this can't break so I'm assuming I should add some error checking or be doing this a different way.  Thanks in advance.  
Building my first Lightning component to go on a record details page in Communities.

I have to calculate 3 values. 2 are calculated in the doInit function in the controller with callback functions. The third is the sum of the first two.

I tried writing another function to calculate the 3rd value, calling that function in the callback response but I get an error that the function is not defined. 
Please see controller code provided
	doInit : function(component, event, helper) {
        // define recordid
        var recordId = component.get("v.recordId"); 

        // Create actions
        var action1 = component.get("c.getShipmentCost");
        action1.setParams({ wamshipment : recordId });
        var action2 = component.get("c.getFulfillmentCost")
        action2.setParams({ wamshipment : recordId });
        // Add callback behavior
        action1.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.shipmentcost", response.getReturnValue());
            } else {
                console.log("Failed with state: " + state);
        action2.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.fulfillmentCost", response.getReturnValue());
                // Call function to calculate third variable
            } else {
                console.log("Failed with state: " + state);
        // Send actions to be executed
    calculateTotal: function(component, event, helper) {
    	var scost = component.get("v.shipmentcost");
        var fcost = component.get("v.fulfillmentcost");
        var total = fcost + scost;
        component.set("v.totalcost", total);
(I wouldn't be opposed to moving the functions in the init function to the helper, I just want to get this to work first).
Any help is greatly appreciated!


i am a newbie to salesforce and trying to complete this trailhead challenge and unable to find a way through apex to generate this method for creating new contacts with unique id. as one requirement to pass the challenge is "The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names."

If somebody successfully completed the task kindly help me.