• Andy on Cloud
  • NEWBIE
  • 60 Points
  • Member since 2016
  • Salesforce Architect
  • NTT Data


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 19
    Replies
I need to fetch the list of parent records which are not having child records associated to parent
Parent Object : Building__c
Child Object : InstallationInstallation_Address__c

I have tried the query in workbench : Select Id,Name  from Building__c WHERE Id NOT IN (Select Building__r.Id from Installation_Address__c) 
But i couldn't able to execute the query due to below error,

MALFORMED_QUERY: 
Building__c WHERE Id NOT IN (Select Building__r.Id from Installation_Address__c)
^
ERROR at Row:1:Column:90
The inner select field 'Building__r.Id' cannot have more than one level of relationships

Can you please help to fix above query.
Thanks in advance.

//Rahul
I need to do a HTTP POST where I set parameters in the headers. This will be triggered via custom button, but it cannot be a Javascript button. I cannot use PageReference for a redirect since it would b e a seperate operation from the POST. How can I get the POST operation to open/redirect to an external website as part of the POST operation?

I've reviewed existing documentation and also other forum posts, but none of them address my specific scenario.

I've got my Apex code written that is executed when the custom button loads a Visualforce page that passes data to the Apex code. I am just unable to get it to direct the user as part of the POST operation.
Dear Employer,

I have over 11 years of SFDC experience and 6+ years fully remote multi-projects experience.  I have worked as consultant, architect, tech lead, BSA and developer for SMB and enterprise.  For my full profile, please refer to my LinkedIn Profile in my signature below.

In SMB, I have worked in marketing, non-profit, education, health, and retail.  I specialized in customizing SFDC with minimum code and rapid prototyping following Hybrid Agile process.  My objective is to help fast growing companies to use minimum resources to get maximum return in shortest period of time.

I am currently looking for fully remote part-time C2C contract developer position. I am available from 10 - 25 hours a week. I am flexible on time zone, work hours, and hourly rate. I look forward to discuss possible exciting work opportunities with you. Please email me at andy.leung@quickfixters.com.

Regards,
Andy Leung
LinkedIn: https://www.linkedin.com/in/andy-leung-4230334/
SFDC Certified Platform App Builder
SFDC Certified Platform Dev I
SFDC Certified Platform Dev II
SFDC Certified Development Lifecycle and Deployment Designer
SFDC Certified Integration Architecture Designer
Professional Scrum Master PSM I
Hi,
I have over 11 years of SFDC experience in different sizes of business in various industries including Financial, Non-Profit, Retail, Telecommunications, Marketing, etc.  For my full profile, please refer to my LinkedIn profile.
I have been working on Sales and Service Console.  Outside of Ailge and Waterfall development, I have been working as Sev 1 Prod Issue support as well.
As per development, I am experienced in both Waterfall and Agile.  In Agile development perspective, I am more keen on developing rapid PoC to move the iteration even faster in order to save more time on educated guess.
I specialized in integrations, responsive UI development (both Visualforce and Lightning Components), and configurations over customizations (e.g. instead of building full Visualforce page, I prefer using Custom Butotns on Standard Page Layout, Process Builder and Approval Process as Process Skeletons, and Apex as modular processor).
I am currently looking for fully remote contract developer.  I am available from 10 - 40 hours a week. I am flexible on time zone, work hours, and hourly rate.  I look forward to discuss possible exciting work opportunities with you. Please email me at andy.leung@quickfixters.com.
Regards,
Andy Leung
LinkedIn: https://www.linkedin.com/in/andy-leung-4230334/
SFDC Certified Platform App Builder
SFDC Certified Platform Dev I
SFDC Certified Development Lifecycle and Deployment Designer
SFDC Certified Integration Architecture Designer
Professional Scrum Master PSM I
 
Hi,

I have over 10 years of SFDC experience in different sizes of business in various industries including Financial, Non-Profit, Retail, Telecommunications, Marketing, etc.  For my full profile, please refer to my LinkedIn profile or email me.

I am currently looking for a remote position of 10 - 30 hours part-time direct contract SFDC developer.  I have been working on Sales and Service Console.  Outside of Ailge and Waterfall development, I have been working as Sev 1 Prod Issue support as well.

As per development, I am experienced in both Waterfall and Agile.  In Agile development perspective, I am more keen on developing rapid PoC to move the iteration even faster in order to save more time on educated guess.

I specialized in integrations, responsive UI development, and rapid development (e.g. instead of building full Visualforce page, I prefer using Custom Butotns on Standard Page Layout, Process Builder and Approval Process as Process Skeletons, and Apex as modular processor).

