• Jaap Scheper
  • NEWBIE
  • 53 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 27
    Replies
I've build a navigation LWC with a Custom Property Editor to be used in a Flow Screen.

The Flow has a Screen with a checkbox 'cancelCheckbox'. When the agent ticks that checkbox, the red button 'Cancel' should appear. When the checkbox is not checked, the red Cancel button should disappear.

User-added image
I did not find a way to bind Flow Variables to my Custom Property Editor. I can add Numbers, Toggles, all beautiful, but how do I bind a Flow variable to my LWC input?
User-added image
Would I not use a Custom Property Editor, I could have used the default input fields, like picture below. Is such input field available for Custom Property Editors? Am I missing this information in the documentation? I have read a lot of documentation, but nothing seems to help here. 
User-added image
So the question is:
How do I bind a Flow Screen variable to a Lightning Web Component's via a Custom Property Editor input?
Thanks in advance!
Hi there,
I am using a Lightning:Maps component to plot a series of markers. When we have a lot of markers, we see in the Javascript's console log window "mapsloader?resource=primitiveMap&version=220:151 Error: Geocoding <Address removed for privacy reasons> failed. Google geocoder status is OVER_QUERY_LIMIT"

I can reduce the amount of requests a little, but I don't expect it to be enough. Does anyone have had the same issue?
I think of this solutions:
  • Pay Google for less limitations -> Is that even possible, as lightning:map uses a Salesforce-owned Google Api key?
  • Reduce the amount of requests -> What exact are the limitations? I searched on Google Documentation, but didn't find hard numbers
  • Build a custom lightning map -> Anyone who did this before?
  • Use a solution from Github -> Any recommendations, anyone experience with https://github.com/zyzbroker/LightningMap ?
Any suggestions, answers, ideas are much appreciated!
Hi all,

I am trying to test a Schedulable class that invokes an @future(Callout=true) method called runWarehouseEquipmentSync.
After Test.StopTest() I check whether the Schedulable already has been triggered (I expect so). It has not been triggered yet.

Can you explain why the Schedulable class not have been triggered after Test.StopTest()?
How do I test the Schedulable class in a correct manner?
 
@IsTest
public with sharing class WarehouseSyncScheduleTest {
    public static String CRON_EXP = '0 0 0 15 3 ? 2022';

    @IsTest
    public static void testScheduledJob() {
        WarehouseCalloutServiceMock mock = new WarehouseCalloutServiceMock();
        Test.setMock(HttpCalloutMock.class, mock);

        // 1. Create data
        List<Product2> equipmentsBefore = [SELECT Id FROM Product2];
        System.AssertEquals(0, equipmentsBefore.size());

        // 2. Schedule a job and run it
        Test.StartTest();
            String jobId = System.Schedule('ScheduledApexTest',
                CRON_EXP,
                new WarehouseSyncSchedule());
            System.Debug('Scheduler JobId: ' + jobId);

            CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE Id = :jobId];
            System.assertEquals(CRON_EXP, ct.CronExpression);
            System.assertEquals(0, ct.TimesTriggered);
            System.assertEquals('2022-03-15 00:00:00', String.valueOf(ct.NextFireTime));
        Test.StopTest();

        ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE Id = :jobId];
        System.assertEquals(CRON_EXP, ct.CronExpression);
        System.assertEquals(1, ct.TimesTriggered); //Test fails here: ct.TimesTriggered is still 0!
        System.assertEquals('2022-03-15 00:00:00', String.valueOf(ct.NextFireTime));

        // 3. Get data and verify that it has changed due to the scheduler
        List<Product2> equipmentsAfter = [SELECT Id FROM Product2];
        System.AssertEquals(2, equipmentsAfter.size());
    }
}

This is the WarehouseSyncSchedule method:
global class WarehouseSyncSchedule implements Schedulable {
  global void execute(SchedulableContext sc) {
      System.Debug('I am here at WarehouseSyncSchedule!'); //I see this code in the output log: so far so good.
      WarehouseCalloutService.runWarehouseEquipmentSync();
  }
}
This is the runWarehouseEquipmentSync():
@future(Callout=true)
    public static void runWarehouseEquipmentSync(){
        //Implementation - removed for readability
        //I do not see any debug statement in the output/log window for this method
    }


 
I've build a navigation LWC with a Custom Property Editor to be used in a Flow Screen.

