• Scott Haleo 4
  • NEWBIE
  • 105 Points
  • Member since 2016

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 42
    Replies
after one button fire a redirect from lightning component to a list view, i receive that message "Refresh this list to view the latest data".

even using the commands "sforce.one.navigateToList(ListViewId, ListViewName, Custom Object)" or "sforce.one.navigateToURL(myUrl, true)" the list view isn't refresh in Desktop, but in mobile the data is refresh.

is there some way to refresh my list view even when i'm using a desktop?
I have seen this article and try to adopt this method.
Salesforce Form Validation Enhanced:
https://th3silverlining.com/2010/03/02/visualforce-form-validation-enhanced/
However, I do not know why I get nothing happen even I have followed the step. Here is my code:
<apex:page standardController="Artist__c" extensions="extattachfile" showHeader="false" sidebar="false">
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<style type="text/css">
h1 {font-size: 150%; font-weight: bold;}
h2 {font-size: ;}
p { width:100%;
    font-size: 120%;
    text-align: justify;
    text-justify: inter-word;}
.reddot {color: red; font-size:120%;}
.textarea { height:200px; 
            width:300px;
            border-radius: 5px;}
.url {width:300px;}
.title {font-size:175%;}
.standard {width: 310px;}
@media only screen and (min-width: 900px) {
    /* For desktop: */
p { width:890px;
    font-size: 120%;
    text-align: justify;
    text-justify: inter-word;}
}
.color {
    background-color: #F7F6D2;
    -webkit-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -o-transition: all 1s ease;
    transition: all 1s ease;
}
</style>

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"/>
<apex:includescript value="{!$Resource.jQuery}"></apex:includescript>
<apex:includescript value="http://ajax.microsoft.com/ajax/jquery.validate/1.6/jquery.validate.min.js"></apex:includescript>
</head>    

    <script type="text/javascript"> 
        $(document).ready(function() {
              
            $('[id$=artistform]').validate();             
              
            $('[id$=engname]').rules("add",{
                required: true,
            });     
             
            $('[id$=email]').rules("add",{
                required: true,
                email: true
            });      
             
             
            /* Customised the messages */
            jQuery.validator.messages.required = "You better have entered a value.. or else!"; 
            jQuery.validator.messages.equalTo = "No silly, you're supposed to type the same set of characters AGAIN.";                                                
        });
         
    </script> 
     

<apex:form styleclass="form" id="artistform">
   <apex:pageBlock >
<apex:pageMessages />
<div><b class="title">Artist Submission Form</b></div><br/>

<br/>
     <h1>Artist / Group Information 表演者 / 團體資料</h1>
     <br/><br/>
<br/>
      <div class="standard">
     <h2 >Artist Name (English)</h2><br/>
	<apex:outputText styleClass="reddot" value="*"/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputField value="{!artist.Artist_Group_Name_English__c}" label="" id="engname"/>
     </apex:panelGroup>
     <br/>      </div>
<br/>
<br/>
      <div class="standard">
     <h2 >Artist Biography (English)</h2><br/>
	<apex:outputText styleClass="reddot" value="*"/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputField value="{!artist.Artist_Group_Biography_English__c}" label="" styleClass="textarea" id="engbio"/>
     </apex:panelGroup>
     <br/><br/>      </div>
<br/>
      <div class="heading">
     <h1>Name and Roles of Group Members (if applicable)</h1>
     <br/><br/>      </div>
<br/>
      <div class="standard">
     <h2>Name and Roles of Group Members</h2><br/>
     <h2>團體成員姓名及崗位</h2><apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputField value="{!artist.Member_Name_Role__c}" label="" styleClass="textarea"/><br/>
     <br/>      </div>
<br/>
      <div class="standard">
     <h2 >Photo of Artist : max 3 attachments</h2><br/>
	<apex:outputText styleClass="reddot" value="*"/>
     <br/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputFile value="{!objAttachment.body}" fileName="{!objAttachment.name}" required="false" id="photo"/><br/></apex:panelGroup>
     <apex:inputFile value="{!objAttachment2.body}" fileName="{!objAttachment2.name}" required="false" /><br/>
     <apex:inputFile value="{!objAttachment3.body}" fileName="{!objAttachment3.name}" required="false" />
     <br/><br/>      </div>