I am flexible on time zone and work hours.  I look forward to discuss possible exciting work opportunities with you.  Please email me at andy.leung@quickfixters.com.

Regards,

Andy Leung
1.256.281.1113
andy.leung@quickfixters.com
Toronto
I couldn't find this in Lightning documentation.  In VF, we can use Fieldsets through Schema Object to loop through all fields and render all fields inside a fieldset so we can change the fields in the fieldset order, read-only, or add/remove fields without changing code.

I cannot find such $ObjectType schema API in Lightning, do we still have access to these when we code in Lightning Expression?
Hi,

My first project with SFDC was to integrate it with mainframe (AS/400), in additions, I also integrated with first generation of color blackberry for sales users to view product inventory and customer info from both platforms in real time in retail supply chain industry.

Over years, I've worked on financial, health care, non-profit, telecommunications, and many other projects.  I specialized in enterprise integrations, Apex optimizations, and complex Visualforce.

I have about 20 hours cycles per week available from US West coast to East coast time.  Please see my LinkedIn profile here:

https://www.linkedin.com/in/andy-leung-4230334

I am still updating my LinkedIn profile but I also have updated resume available if there is an opportunity available.

Thanks,

Andy
 
We're looking for a Salesforce developer to oversee the development and administration of our Salesforce instance.
Ideally, you're an independent Salesforce contractor who can contribute about 20h/week on a long term basis, enjoy working remotely and collaborate well with distributed team.
  • Salesforce Admin and Dev certified
  • Minimum 3 years of Salesforce application development
  • Experience with integration of systems and 3rd party apps within Salesforce
  • Experience with Marketo a plus
  • Knowledge of SFDC governor limits and guidelines
  • Experience working in an Agile or SCRUM environment
  • Ability to communicate technical recommendations to non-technical stakeholders 
  • Able to work remotely within PST business hours.
Hi,

I have over 10 years of SFDC experience in different sizes of business in various industries including Financial, Non-Profit, Retail, Telecommunications, Marketing, etc.  For my full profile, please refer to my LinkedIn profile or email me.

I am currently looking for a remote position of 10 - 30 hours part-time direct contract SFDC developer.  I have been working on Sales and Service Console.  Outside of Ailge and Waterfall development, I have been working as Sev 1 Prod Issue support as well.

As per development, I am experienced in both Waterfall and Agile.  In Agile development perspective, I am more keen on developing rapid PoC to move the iteration even faster in order to save more time on educated guess.

I specialized in integrations, responsive UI development, and rapid development (e.g. instead of building full Visualforce page, I prefer using Custom Butotns on Standard Page Layout, Process Builder and Approval Process as Process Skeletons, and Apex as modular processor).

I am flexible on time zone and work hours.  I look forward to discuss possible exciting work opportunities with you.  Please email me at andy.leung@quickfixters.com.

Regards,

Andy Leung
1.256.281.1113
andy.leung@quickfixters.com
Toronto
I couldn't find this in Lightning documentation.  In VF, we can use Fieldsets through Schema Object to loop through all fields and render all fields inside a fieldset so we can change the fields in the fieldset order, read-only, or add/remove fields without changing code.

I cannot find such $ObjectType schema API in Lightning, do we still have access to these when we code in Lightning Expression?
I need to fetch the list of parent records which are not having child records associated to parent
Parent Object : Building__c
Child Object : InstallationInstallation_Address__c

I have tried the query in workbench : Select Id,Name  from Building__c WHERE Id NOT IN (Select Building__r.Id from Installation_Address__c) 
But i couldn't able to execute the query due to below error,

MALFORMED_QUERY: 
Building__c WHERE Id NOT IN (Select Building__r.Id from Installation_Address__c)
^
ERROR at Row:1:Column:90
The inner select field 'Building__r.Id' cannot have more than one level of relationships

Can you please help to fix above query.
Thanks in advance.

//Rahul
public abstract class childController extends Controller {

    public Idea conIdea { get; set; }
    public String conCategories { 
        get { 
            if (conCategories == null && conIdea != null) { 
                conCategories = conIdea.categories; 
            }
            return conCategories;
        }
        set; 
    }    

    public String getVote() {
        return Math.Round(conIdea.vote).format();
    }


    public List<String> getSplitCategories() {
        if (conCategories == null) {
            return new String[0];
        } else {
            return conCategories.split(';');
        }
    }
    
    public String getCategory() {
        if (conCategories == null) return null;
        String[] splitCategories = getSplitCategories();
        return splitCategories[splitCategories.size() - 1];
    }

}