The Flow has a Screen with a checkbox 'cancelCheckbox'. When the agent ticks that checkbox, the red button 'Cancel' should appear. When the checkbox is not checked, the red Cancel button should disappear.

User-added image
I did not find a way to bind Flow Variables to my Custom Property Editor. I can add Numbers, Toggles, all beautiful, but how do I bind a Flow variable to my LWC input?
User-added image
Would I not use a Custom Property Editor, I could have used the default input fields, like picture below. Is such input field available for Custom Property Editors? Am I missing this information in the documentation? I have read a lot of documentation, but nothing seems to help here. 
User-added image
So the question is:
How do I bind a Flow Screen variable to a Lightning Web Component's via a Custom Property Editor input?
Thanks in advance!

Hi All,
I am badly stuck at a point where I need help from the Community.


I have visualforce email template with custom vf component. The email is send using apex code by a guest user. I get below error while whenever guest user tries to send email using a site page -

INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

public static void sendSurveyNotification(list<Feedback_Survey__c> feedbacks) {
        //try {           
        	if(feedbacks!=null && feedbacks.size()> 0) {               
                //Fetching the email template
                Id emt_notify;
                Id emt_completed;
                list<EmailTemplate> emts = [Select Id, Name, DeveloperName From EmailTemplate where DeveloperName 
                                            IN ('C_SAT_Survey_Request_Notification','C_SAT_Survey_Completed_Notification') LIMIT 2];
                
                if(emts[0].DeveloperName == 'C_SAT_Survey_Request_Notification') {
                    emt_notify = emts[0].id;
                    emt_completed = emts[1].id;
                }
                else {
                    emt_notify = emts[1].id;
                    emt_completed = emts[0].id;
                }
                list<Messaging.SingleEmailMessage> messages = new list<Messaging.SingleEmailMessage>();
                
                for(Feedback_Survey__c fbk: feedbacks) {
                    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                   	if(fbk.C_SAT_Status__c == 'Initiated')
                    	mail.setTemplateId(emt_notify);
                    else
                        mail.setTemplateId(emt_completed);
                    
                    mail.setTargetObjectId(UserInfo.getUserId());
                    System.debug('Taget Object Id==>'+UserInfo.getUserId());
                    mail.setWhatId(fbk.Id);
                    System.debug('fbk id==>'+fbk.id);
                    mail.setTreatTargetObjectAsRecipient(false);
                    list<String> ccaddresses = new list<String>{(String)fbk.Transaction_Manager_Email__c, (String)fbk.Survey_Requester_Email__c};
                    mail.setCcAddresses(ccaddresses);
                    mail.setToAddresses(new list<String>{(String)fbk.Real_Estate_Manager_Email__c});
                    mail.setOrgWideEmailAddressId(system.label.Org_Wide_TM_Support);
                    System.debug('Org Wide Address==>'+system.label.Org_Wide_TM_Support);
                    mail.setSaveAsActivity(false);
                    messages.add(mail);
                }
                Messaging.sendEmail(messages);
            }
        /*}
        Catch(Exception e) {
            System.debug('Error ==>' +e.getMessage());
            System.debug('Line Number ==>' +e.getLineNumber());
            System.debug('Cause ==>'+e.getCause());
            System.debug('Cause ==>'+e.getStackTraceString());
        }*/
    }

Thanks in Advance...!!
I'm attempting to set up Bitbucket pipelines for our Salesforce development process. Due to multiple managed packge dependencies and standard settings that are unable to be migrated, I'm opting to run test validations in Sandboxes as opposed to Scratch orgs. Installation and Authentication are working great, however once it gets to the deployment step, it throws the following error:

ERROR running force:source:deploy: Unexpected arguments: -c, --testlevel, RunLocalTests
See more help with --help


Here's the relevant segment of the pipeline
 
#Assign variables 
- export CLIURL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz  
- export SFDX_AUTOUPDATE_DISABLE=false
 - export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true
- export SFDX_DOMAIN_RETRY=300
- export SFDX_DISABLE_APP_HUB=true
- export SFDX_LOG_LEVEL=DEBUG
- export ROOTDIR=force-app/main/default/
#Create sfdx directory
- mkdir sfdx
#Install Salesforce CLI
- wget -qO- $CLIURL | tar xJ -C sfdx --strip-components 1
- "./sfdx/install"
- export PATH=./sfdx/$(pwd):$PATH
- sfdx --version
- sfdx plugins --core
#Authorize UAT
- sfdx force:auth:jwt:grant --clientid $UAT_CONSUMER_KEY --jwtkeyfile assets/server.key --username $UAT_USERNAME --setalias UAT --setdefaultusername --instanceurl https://test.salesforce.com
#Runs tests
- echo "Running Tests"
- sfdx force:source:deploy -c --testlevel RunLocalTests --sourcepath $ROOTDIR --targetusername UAT --wait 10