<br/>
      <div class="standard">
     <h2>Website</h2><outputtext/><apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputField value="{!artist.Website__c}" label="" styleClass="url" id="web"/><br/>
     <br/>      </div>
<br/>
      <div class="standard">
     <h2 >Facebook</h2><apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputField value="{!artist.Facebook__c}" label="" styleClass="url" id="facebook"/><br/>
     <br/>      </div>
<br/>
      <div class="standard">
     <h2 >SoundCloud</h2><apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputField value="{!artist.SoundCloud__c}" label="" styleClass="url" id="soundcloud"/><br/>
     <br/>      </div>
<br/>
      <div class="standard">
     <h2 >YouTube</h2><apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputField value="{!artist.YouTube__c}" label="" styleClass="url" id="youtube"/>
     <br/>      </div>
<br/><br/>
      <div class="standard">
     <h2>Technical Rider : max 1 attachment</h2><br/>
	<apex:outputText styleClass="reddot" value=""/><br/>
     <apex:inputFile value="{!objAttachmentt.body}" fileName="{!objAttachmentt.name}" /><br/>      </div>
<br/>
      <div class="standard">
     <h2>Stage Plot : max 1 attachment</h2>
     <br/>
	<apex:outputText styleClass="reddot" value=""/><br/>
    
     <apex:inputFile value="{!objAttachments.body}" fileName="{!objAttachments.name}" required="false" /><br/><br/>      </div>
<br/>
      <div class="heading">
     <h1>Contact Information</h1> <br/><br/>      </div>
<br/>
      <div class="standard">
     <h2>Contact Person</h2><apex:outputText styleClass="reddot" value="*"/><br/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputField value="{!artist.Contact_Person__c}" label="" id="contactperson"/>
     <br/>
     </apex:panelGroup>      </div>
<br/>
      <div class="standard">
     <h2 >Contact No.</h2><apex:outputText styleClass="reddot" value="*"/><br/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputField value="{!artist.Contact_Number__c}" label="" id="contactno"/>
     <br/>
     </apex:panelGroup>      </div>
<br/>
      <div class="standard">
     <h2>Email</h2><apex:outputText styleClass="reddot" value="*"/><br/>
     <apex:panelGroup styleClass="col02 requiredInput" layout="block">
     <apex:panelGroup styleClass="requiredBlock" layout="block"/>
     <apex:inputField value="{!artist.Email__c}" label="" id="email"/>
     <br/>
     </apex:panelGroup>      </div>
<br/>

<br/>
      <div>

        <apex:commandButton action="{!save}" value="Save"/>
      </div>
      
<script>
var addclass = 'color';
var $cols = $('.standard').click(function(e) {
    $cols.removeClass(addclass);
    $(this).addClass(addclass);
});


</script>

</apex:pageBlock>       
</apex:form>
<apex:pageMessages />
</apex:page>

Thanks for your help.
Component (Cmp) is null on Production only. 
On sandbox it's filled.

I have no idea what could be the reason.
The error I get in the console is : WARNING: Access Check Failed! AttributeSet.get(): attribute 'itemsMap' of component 'markup://c:ItemsList {3:2;a}' is not visible to 'markup://c:ItemsList {3:2;a}'.

Any idea? It's very urgent!!!


User-added image
There is something wrong on challenge on Getting Started with Accounts and Contacts module.

I did everything right and this error continuous appearing.

Challenge Not yet complete... here's what's wrong:  The 'Smith Enterprises' account record could not be found or it does not have the correct values for the 'Type' and 'Industry' fields
We have recently implemented a new process using process builder. A user has recently contacted me to say that he is having difficulty saving a record since he is receiving an error message. I too, as the Systems Admin, have visibility of this, please see below detail. I have no idea what it's telling me. I have an idea and it maybe to do with the fact that it can't update a field because there is a blank value. Would this not be okay anyway to update? There is a another process on the back of this that references this field and if it is blank, the value is updated as 'Other' 

Any ideas? Tried to contact Salesforce Support but looks like they keep chaning support options to force people to use communities. 