Test Class As....


@isTest
public class IdeaChildDetailsController extends IdeaDetailsAbstractController {

    static testMethod void testGetters() {
        IdeaTestUtil.setupTest();
        childController controller  =  new childController();
        Idea idea  =  IdeaTestUtil.makeIdea();
        controller.conIdea  =  idea;
        controller.conCategories  =  'sigma';
        controller.getSplitCategories();
        String getVote;
        getVote = '10';
        Integer myInt = Integer.valueOf(getVote);
        System.assertEquals(10, myInt);
        System.assert(controller.conCategories  !=  '');
    }
    static testMethod void testSplitCategories() {
        IdeaTestUtil.setupTest();
        childController controller  =  new childController();
        Idea idea  =  IdeaTestUtil.makeIdea();
        controller.conIdea  =  idea;
        controller.conCategories  =  null;
        controller.getSplitCategories();
        controller.getCategory();
    }
}

It is not covering the "
        String[] splitCategories = getSplitCategories();
        return splitCategories[splitCategories.size() - 1];"  this portion and "getVote"
hi,
 
My name is Christian and I am a beginner in Salesforce - Sap integrations development, in my project, we have the next requirement:
  • When an account is registered in Salesforce an instant call is made to a web service developed in SAP (SOAP).
    • If the integration result is right, you should be able to insert the account into Salesforce, but if the integration result returns any errors, you should display the error on the screen, so that the user can correct any errors and try again to register the account. My application is using the standard VisualForce Page.
So I had the idea of using a trigger (before insert) but as far as I've read this it's not possible, can anyone give me some guidance on how to approach the development?
Thank you very much.

 
I need to do a HTTP POST where I set parameters in the headers. This will be triggered via custom button, but it cannot be a Javascript button. I cannot use PageReference for a redirect since it would b e a seperate operation from the POST. How can I get the POST operation to open/redirect to an external website as part of the POST operation?

I've reviewed existing documentation and also other forum posts, but none of them address my specific scenario.

I've got my Apex code written that is executed when the custom button loads a Visualforce page that passes data to the Apex code. I am just unable to get it to direct the user as part of the POST operation.
 Hi
I called the batch class in my apex class method.when I am writting test class for that batch class its not covering the execute method.Is there any solution ?

Thanks.
  • December 09, 2016
  • Like
  • 0
Hello all,

We are having a problem with a scheduled job that we scheduled to execute every day at 23.00 and at 23.15.

The first run is not fully executed for some reason, but the same job completes without errors 15 minutes later. This happens every day. If we reschedule both jobs, then they are both executed on the first day, but on the second day we have the same situation that the first one is not fully executed.

We checked the logs and they differ starting from this row:

Class.CleaningTasks.execute: line 26, column 1: [SELECT Id,Name FROM Attachment WHERE Name LIKE 'image%.png%']: executed 0 times in 0 ms

We do not understand why this SOQL Statement is not executed in the first run. There is no error thrown and it shows as completed in the job overview.

I couldn't find any examples on the web where something was "executed 0 times" in Salesforce.

In the log of the second run we can see all the limits (in the first log this part is also missing) and we are not close to hitting any limits so this should also not be the problem.

Any help would be appreciated as Salesforce Support was unfortunately not very helpful and just advised us to upgrade to Premium Support.

Thanks!
Hello,

 I am writing a code. where i am uploading a logo. Now my issue is when my image size is more than 5 mb then it shows error message seperated like this "Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 156.812KB". I want that it should throw eeror pop up message on the same window



public with sharing class DocumentController {
 public Feedback_Main__c feedbackmain{get;set;}
 public ID folderid{get;set;}
 public Blob file{get;set;}

public DocumentController() {
feedbackmain = new Feedback_Main__c();
Organization org =[select Id,InstanceName from Organization limit 1];

//List<String>AcutalBaseUrl =BaseUrl.split('.');
//system.debug('AcutalBaseUrl'+AcutalBaseUrl[0]);
 }

public PageReference Manage(){
PageReference pg = new PageReference('apex/SBAddQuestionPage');
pg.setRedirect(true);
return pg;
}

public PageReference saveAndRedirect() {
 Id OrgId = UserInfo.getOrganizationId();
 Folder FolderObj = [Select Id From Folder Where Name = 'Survey Builder' limit 1];
 Document d= new Document();

 d.name = 'LOGO';
 d.body=file; // body field in document object which holds the file.
 d.IsPublic = true;
 d.ContentType ='image/png';
 d.Type = 'png';

 d.folderid = FolderObj.Id; //folderid where the document will be stored insert d;
 if (Document.SObjectType.getDescribe().isCreateable())
 {
 try{
     insert d;
     }
    catch (DMLException e)   {    
                          // catch (System.LimitException e) {
                             ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'File Size is more than 5MB'));
                           return null;
                        }
      
 }