​​​​​​​
Hi all,

I'm getting an error while verifying step 7:
  • Challenge Not yet complete... here's what's wrong:  Ensure that you implement all the pagination methods using the corresponding StandardSetController methods.
I implemented the class using the StandardSetController methods but it doesn't work.

Any advice or suggestion?
Thank you.

I'm building a Lightning Component that includes a ui:scrollerWrapper, containing an aura:iteration. I want the scroller to default scrollTo the bottom. 

I found this documentation: https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/aura_compref_ui_scrollerWrapper.htm? that lists the Methods, including scrollTo(destination) where destination is a string with options "top", "bottom", "left" and "right".  But I can't figure out where to put that method.

My component markup:
 

<ui:scrollerWrapper class="scrollerSize" aura:Id="scroller">

        <aura:iteration items="{!v.messages}" var="message">
            <c:MessageTile message="{!message}" inits="{!v.conversation.GroupInits__c}"/>
        </aura:iteration>

    </ui:scrollerWrapper>
My css:
.THIS.scrollerSize {
    height: 400px;
}
I tried this in the doInit handler:
var scroller = component.find("scroller");
scroller.scrollTo('bottom');
But it doesn't work.

Advice?

 
My code development environment conists of Apple MBP, Google Chrome browser and Salesforces native Developer Console tool. With the Google Chrome v56 update, scrolling up/down in developer console becomes extremely jumpy and it makes my experience extremely painful. I have to go on Safari and develop there as a workaround.

Is anyone else here experiencing this issue? Here's the related StackExchange topic. I would like to hear any solutions to this problem if there's any.
Developing a site in muliple langauges using visualforce and I am using Custom Labels. If there is a better way to manage lanugage translations do divulge the secret...

So I have created a custom label under setup > custom labels

{!$Label.idiots}

You must fill out the form correctly <b>stupid customer</b>!

This is the label. I need the customer to know how silly they are by putting it in bold. Any ideas?
 
  • August 04, 2016
  • Like
  • 0
Hi,

I have passed a single value to my server side apex controller using the following code

action.setParams({ "searchKey" : elemVal });

Now i want to pass one more argument along with elemVal. I tried the following code but i am getting null.

action.setParams({ "searchKey" : elemVal },{"temp" : t}):

Please help
  • June 24, 2016
  • Like
  • 0

The Summer 16 documentation lists System.limits.getLimitAsyncCalls() a part of the new method to go along with combined limit on asyncs. From the release documentation, it seems as if that limit, and this method, is generally available. When looking in the API documentation, System.limits.getLimitAsyncCalls() still says that it is reserved for future use.

Summer 15 Doc for Reference

Not to rely on documentation alone, I attempted to schedule more the 50 @future calls but was presented with an error for scheduling more than 50 @futures.  When calling System.limits.getLimitAsyncCalls() it lists the limit as 50.

From my understanding, this the new limit is 200 asynchonous calls of any combination of the following:

  • Methods with the future annotation (@future)
  • Jobs added to the queue with the System.enqueueJob method
  • Classes scheduled concurrently with the System.schedule method
  • Batch Apex jobs scheduled with the Database.executeBatch method
Am I not understanding something correctly? Is the API documentation correct and this was not actually rolled out and is still being reserved for future use? Appreciate the help!
Hi, 
can i get all the values of a picklist field in a list some how?

I have picklist type custom field in the product. having some options.
In my apex class i want to use these options. can I get them some how throught code? 
Hi All- 

I have a visualforce page with images that I need to render as a PDF. The images come from a formula field and display fine if I remove renderAs="pdf". However when I put it back, the PDF shows broken images. The VF page code is below. Note that the image field is actually a formula field that creates the entire html img element with src.
 
<apex:page standardController="Opportunity" recordSetVar="SelectedOpportunities"> 
    <apex:variable var="number" value="{!0}"/> 
    <apex:repeat value="{!selected}" var="SelectedOpportunity">
     <apex:outputText rendered="{!MOD(number,8)==0}"><p align="center" style="{!IF(number!=0,'page-break-before: always;','')}"></p></apex:outputText>
    <apex:variable var="number" value="{!number + 1}"/> 
    <apex:outputText rendered="{!MOD(number,2)==1}"><div style="width:350px; float:left; border:1px solid black">