An error occurred at element myRule_5_A1 (FlowRecordUpdate).
The flow failed to access the value for myVariable_current.Ticket_Number__r.Contract__r.Product__c because it hasn't been set or assigned.

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Update_PO_Product
Type: Workflow
Version: 8
Status: Active
Flow Interview Details
Interview Label: Update_PO_Product-8_Purchase_Order__c
Current User: Norah Almola (00520000002d2VY)
Start time: 23/08/2016 09:27
Duration: 0 seconds
How the Interview Started
Norah Almola (00520000002d2VY) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a04w000000TcYP9AAN
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "23/08/2016 09:27"
DECISION: myDecision
DECISION: myDecision2
DECISION: myDecision4
Executed this outcome: myRule_5
Outcome conditions: and
1. {!formula_myRule_5} (true) Equals true
Logic: All conditions must be true (AND)
 
Looking for a way to SEND Echosign agreements from code.

I have echosign installed and it's working well. I also build the agreement from code and it works well. Now, I would like to actually do the SEND from code.  

So far - all of the examples I have seen - have been for creating a custom SEND button - utilizing the AgreemenTemplateProcess VF page, and specifiying the MasterID.  But - in this case - I've already built the agreement, and custom PDF attachment.

Any thoughts?

Thanks
I added a new record type to my opportunities titles Training Opportunity and simply want to add this to an apex trigger.  When I try to validate the change in my production org, I receive the following:
Code Coverage Failure
The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
ServiceContractTrigger 
WriteContractDate 
Apex Test Failures 
Class NameMethod NameError MessageStartFulfillmentControllermyTestSystem.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The pricebook entry currency code is different than the one assigned to the Service Contract.: [PricebookEntryId] 
Stack Trace: Class.StartFulfillmentController.start: line 72, column 1 Class.StartFulfillmentController.myTest: line 144, column 1
after one button fire a redirect from lightning component to a list view, i receive that message "Refresh this list to view the latest data".

even using the commands "sforce.one.navigateToList(ListViewId, ListViewName, Custom Object)" or "sforce.one.navigateToURL(myUrl, true)" the list view isn't refresh in Desktop, but in mobile the data is refresh.

is there some way to refresh my list view even when i'm using a desktop?
Hello,

I am trying to use the ContentDistribution object to be able to generate links through Apex code. However, any time I try to use the object like this:
ContentDistribution cd = new ContentDistribution();
I get an 'This entity is not org-accessible' error. Is there a reason I can't create this object?

Thank you
 
Hi All, I have a multi-select picklist that has 52 values in it. The requirement is to populate the selected values to another long text field. The original multi-select field is labeled "AMP". I have created a long text and updating the values using a workflow field update.Following is the formula I have used.

IF(INCLUDES(AMP__c,'Blue Card PPO'), 'Blue Card PPO'+ '; ',NULL)&
IF(INCLUDES(AMP__c,'Blue Choice PPO'), 'Blue Choice PPO'+ "; ",NULL)&
IF(INCLUDES(AMP__c,'Blue View Vision Only'),'Blue View Vision Only'+ "; ",NULL)&
IF(INCLUDES(AMP__c,'Comprecare'), 'Comprecare'+ "; ",NULL)&
IF(INCLUDES(AMP__c,'Direct HMO'), 'Direct HMO'+ "; ",NULL)&
IF(INCLUDES(AMP__c,'Direct POS'), 'Direct POS'+ "; ",NULL)

Likewise I have many more in the list. The problem is whenever I try saving this it gives me an error on the Byte size. It should not exceed 4000bytes. I have managed it to cut it down to 4600bytes. Please help me out on this.
 
  • August 18, 2016
  • Like
  • 0
I’ve tried different ways of getting a redirection done following a bunch of tutorials and SF documentation (almost useless for me):
http://www.soliantconsulting.com/blog/2016/04/embed-a-lightning-component-in-a-visualforce-page
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToURL.htm
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm
 
Also tried using window.location directly, but that resulted in errors.
Code below.
 
Any help is appreciated,
Francisco
 
VF page:
<apex:includeScriptvalue="/lightning/lightning.out.js"/>
.
.
.
<script>
functioncreate_object(){
$Lightning.use("c:LightningApplication", function() {                        $Lightning.createComponent("c:LightningComponent",
             {  },
             "",
             function(component) {}
             );
       });
}
                          
create_object();
</script>
 
LightningApplication.app
<aura:application access="global" extends="ltng:outApp">
       <c:LightningComponent />
<aura:dependency resource="c:LightningComponent"/>
</aura:application>
 