Organization org =[select Id,InstanceName from Organization limit 1];
//(Sandbox)feedbackmain.Image__c = '<img src="https://c.cs41.content.force.com/servlet/servlet.ImageServer?id='+d.id+'&oid='+OrgId+'"></img>';
feedbackmain.Image__c = '<img src="https://c.'+org.InstanceName+'.content.force.com/servlet/servlet.ImageServer?id='+d.id+'&oid='+OrgId+'"></img>';

 
  system.debug('++++++++++D ID+++++++++++'+feedbackmain.Image__c);
  insert feedbackmain; // This takes care of the details for you.
  PageReference redirectPage = Page.SBAddQuestionPage;
  redirectPage.setRedirect(true);
  return redirectPage;
}


}


VF Page:
<apex:page controller="DocumentController" sidebar="false" showHeader="false" standardStylesheets="true" docType="html-5.0">
<apex:form >
<apex:pageMessages ></apex:pageMessages>
<html>
<head>

<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Create Survey</title>
<apex:stylesheet value="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900"/>
<apex:stylesheet value="{!$Resource.SurveyMaster}"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"/ >
<!--<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900" rel="stylesheet" type="text/css">
<link href="assets/css/master.css" rel="stylesheet">-->

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
<!--$(document).ready(function(){
    $(".NextOne").click(function(){
        $(".NameDiv").hide();
        $(".HeaderFooterDiv").show();
        return false;
    });
});

$(document).ready(function(){
    $(".NextTwo").click(function(){
        $(".HeaderFooterDiv").hide();
        $(".ContactDiv").show();
        return false;
    });
});-->

function CheckFbName(ReceiveInputID){
    var inputValue = document.getElementById(ReceiveInputID).value;
    if(inputValue.length==0 || inputValue == ''){
        alert("Please enter Survey Name.");
        $(".NextOne").click(function(){
            $(".NameDiv").show();
            $(".HeaderFooterDiv").hide();
            $(".ContactDiv").hide();
            return false;
        });
    }
    else
        $(".NextOne").click(function(){
        $(".NameDiv").hide();
        $(".HeaderFooterDiv").show();
        $(".ContactDiv").hide();
        return false;
    });
}

function myFunction() {
    window.open("https://cs41.salesforce.com/apex/AddQuestionPage");
}


</script>
<style>
.lookupIcon {
 background-image: url('{!$Resource.LookupIcon}') !important;
 height:30px !important;
 width:30px !important;
 position:absolute !important;
 top:6px !important;
 right:-25px !important;
}

.lookupIconOn {
 background-image: url('{!$Resource.LookupIcon}') !important;
 height:30px !important;
 width:30px !important;
 position:absolute !important;
 top:6px !important;
 right:-25px !important;
}