<table><tr><td width="200px" height="200px"><apex:outputtext value="{!SelectedOpportunity.Student_Image__c}" escape="false" /></td>
    <td width="150px" height="200px"><span style="font-weight: bold"> {!SelectedOpportunity.Full_Name__c} </span> <br /> 
    {!SelectedOpportunity.City__c}, {!SelectedOpportunity.State__c}  {!SelectedOpportunity.Country__c}<br />
    {!SelectedOpportunity.Voyage_Code__c}</td></tr></table></div></apex:outputText>
    <apex:outputText rendered="{!MOD(number,2)==0}"><div style="width:350px; float:right; border:1px solid black">
<table><tr><td width="200px" height="200px"><apex:outputText value="{!SelectedOpportunity.Student_Image__c}" escape="false"/></td>
     <td width="150px" height="200px"><span style="font-weight: bold"> {!SelectedOpportunity.Full_Name__c} </span> <br /> 
    {!SelectedOpportunity.City__c},{!SelectedOpportunity.State__c}  {!SelectedOpportunity.Country__c}<br />
    {!SelectedOpportunity.Voyage_Code__c}</td></tr></table></div></apex:outputText>
</apex:repeat>
</apex:page>

Anyone have any ideas how to fix this? I've disabled the security checking for remote sites and that does not work either.
 
Hi all,

I have the following visualforce code (simplified a little for clarity):

<apex:page standardController="NCQ__c">
  <apex:tabPanel id="tabPanel" switchType="client" selectedTab="BusinessAssessmentTab">
    <apex:tab id="BusinessAssessmentTab" label="Business Assessment" name="BusinessAssessmentTab">
      <apex:form>
        <apex:pageBlock>
          <apex:pageBlockSection title="Business Type">
            <apex:inputField value="{!NCQ__c.Business_Type__c}">
              <apex:actionSupport event="onchange" rerender="McQuestions" immediate="true"/>
            </apex:inputField>
          </apex:pageBlockSection>
          <apex:pageBlockSection id="BusinessAssessmentBlock" title="Business Assessment">
            <apex:outputPanel id="GeneralQuestions">
              <apex:outputField value="{!NCQ__c.BA_1_Question__c}" rendered="true"/>
              <apex:inputField value="{!NCQ__c.BA_1_Answer__c}" style="width: 100%"/>
              <p/>
            </apex:outputPanel>
            <apex:outputPanel id="McQuestions">
              <apex:outputField value="{!NCQ__c.BA_MC_1_Question__c}" rendered="true"/>
              <apex:inputField value="{!NCQ__c.BA_MC_1_Answer__c}" style="width: 100%"/>
              <p/>
            </apex:outputPanel>
          </apex:pageBlock>
        </apex:form>
      </apex:tab>
    </apex:tabPanel>
  </apex:page>

I'd like to eventually hide or show the McQuestions panel based on the value of NCQ__c.Business_Type__c. Has a first step, I just had the McQuestions panel rerender on any change to Business_Type__c. For some reason, rerendering the panel causes the outputFields values to disappear from McQuestions. I have no clue what is going on! I'm hoping someone has some ideas? I've attached two images (before and after) to illustrate what is going on.

Please let me know if you need any further details!

-Chris 

User-added image
User-added image

Hi,

I have a VFpage where in I am using the <apex:repeat> component which will repeat the code depending on number of items in the object. Inside the <apex:repeat> component, I have <apex: inputField> components; this are the fields that are being repeated. currently, in the <apex:inputField>, I gave them a regular id="test1", but the problem that I am facing is if there are 3 records in the object then the repeat component will put three sections in the VF page. In this case, all three inputFields are having the same id. 

I want to give them all the unique id's no matter how many records we have in the other object.

 

Please throw out any ideas you have for this problem. I would really appreciate it.

 

Thanks-in-Advance,

Justin~sfdc

Requirement: To get Account details from SAP and store it in Salesforce during the first week of every month.

 

To implement this, I can use HTTP Callouts to the SAP webservices.  The callouts call the SAP services, pass the account Id and gets all the other information and stores in Salesforce.  This logic I can do it in my Apex classes and schedule it to run on 1st of every month.

 

What I want to know is how to setup the connection between SAP and Salesforce? Can anyone brief the steps ?