LightningComponent.cmp
<aura:component access="global">
<aura:registerEvent name="Event" type="c:LightningEvent"/>
       <ui:button
label="Redireccion"
               press="{!c.test}" >
</ui:button>
</aura:component>
 
LightningComponentController.js
({
       test : function(component, event, helper) {
var redirect = $A.get("e.force:navigateToURL");
             if (redirect){
redirect.setParams({
                "url": "https://www.google.com"
            });
                    redirect.fire();
        } else {
                    component.find("button1").set("v.label",'Nothing happened');
        }
       }
})
 
LightningEvent.evt
<aura:event type="COMPONENT" description="Event template" >
<aura:attribute name="url" type="String"/>
</aura:event>
 
Hi,
I have a managed package that I'm developing. In the developer org the above expression returns:
- normal result counting more than 61 fields when ran in anonymous execution mode
- sooner 0, now 1 field only when ran from tests as well as from batch job (apex)
Why? I need all the fields to be accessible in batch job or tests.
I found that API restriction might be the limiting factor. But my package has no possibility to set its restrictions:

Package settings without possibility to set its restrictions.
<apex:page standardController="Attachment" extensions="displayImageExtension">
<c:SiteHeader ></c:SiteHeader>
<apex:form >
<apex:pageBlock>
    <apex:pageBlockSection >
         <apex:outputText value="https://anil-cse-domain-dev-ed.my.salesforce.com/servlet/servlet.FileDownload?file=00P9000000w8OFIEA2">
        </apex:outputText>
       
        <apex:image title="imagepreview" value="https://anil-cse-domain-dev-ed.my.salesforce.com/servlet/servlet.FileDownload?file=00P9000000w8OFIEA2"/>
        <apex:image url="{!URLFOR($Action.Attachment.Download, '00P9000000w8OFIEA2')}"/>
        <a href="javascript:void(0);" id="00P9000000w8OFIEA2" target="_blank" onclick="window.open('{!$Site.CurrentSiteUrl}'+'servlet/servlet.FileDownload?file=00P9000000w8OFIEA2', '_blank')">FilePreview</a>
        <a href="javascript:void(0);" id="00P9000000w8OFIEA2" target="_blank" onclick="window.open('https://anil-cse-domain-dev-ed.my.salesforce.com/servlet/servlet.FileDownload?file=00P9000000w8OFIEA2', '_blank')">FilePreviewDirectLink</a>
    </apex:pageBlockSection>   
</apex:pageBlock>
</apex:form>
</apex:page>
Our instance has a large amount of apex on a custom object and we continously run into the dreaded CPU Timeout error. Even after going to great lenghts to optimize our code by combining queries, pushing triggers to async methods, and even removing some logic we still manage to run into this error. We have also implemented a trigger framework similar to the one documented on Salesforce Dev blogs to try and cope with this. However, since we are using a trigger framework, there are a large number of class instantiations and method calls per transaction so I'm wondering if this is just adding to the problem.

My question is, what are some of the less obvious culprits that can contribute to the timeout error? And given those, what is the best way to compensate for those when writing triggers?

Any feedback is appreciated, Thanks.
  • August 17, 2016
  • Like
  • 0
 When creating a task in an opportunity in the Lightning Opportunity page and assigning the task to another person (aka - a delegated task) we are getting error messages 1461874646-144188 (-620721962) which is preventing the Salesforce users from creating the task. After a lot of digging, I pretty sure the error is being cause by an opportunity validation rule that is failing in a backend flow program. The flow program creates an email alert to the Creator of the task when the task become overdue. Interestingly the user does not get this error when they assign the task to themselves.  

I am not sure why the the Opportunity Validation Rules is getting triggered as the user is creating a task. FYI on the backend programs:
  • There is Process Builder program that get triggered when the Task is created and it schedule when the Task Due Date is exceed a call to the headless flow program which sends an email alert to the Task Creator to tell the creator that the task is overdue.
  • The headless Flow program does not write to the Opportunity record however it reads the Opportunity record to get the opp id and name to include in the email alert.  
My questions are:
  1. Is there a way that the backend flow program can by pass the Opportunity Validation Rules? 
  2. Is there a way that in the headless flow that the program can check the Closed Date & Stage (ie check the same logic as the validation rule) and prompt the user that they need to first changed the closed date?