@import url(http://fonts.googleapis.com/css?family=Nunito:300);

body { font-family: "Nunito", sans-serif; font-size: 24px; }
a    { text-decoration: none; }
p    { text-align: center; }
sup  { font-size: 36px; font-weight: 100; line-height: 55px; }

.button
{
    text-transform: none;
    letter-spacing: 0px;
    text-align: center;
    color: #0C5;
    font-size: 20px;
    font-family: "Nunito", sans-serif;
    font-weight: 300;
    position: absolute;
    top: 11px;
    right: 0;
    bottom: 0;
    left: 56.6%;
    padding: 10px 0;
    width: 236px;
    height: 43px;
    background: #00a1e1;
    border: 1px solid #00a1e1;
    color: #FFF;
    overflow: hidden;
    transition: all 0.5s;
    float: right !important;
    border-radius: 20px;
}

.button:hover, .button:active
{
  text-decoration: none;
  color: #00a1e1;/*#0C5*/
  border-color: #00a1e1;
  background: #FFF;
}

.button span
{
  display: inline-block;
  position: relative;
  padding-right: 0;
 
  transition: padding-right 0.5s;
}

.button span:after
{
  content: ' ';  
  position: absolute;
  top: 0;
  right: -18px;
  opacity: 0;
  width: 10px;
  height: 10px;
  margin-top: -10px;

  background: rgba(0, 0, 0, 0);
  border: 3px solid #FFF;
  border-top: none;
  border-right: none;

  transition: opacity 0.5s, top 0.5s, right 0.5s;
  transform: rotate(-135deg);
}

.button:hover span, .button:active span
{
  padding-right: 30px;
}

.button:hover span:after, .button:active span:after
{
  transition: opacity 0.5s, top 0.5s, right 0.5s;
  opacity: 1;
  border-color: #00a1e1;
  right: 10px;
  top: 70%;
}
</style>
</head>
<body>
<header class="mainHeader">
    <div class="container clear">
        <a href="/apex/SBIndex" class="logo"><img src="{!$Resource.MainLogo}" alt=""/></a>
        <div class="nav">
            <ul>
                <li><a href="/apex/SBIndex" class="home"><img src="{!$Resource.HomeIcon}" alt=""/></a></li>
                <li><a href="/apex/SBQuestionBank">Question Bank</a></li>
                <li class="active"><a href="/apex/SBCreateSurvey">Create Survey</a></li>
                <li><a href="/apex/SBSendSurvey">Send Survey</a></li>
                <li><a href="/apex/SBREPORT">Report</a></li>
            </ul>
        </div>
    </div>
</header>
<section class="page-name">
    <div class="container clear">
        <h2>Create Survey</h2>
    </div>
</section>
<section class="bodyContainer">
    <div class="container clear">
        <div class="white-box">
            <div class="mainForm">
                <!--<apex:commandButton value="View Existing Surveys" action="{!Manage}" styleClass="green-btn" style="float:right !important;"/>-->
                <a href="/apex/SBAddQuestionPage" class="button"><span>View Existing Surveys</span></a>
                <hr />
                <div class="formFeild">
                    <label>Please enter the name for survey:</label>
                    <div class="feild">
                        <apex:inputText value="{!feedbackmain.Feedback_Name__c}" html-placeholder="Enter name for the survey" id="FbName" required="true" rendered="true"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Upload Logo (5 MB Max. size):</label>
                    <div class="feild">
                        <apex:inputfile value="{!file}"  ></apex:inputfile>
                  <!--     <apex:inputTextarea richText="true" value="{!feedbackmain.Image__c}"  html-placeholder="Logo" styleClass="text-editor"/> -->
                    </div>
                </div>
                <div class="formFeild">
                    <label>Header Text:</label>
                    <div class="feild">
                        <apex:inputTextarea value="{!feedbackmain.Header_Text__c}" html-placeholder="Header Text"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Footer Text:</label>
                    <div class="feild">
                        <apex:inputTextarea value="{!feedbackmain.Footer_text__c}" html-placeholder="Footer Text"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Survey Owner:</label>
                  <div class="feild">
                    <apex:inputField value="{!feedbackmain.Feedback_Taken_by_Contact__c}" required="true"/>
                        <!--<div class="outside-btn">
                            <a href="" class="survey-btn"><img src="assets/images/survey-view-btn.png" alt=""/></a>
                        </div>-->
                    </div>
                </div>
                <div class="formFeild">
                    <label>&nbsp;</label>
                    <div class="feild">
                       <apex:commandButton value="Save" action="{!saveAndRedirect}" style="display: inline-block !important; padding:3px 15px !important; line-height:35px !important; color:#fff !important; font-size:15px !important; background:#75C181 !important; border-radius:35px !important; margin-bottom:15px !important; min-width:125px !important; text-align:center !important;"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<footer class="main-footer">
    <ul>
        <li><a href="#" style="font-size: 17px;">Privacy Policy</a></li>
        <li><a href="#" style="font-size: 17px;">Terms of Services</a></li>
    </ul>
    <div class="copyright" style="font-size: 17px;">© 2016 Survey Builder, All rights reserved. </div>
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</body>
</html>
</apex:form>
</apex:page>
Hi Friends,

I have a requirement, where :-

1. Display some options in SelectOptions
2. Fetch historical data (for 5 years - Around 200k record).
3. Do calculations for each month during last 5 years, based on the options selected in step 1. Display the result finally.

The problem is, while fetching the historical data, there's no way I can use where clause in my query (apart from 5 year time frame). The selectoptions have such values due to which, I CAN'T have where clause in query.

I've built entire logic and have tested it for previous 2 years data. But when I change my where clasue to fetch 5 years data, I get error "heap size too large salesforce" with a 8 digit number!!

I've put the query to fetch historical data in constructor right now. I've also tried readonly mode but the same error pops up. Earlier I was getting view state error which I solved using transient wherever possible.

Please suggest me an alternative. It's ok if after selecting options and pressing the button, user have to wait for couple of minutes to see the results.