- Does SAP allow creation of web services for Salesforce to call? 

- Do we need any third party tools ? 

- Can I use outbound messaging services in Salesforce? 

- How is the hosting of SAP web service taken care?

 

Please help.  Thanks!

Let's say I got 50,000 records in a table where there is a field named OwnerID.  Let's say I just want to grab a set of the distinct OwnerIDs and not be charged 50,000 query rows for my governor limits.  What ya'll have to say about 'dat?

 

 

~Tyler

Hello.  I have a metadata .object file and I'm trying to use ant to create the custom object in my sandbox.  If I limit the package.xml file to a single field, then it works, but if I try to create all the fields, I get errors "not in package.xml" even though I do have the fields there.

 

I've searched the documentation but there is no good example on how to deploy a complete custom object.  Any ideas as to where I'm going wrong?

 

BTW - this is a Custom Settings object.

 

Here's a portion of my xml file:

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>GWpkg</fullName>
    <types>
        <members>OppRollupSettings__c</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>OppRollupSettings__c.Assume_Fiscal_Year_Starts_January__c</members>
        <name>CustomField</name>
    </types>
    <types>
        <members>OppRollupSettings__c.Enable_Opp_Rollup_Triggers__c</members>
        <name>CustomField</name>
    </types>
    <version>20.0</version>
</Package>

 

 

 

Here's my build.properties file:

 

"antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>

    <!-- Test out deploy and retrieve verbs for package 'GWpkg' -->
    <target name="deploy">
      <!-- Upload the contents of the "GWpkg" package -->
      <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployRoot="GWpkg"/>
    </target>
</project>

 

 

 

 

Hi All,

 

Writing my first test class here and fallen at the first hurdle!

 

To be able to test my class I need to instantiate a load of test objects first of all, so I have written a little class to do that which works fine.

 

The class I want to test is a (will be a) shopping cart that does nothing but instantiate so far.

 

I've started writing the test class to go alongside for my TDD. First I've instantiated all the test objects and written my first test method. However, Force.com IDE complains that objects are not available in my class. So when I try to save  

 

 

@isTest
private class TMDR_ShoppingCartTest {



	testBuildObjects tbo = new testBuildObjects();
	Account a = tbo.createAccount();
	Contact c = tbo.createContact(a.id);
	Opportunity o = tbo.createOpportunity(a.id,c.id);
	OpportunityContactRole ocr = tbo.createOpportunityContactRole(c.id,o.id);
	OpportunityLineItem oli = tbo.createOpportunityLineItem(o.id);
	OpportunityLineItem oli2 = tbo.createOpportunityLineItem(o.id);
	OpportunityLineItem oli3 = tbo.createOpportunityLineItem(o.id);
		
	static testMethod void testInstantiate() {
			
			System.Debug('########Starting Shopping cart tests###########');
			TMDR_ShoppingCart cart = new TMDR_ShoppingCart(o.id);
		
	}

}

 

 

 

 Force.com complains that o.id does not exist!

 

This must be a simple one. Can you help?

 

TIA

 

 

 

 

Hi,

 

Is there a way to reference a locally created static resource from within a managed package? 

 

I thought that using the c__ namespace might work however it doesn't resolve properly. For example if I have visualforce page in my managed package that includes a locally created visualforce page. Any reference to the a local static resource causes an error, even if the namespace is appended 

 

{!$Resource.testbg} //Can't find the resource

{!$Resource.c__testbg} //Still can't find the resource 


Any ideas on how to get around this?

 

 

I have some code that sends out an email. If I run that code from inside salesforce it works fine. However, if I run that code as the public sites user I get the following SendEmailResult error.

 

SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

 

However, all the mailing objects ID's (who, what, template and orgwide) are exactly the same when I send it from inside salesforce and from the website so I don't understand how it could be giving an error in one case but not the other.

 

 Here's the code that sends the email:

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 

mail.setTemplateId(template);

mail.setwhatId(what);

mail.setTargetObjectId(who);

mail.setSaveAsActivity(true);

mail.setOrgWideEmailAddressId(orgwide);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail});

 

for(Messaging.SendEmailResult res : r){

if(res.isSuccess() == false)

System.debug(res.geterrors().get(0).getMessage());

}

 

 Am I misunderstanding the error or is there some other ID field that could be screwing up the email?

 

 

Message Edited by grigri9 on 11-17-2009 09:08 PM