I am a newbie so any advice is most welcome as my whole approach may be wrong.  For a new web guest where I don't yet want to require the guest to reveal name and contact information, I have a page that creates a unique ID, saves this as a cookie, and uses web-to-lead to create a new Lead record with this name and his interests from a form multi-select list.  This all seems to work.  When this lead comes back in a new session, this page sees that he has a unique ID in cookie and assigns a new visualforce page with a URL parameter containing the existing unique ID.  The new page attempts to look up his Lead record interests using a controller extension with a select statement.  I have looked through many examples online of how to code the controller (some of which gave me syntax errors) and picked what seems like the simplest example for a template that "compiles".  From the start, the controller query is returning nothing.  So I have simplified the controller query to only try to find the first lead record to return and this also returns nothing.  My controller extension code is:

public class LeadNameLookupTest 
{
    public LeadNameLookupTest(ApexPages.StandardController controller) {}
    
    private Lead guest;
    public LeadNameLookupTest()
    {
         guest = [select ID, name from Lead limit 1];
    }
    public Lead getLeadRecord()
    {
        return guest;
     }
}

The visualforce page below third alert does display the unqiue ID being passed via URL but the earlier alerts display nothing in alert popup.  The  page code is:

<apex:page standardController="Lead" extensions="LeadNameLookupTest">
<script>
alert({!LeadRecord.ID});
alert({!LeadRecord.name});
var guest_name = "{!$CurrentPage.parameters.guest}";
alert(guest_name);
</script>
</apex:page>

Maybe the controller example I used is flawed.  I did see other more complicated templates. I even tried some of these more complicated examples but they would not "compile" or the page script reference to controller result failed.  Or maybe my alerts are a problem.
We are running NGOC and manage our membership through rollups at the account level.  We also are using Mailchimp as our email client.  The issue I am having is the the field "Primary Membership Status"  is no longer being updated.  For Mailchimp to sync it looks for people whose status is "Active".  "Active" members are those whose "Primary Membership Expiration Date" is greater that today's date.  So if they have not yet reached their expiration date their status will be  "Active"  If it is past that date the status would change to "lapsed".  How fo I get this job to run and update all account each night?
I am getting above error in both sandbox and production. I found similar posts but none of the workaround worked for me. It runs only first testmethod of test class and says its passed but class failed. I don't have salesforce support for this org.

Tried
  • Clear test Data 
  • Disable Parallel Test Run
  • Used Eclipse to deploy
  • Waited more than 12 hours
SUPPORT CAN YOU PLEASE HELP. Org seems to be stuck in some weird state and we don't have any custom code on prod. Unable to deploy even config stuff to prod. I believe something needs to be reset on salesforce end.
Hi all,

I am getting a response from REST Api consisting of names and "nextpagetoken". I dont want to store this response in salesforce. Am adding these names to the WrapperList and displying them on visualforce page. I limited my callout to query only 10 names. When clicked on GetMore commandButton (making 2nd callout using nextpagetoken) i need to add the next 10 names to the existing WrapperList and show total 20 names on VF page.

Suggestions are appretiated. Thanks.
  • August 15, 2016
  • Like
  • 0
I have a custom object used by our health team to track pregnancy data/ post natal records.  Our health team will sometimes provide our clients with supplies (we are a charity) and we would like to track what supplies are given out.  I have successfully created a junction object which has allowed me to show the 'products' related list in the health custom object.  So our health team can add a product to the record.  Is it possible to allow them to also specifiy quantity?  I am not able to do this - no field for quantity appears as an option.  They can potentially click to add product multiple times if needed but ideally we can specify quantity.  Ideally I'd also like to only specify certain products- either by record type or by price book.


 

We are working on some Lightning Components for a Salesforce Community. We are using our own template which is bare bones. 

Here's the code: 

<aura:component access="global" implements="forceCommunity:availableForAllPageTypes">
<ltng:require styles="/resource/slds2_0_2/assets/styles/salesforce-lightning-design-system.min.css" />
    <ui:inputDateTime label="Meeting Time" class="slds-input" displayDatePicker="true"/>
</aura:component>

In our community, it looks like this:

User-added image

in LEX and in Napili it looks as expected and of course, we don't need the ltng:require tag in there.

Are there any workarounds to this issue?