• MarkInAtlanta
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies

So i am digging thru sample code, and i have a lightning quick action working that calls an Apex method. 
The sample calls the controller js function as part of the button click - but i dont want a UI interation in this quick action 

How would I duplicate   <ui:button label="Call Apex" press="{!c.echo}"/>  function  without the UI piece?  - 

here is the simple component : 

<aura:component implements="force:lightningQuickAction" 
                controller="SimpleServerSideController">

    <aura:attribute name="firstName" type="String" default="daffy"/>
    <ui:inputText label="Enter a name: " class="field" value="{!v.firstName}"  updateOn="click" />   
    <ui:button label="Call Apex" press="{!c.echo}"/>

</aura:component>
So i have a need to develop a test class, and it requires i create some opportunities and lines. I have others where we use SeeAllData, but since this was a new process i wanted to try and get around that.. 

on the pricebookentry i am getting error  - 
15:23:46:000 FATAL_ERROR Class.opp_test.ExpectToTest: line 21, column 1  (which points to insert of PricebookEntry
15:23:46:113 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error:  FIELD_INTEGRITY_EXCEPTION, field integrity exception: []
Thats it for the FIELD_INTEGRITY_EXCEPTION - no other hints.. 


Here is a simple test that throws the error 

@isTest 
public class opp_test {
    
static testMethod void ExpectToTest() { 
    
        //Create test product: 
        Product2 testProductDispenser = new Product2(); 
        testProductDispenser.name = 'testDispenser'; 
        testProductDispenser.ProductCode = 'adisp'   ;  
        testProductDispenser.IsActive = true; 
        insert testProductDispenser; 
 
        Id thepricebookId = Test.getStandardPricebookId(); 
    
        PricebookEntry PEDispenser = new PricebookEntry(); 
    
        PEDispenser.Pricebook2Id = thepricebookId; 
        PEDispenser.Product2Id = testProductDispenser.Id; 
        PEDispenser.UseStandardPrice = TRUE; 
        PEDispenser.UnitPrice = 0.00; 
        PEDispenser.IsActive = TRUE; 
        insert PEDispenser;  
}   
}

there are ID's in the pricebook and product and existing entries look just like what I have in code? 
Im going to drop bact to the old merthod if i cant get this figured out (seealldata) 
Scratching my head on this one.  Want to find accounts whose owner is different than its parent account. 

throws a parsing syntax  error  when i compare the 2 fields, although i can compare  them individualy..
  
Query works fine without the Where clause, just wahay too many returns to efficiently process them.

Select  Id,  OwnerId , Parent.OwnerId  From Account 
where   OwnerId  !=  Parent.OwnerId  
I am calling standard email page from a custom object (related to the Case)  and trying to get the return to go back to the Case. This works OK in standard ui and in the console if you complete the dialog, but if you cancel in the Email  it does not return to the case in the console, but does in standard ui..   The console seems to just ignore the retURL on "cancel" of the email page and goes back to the prior tab..   

Controller: 
   public PageReference saveAllAndEmail() { 
       saveAll(); 
        //returns the standard Email ui, the retURL points back to the case when that is done..  
        PageReference pageRef = new PageReference('/_ui/core/email/author/EmailAuthor?retURL=%2F' + pageCase.Id + '&rtype=003&p3_lkid=' + pageCase.Id + '&p2_lkid='  + MyContactId );
        pageRef.setRedirect(true);
        return pageRef;  } 

page: 

 <apex:commandButton action="{!saveAllAndEmail}" value="Save And Email" reRender="foo"/>





 
so I have a complex page -  multiple tabs,  custom grid/table styled interface.   Navigation is tricky, and the business team gets freaked out if any of it changes..   It also runs in both the Service Console and in the standard interface..  

There is a product column in the table, and it needs to open a link to the product object in a new window when you click on it.  

To do this, I used an outputlink value=  to get there and it worked well in standard SF but not so well in the Service Console. 

Reading thru this forum - I switched to an outputlink using an onclick window.open. Now both paths work (standard and service console), but there are other differences . 

The most annoying..  the original page has 2 tabs (add & edit) and using ouputlink value=  when on the 2nd tab, when you go back to the original page it is the same place where you were when you clicked the link, but using window.open it goes back to the goes back to the default view of first tab having focus (not the 2nd..)  

 

So here are my 2 outputlinks -    

<apex:outputlink value="MYURL" target="_blank">{!r.caseProduct.Product__r.ProductCode}</apex:outputlink> 

<apex:outputlink onclick="window.open('MYURL', '_blank' )">{!r.caseProduct.Product__r.ProductCode}</apex:outputlink>                                

why does the starting point change when i use the window.open versus the value=  method?  

any ideas on how to get around this?  




I have a visualforce page, with a table of products, and a dropdown to allow the UOM (unit of measure) to be set. Some products can only be ordered in EACH, some in either EACH or CASE. The checkbox on the Product record: Full_Case_OK__c indicates this.

So, I added a "rendered" to the selectOption to only allow the correct UOM to show up in the optionlist..

<apex:pageBlockTable id="caseProductsTable" value="{!caseProductList}" var="r" rendered="{!caseProductList.size > 0}">   
...
some other columns 
...
<apex:column>
<apex:facet name="header">
<apex:outputPanel >
... some stuff for sorting options, etc.. 
</apex:outputPanel>
</apex:facet> 

<apex:selectList value="{!r.caseProduct.Quantity_UOM__c}"  size="1" rendered="{!NOT(r.disabled)}">

<apex:selectOption itemLabel="Each" itemValue="Each"/>
<apex:selectOption itemLabel="Case" itemValue="Case" rendered="{r.caseProduct.Product__r.Full_Case_OK__c}"/>   

</apex:selectList> 
</apex:column>
...
some more columns 
...
</apex:pageBlockTable>

Issue is that the list of options gets tied to the first product in the table, not generated for each product as I expected. 

Is there another way i should handle a variable select list?    any suggestions? 
Kind of a simple issue (i think). I have an Apex Class that i want to build a multi-column array to use later. 

something along the line of:  

List<Id, string, double> 3ColumnList = new List<Id, string, double>(); 

This is not legal since the list wants a single type..  How would one handle an internal table or array like this in Apex? 
 
Im trying to get some processing out of the loop and  handle it in a more bulkified manner. I dont have an object that matches the array description although i guess I could "borrow" an existing object type..  Seems like a hack to do that though..   



 
Seems our Apex test classes are being automaticly run every night (in dev sandbox). I cant seen to figure out how this gets scheduled?  Happens at the same time, so it appears to be automated, but doesnt appear to be a job doing it..  anyone have any ideas?    
Looking in a calc heavy apex class i inherited.  Probably a newbie question but.. I see this form alot in the class: 

SumCurrentSalesValueB = SumCurrentSalesValueB + (line.Current_Sales_Value__c != null ? Integer.ValueOf(line.Current_Sales_Value__c):0);  

 I assume the use of  "Line.Current_Sales_Value__c != null ?"  is basicly a test with the ":0)" the replacement value if true?  Seems to do that.  

I looked high and low thru the Apex doc - can anyoue point me to the  correct reference for this..  
 
Hi all - 

I bring in records thru integration layer, and wanted to know if there is a way to improve the time it takes them to be available via global search? 

Our CSRs are getting slowed down because they have to wait 5-10 mins after a case is created via the integration  before they can search for it by the custom "order number" field.  The field is both part of the case subject as well as a separate field on the case object.  

These cases do eventually show up in the gloabl search so it is working  - it just takes some time..   



 
So i have a need to develop a test class, and it requires i create some opportunities and lines. I have others where we use SeeAllData, but since this was a new process i wanted to try and get around that.. 

on the pricebookentry i am getting error  - 
15:23:46:000 FATAL_ERROR Class.opp_test.ExpectToTest: line 21, column 1  (which points to insert of PricebookEntry
15:23:46:113 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error:  FIELD_INTEGRITY_EXCEPTION, field integrity exception: []
Thats it for the FIELD_INTEGRITY_EXCEPTION - no other hints.. 


Here is a simple test that throws the error 

@isTest 
public class opp_test {
    
static testMethod void ExpectToTest() { 
    
        //Create test product: 
        Product2 testProductDispenser = new Product2(); 
        testProductDispenser.name = 'testDispenser'; 
        testProductDispenser.ProductCode = 'adisp'   ;  
        testProductDispenser.IsActive = true; 
        insert testProductDispenser; 
 
        Id thepricebookId = Test.getStandardPricebookId(); 
    
        PricebookEntry PEDispenser = new PricebookEntry(); 
    
        PEDispenser.Pricebook2Id = thepricebookId; 
        PEDispenser.Product2Id = testProductDispenser.Id; 
        PEDispenser.UseStandardPrice = TRUE; 
        PEDispenser.UnitPrice = 0.00; 
        PEDispenser.IsActive = TRUE; 
        insert PEDispenser;  
}   
}

there are ID's in the pricebook and product and existing entries look just like what I have in code? 
Im going to drop bact to the old merthod if i cant get this figured out (seealldata) 
Scratching my head on this one.  Want to find accounts whose owner is different than its parent account. 

throws a parsing syntax  error  when i compare the 2 fields, although i can compare  them individualy..
  
Query works fine without the Where clause, just wahay too many returns to efficiently process them.

Select  Id,  OwnerId , Parent.OwnerId  From Account 
where   OwnerId  !=  Parent.OwnerId  
so I have a complex page -  multiple tabs,  custom grid/table styled interface.   Navigation is tricky, and the business team gets freaked out if any of it changes..   It also runs in both the Service Console and in the standard interface..  

There is a product column in the table, and it needs to open a link to the product object in a new window when you click on it.  

To do this, I used an outputlink value=  to get there and it worked well in standard SF but not so well in the Service Console. 

Reading thru this forum - I switched to an outputlink using an onclick window.open. Now both paths work (standard and service console), but there are other differences . 

The most annoying..  the original page has 2 tabs (add & edit) and using ouputlink value=  when on the 2nd tab, when you go back to the original page it is the same place where you were when you clicked the link, but using window.open it goes back to the goes back to the default view of first tab having focus (not the 2nd..)  

 

So here are my 2 outputlinks -    

<apex:outputlink value="MYURL" target="_blank">{!r.caseProduct.Product__r.ProductCode}</apex:outputlink> 

<apex:outputlink onclick="window.open('MYURL', '_blank' )">{!r.caseProduct.Product__r.ProductCode}</apex:outputlink>                                

why does the starting point change when i use the window.open versus the value=  method?  

any ideas on how to get around this?  




Kind of a simple issue (i think). I have an Apex Class that i want to build a multi-column array to use later. 

something along the line of:  

List<Id, string, double> 3ColumnList = new List<Id, string, double>(); 

This is not legal since the list wants a single type..  How would one handle an internal table or array like this in Apex? 
 
Im trying to get some processing out of the loop and  handle it in a more bulkified manner. I dont have an object that matches the array description although i guess I could "borrow" an existing object type..  Seems like a hack to do that though..   



 
Seems our Apex test classes are being automaticly run every night (in dev sandbox). I cant seen to figure out how this gets scheduled?  Happens at the same time, so it appears to be automated, but doesnt appear to be a job doing it..  anyone have any ideas?    
Hello,

My company is looking to add a scheduling section into our SalesForce implentation and so I'm looking for some recommendations of add-ons that might fit our use-case and avoid custom development. 

Here's what we need:
  • Sales reps need to be able to easily create their weekly availablity. For some reps this means creating a repeating schedule that does not need to be updated regularly, for other reps this schedule will change weekly and they need to be able to easily update their availablity every week.
  • Once a rep creates their weekly schedule they should have a view that let's them easily see which blocks of time are available and which are already booked. They should also be able to book appointments into any available blocks.
  • Our call center should be able to view a global view that shows all available blocks so they can schedules inbound callers for appointments
  • The call center will need a way to filter the calendar so that they can find available appointments based on critera such as: Date, Time of day, Gender of rep, name of rep, and location.
Two possible contenders I have already idenified are Appointment Plus and Sumo, does anyone have any experience with these add-ons? Additionally any recommendations of other add-ons we haven't identifed would be great. Lastly I'd be interested in knowing what kind of development effort would be involved to modify the existing scheduling features that come out of the box to suit our needs.
Looking in a calc heavy apex class i inherited.  Probably a newbie question but.. I see this form alot in the class: 

SumCurrentSalesValueB = SumCurrentSalesValueB + (line.Current_Sales_Value__c != null ? Integer.ValueOf(line.Current_Sales_Value__c):0);  

 I assume the use of  "Line.Current_Sales_Value__c != null ?"  is basicly a test with the ":0)" the replacement value if true?  Seems to do that.  

I looked high and low thru the Apex doc - can anyoue point me to the  correct reference for this..