• Alba Azcona
  • NEWBIE
  • 233 Points
  • Member since 2015

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 73
    Replies
I have a static class variable called numRemain, which is initially set to some positive value and trigger decrements its value by 1 for each recursive call. Because my after-insert trigger has the part where each case in Trigger.New is updated, it fires Trigger in recursive manner. My queston is "after trigger is called more than once, is numRemain reset to its initial value or is numRemain decremented after each recursion?"
The reason why I ask this question is that I keep getting Apex Timeout error even though I have the conditional statement if(numRemain>0) in the beginning of the apex trigger.
Thank you. 
I am just starting through the Lightning Components Basics Trailhead.  I have a few questions.  The first is, how do you pass data or get data to a component?  For example, I am working on the Handle Actions And Conrollers module.  I built the 'campingListItem Component and Controller but there is no data that shows when I launch the component.  Maybe I'm not there yet but I'm confused how you pass data to the component.

The second question I have is specifically about the challenge for the 'Handle Actions and Controllers" Module.  I completed it successfully, but I'm not sure if what I have is the most efficent way to go about it.  I am pasting my controller below.  The first variable is pulling in the button so I can disable it (btnClicked)  The second variable is getting the item and updating fields form that item.

Thank you!!!

Fred

var btnClicked = event.getSource();
        btnClicked.set("v.disabled",true);
 var a = component.get("v.item",true);
         a.Packed__c = true;
         component.set("v.item",a);
I want to call an apex method from a custom Button (Url type button) with some merge fields.
With lightning rolling out, I dont want to use Javascript button anymore. 

My Use-Case is to call an Apex static method which takes record id as parameter. 
Public static void methodToBeCalled(ID recordID) {
   //My Code Logic Here
}
From some blogs, I found that i can use REST APIs to do this, But no idea on how to implement it.
So, Please provide me any code sample or any pointers, I appreciate any help.
 

Hi all:

I am a newbie to Salesforce and gradually getting the hang of it. One thing that I need to make use of soon is Batch Apex

We have got several opportunities on which we need to make calls to third party API to get back some result. This already works for individual Opportunity where we have got a button and with the click of the button, it calls the third party API for that Opportunity.

However we have now got a requirement where we can select several Opportunities together to make calls to third party API and get back the result for each. Batch Apex sounds like a good way to solve this problem. However being new to the Salesforce paltform, wondering what's the best way to achieve this.

Logically the steps are:

1. Select Opportunities which you need to process. May be build a collection of those Opprtunities.
2. Execute Batch Apex with the collection of Opportunities that have been built.

Just wondering what's the technical way to achieve this. In the start method of Batch Apex, I need to build the object scope with the selected Opportunities. How to achieve that?

Also when I am done with writing the Batch Apex class, how do I trigger the following:
Database.executeBatch(new <Class name>(), batch size);

to execute my Batch Apex?

Any help will be much appreciated.

Thanks
Anindya

I am getting this error: An internal server error has occurred Error ... when I am adding a Lightning Component to a community page in the Community Builder, with Napili template. 

The lightning component has a child component that includes some lightning:cards components. If I remove the lightning:card components, the lightning component can be added to the page.

Is lightning:card supported in community pages?
In the Winter 16 release, is it now possible to trigger process builder or workflows from LightningConnect external objects?
Hello,
I have a component MyVFpage with namespace prefix MyVFpage_SF I am trying to create a new VF page for my Projects tab, but everytime I create my VF page and save the page it turns MyVFpage into myvfpage and tells me I need to create the component myvfpage. Why?

code:
<apex:page standardController="Projects" docType="html-5.0" showHeader="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false">
    <c:MyVFpage />
</apex:page>

once saved returns:

Error: Component c:myvfpage does not exist[Quick Fix] Create Component myvfpage


Is there something I am missing? 
 
Friends,

We are looking for best way to take backup of Metadata (Changes to Std obj, Custom objects, Apex code, Profiles, etc).

We heard about below options:
1) Force.com IDE on Eclipse
2) Force.com ANT Migration Tool
3) Snapshot (not sure if this is paid)
4) Change Sets

What is standard approach to take backup to a folder on drive? We are looking for something where we can restore a specific object if need be.

Will we require to go for GITHUB along with one of the above 4 options.

Appreciate if someone can share from their experience and provide details on this.

Cheers,
Hi,

I have installed dreamhouseapp in my organization, which is namespaced, following the instructions here http://www.dreamhouseapp.io/. Lightning Components reference fields without using a namespace. I have had to add my own namespace to those references so that it works. Is this expected?
Hi,

As far as I know, standalone apps are accesible through the next URL:

https://instance.lightning.force.com/[namespace]/[app_name].app

Then, if I were to use a standalone app, I could write some code or configuration that redirects to that URL, as stated here: https://developer.salesforce.com/forums/?id=906F0000000BNQUIA4

I am wondering if is there any other standard way of exposing standalone apps (.app) in Salesforce? (I am considering classic, Lightning Experience and Salesforce1).

Thanks.
Hi

I have developed a Lightning Component which includes some css which I have stored in a static resource in the next way:

<ltng:require styles="/resource/HelloWorld/HelloWorld.css" />

If I visualize this component from SF1 navigation menu, the css is correctly loaded and the component correctly visualized. I have included the component as well in a standalone app in the next way:

<aura:application >
    <c:HelloWorld />
</aura:application>

When I try to visualize the app (accessing https://aazcona-dev-ed.lightning.force.com/aazcona/HelloWorldApp.app) an error is shown to me: Uncaught TypeError: this.get(...).querySelectorAll is not a function

I have checked that the problem is the ltng:require tag, as if I comment it out, the standalone app works like a charm.

Any ideas?

Thanks

 
Does anybody know how can we automate the default workflow user creation in an org (which is under "Process Automation Settings")? We have been looking at metadata / tooling API, that we usually call from ant scripts for configuring the org in the way we want, but we can't find anything there for assigning such user.

Thanks!
If I assign a profile to a user, with field level security specified for a concrete field, and I assign a permission set to the same user, with a different permission level specified for that field, which one takes precedence? the most restrictive? Thanks
I have a static class variable called numRemain, which is initially set to some positive value and trigger decrements its value by 1 for each recursive call. Because my after-insert trigger has the part where each case in Trigger.New is updated, it fires Trigger in recursive manner. My queston is "after trigger is called more than once, is numRemain reset to its initial value or is numRemain decremented after each recursion?"
The reason why I ask this question is that I keep getting Apex Timeout error even though I have the conditional statement if(numRemain>0) in the beginning of the apex trigger.
Thank you. 
Hi,
I'm trying to create  a lightning component to override the new button of a custom object 'C' whoch is child of two diferent objects 'A' and 'B'. The reason I need to override it because 'C' has two record types 'a' and 'b' and when user seect 'new' from the related list , it takes them to a page for recordtype selection. What I need is when they are on record page of A, it should directly take them to page layout of recordtype 'a' when they click on New button and similar for record page B.
    I have already tried using lightning quick action (only customization) required and that does the job perfectly but I cant place it on related list, it has to be placed on top right of the lightning record page.
   I have put together some code for the component but there is something strange. While overriding, even if I select the checkbox 'Skip recordtype selection', it still takes me to the page. as anyone faced this or knws a solution for this? That would be really helpful.
I am just starting through the Lightning Components Basics Trailhead.  I have a few questions.  The first is, how do you pass data or get data to a component?  For example, I am working on the Handle Actions And Conrollers module.  I built the 'campingListItem Component and Controller but there is no data that shows when I launch the component.  Maybe I'm not there yet but I'm confused how you pass data to the component.

The second question I have is specifically about the challenge for the 'Handle Actions and Controllers" Module.  I completed it successfully, but I'm not sure if what I have is the most efficent way to go about it.  I am pasting my controller below.  The first variable is pulling in the button so I can disable it (btnClicked)  The second variable is getting the item and updating fields form that item.

Thank you!!!

Fred

var btnClicked = event.getSource();
        btnClicked.set("v.disabled",true);
 var a = component.get("v.item",true);
         a.Packed__c = true;
         component.set("v.item",a);
I've a Custom Object whose NEW and EDIT Standard Buttons/Links have been overridden with a Visualforce Page.

This Custom Object also has couple of Record Types on it.

I've added a Custom URL Button for each RecordType so as to quickly execute the override VF page by skipping the Record Type selection page.

Now, this works fine in Classic, and it has worked fine in Lightning Experience till now. But now, I've noticed that the URL Button is not passing the custom parameters, which I've set in URL Button.

My URL Button code is this:
{!URLFOR('/'+ $ObjectType.Custom_OBject_A__c +'/e' , null, [RecordType=URLENCODE('01290000000c821'), parentid=Parent_Object__c.Id], false)}



And this button has been created on Custom_Object_A__c.

So when this button is called from the Custom Object A's related list on Parent Object Detail View, the Visualforce Page set on the EDIT link as override opens and with custom Apex controller code, I read the parentid querystring parameter and populate the target field in the vf page.

This parentid parameter is getting passed in Classic but not in Lightning Experience.
Hi All.
 I have a workflow which updates Field A to True and I have process Builder to execute when FieldA is true on Same Object .
 I have checked re-evaluate workflow checkbox but still process builder is not executig please let me know if i am doing anything wrong ?

Regards,
Rajesh
Hi Everyone,

I'm new to Apex and I'm trying to schedule a class that I've written.  I'm going into Setup > Develop > Apex Classes and clicking on the "Schedule Apex button.  When I select my class I get an error that says "You must select an Apex class that implements the Schedulable interface."  The thing is, I thought I followed the develper documentation correctly in setting this up.  I can't figure out why it's giving me this error.  Can anyone offer some assistance?  Here's my class:
global class autoRenewalOpps Implements Schedulable {
    global void execute(SchedulableContext sc) {
    	aRopps();   
    }
    public void aRopps() {
        //Create list of renewal opportunities to close
    	List<Opportunity> renewalOpps = [SELECT StageName, Type
			FROM Opportunity
			WHERE RecordTypeId = '012S00000000klc'
			AND IsClosed = False
			AND Type = 'Renewal'
			AND CloseDate < LAST_N_WEEKS:2
			AND LastActivityDate < LAST_N_WEEKS:2
			];
        
    	//Loop through opportunities changing the type and stage
    	for (Opportunity opp : renewalOpps) {
        	opp.type = 'Auto-Renewal';
        	opp.StageName = 'Closed Won';
		}
        
        //Update the opportunities
        update renewalOpps;
    }
}
And here's the error I get when trying to schedule it:
User-added image

Thanks for any help.
 
I want to call an apex method from a custom Button (Url type button) with some merge fields.
With lightning rolling out, I dont want to use Javascript button anymore. 

My Use-Case is to call an Apex static method which takes record id as parameter. 
Public static void methodToBeCalled(ID recordID) {
   //My Code Logic Here
}
From some blogs, I found that i can use REST APIs to do this, But no idea on how to implement it.
So, Please provide me any code sample or any pointers, I appreciate any help.
 
There is custom button created (it redirects to VF on click of it) & placed on standard opportunity page layout.
 There is inline VF page present on same standard opportunity page layout.
 
Is it possible to control the appearance of this custom button (Show/Hide) based on the some fields value of opportunity records via JS or any approach without creating multiple page layouts or overriding std opportunity page layout with Vf page?
 
I looked into some of blogs but those solution will work only for the buttons present inside inline VF page or on overriding std page layouts
Ex : http://blogatsalesforce.blogspot.in/2015/04/enable-disable-buttons-on-standard.html
 
 
  • April 29, 2017
  • Like
  • 0
User gets, "You have sent us an Illegal URL or an improperly formatted request." error when clicking on three different visualforce buttons.  When I log in as the users all three buttons work as expected.  Why would the user get those errors, but I do not?  The user deleted cookies, cache and restarted yesterday when it first occured.  That fixed the error.  Coming back in today the error is occuring again.  Thanks for any ideas.  
User-added image
I want to show the information I get from the for but I do not know how to display it on a visualforce page, thank you for your prompt response and help friends. 

    public void VisualDatos(){
               for (Producto_de_Promociones__c ProdProm : [SELECT Promocion__r.Id, Promocion__r.Name, Promocion__r.Vigencia_Desde__c, Promocion__r.Vigencia_Hasta__c, 
                                        Promocion__r.Canal__c, NOMBRE_DE_PRODUCTO_BASE__C, ESTATUS__C, NOMBRE_PRODUCTO_PROMOCIONAL__C, PROMOCION__C, Name,     Cajas_de_promocion__c, Rango__c,
                                        Nombre_de_producto_Base__r.Name, Nombre_de_producto_Base__r.ProductCode
                                        FROM Producto_de_Promociones__c
                                        Where  ESTATUS__C = 'Activo'
                                        And Promocion__r.Vigencia_Desde__c <= TODAY and Promocion__r.Vigencia_Hasta__c >= TODAY]){
                                            
           for(OpportunityLineItem op : [Select id, name, PricebookEntryId, Quantity, Producto_Promocional__c From OpportunityLineItem where OpportunityId = '00641000009Pquj' and Productcode = :ProdProm.Nombre_de_producto_Base__r.ProductCode]){
                        OpportunityLineItem  rLine = new OpportunityLineItem (
                           Producto_Promocional__c = true,
                        TotalPrice = Decimal.valueOf('00.00'),
                        Quantity = ProdProm.Rango__c*op.Quantity,
                        PriceBookEntryId = op.PricebookEntryId,
                        OpportunityID = '00641000009Pquj');
                        Insert rLine;
           }
       }//Fin del For producto de PRomociones        

    }
Hello everyone,

I've got a Classe named 'ManageUser". In this class, a method extract all opportunities for users.
I've got an other Class named 'ManageFAST". In this class, I need to copy the values of the Opportunity List.
And I don't know how to do it.
Here is my code.

ManageUser : 
public Boolean loadOpportunityList(Date quarter){
		String query = ManageOpp.OPP_QUERY;
		query += ' WHERE Owner.Id =: id';
		if(quarter != null){
			query += ' AND CloseDate >=: quarter';
		}
		List<Opportunity> oppList = Database.query(query);
		if(oppList.isEmpty()){
			return false;
		}
		myOppList = new List<ManageOpp>();
		for(Opportunity opp : oppList){
			myOppList.add(new ManageOpp(opp));
		}
		return true;
	}


	public Boolean loadOpportunityList(){
		return loadOpportunityList(null);
	}

public List<ManageOpp> getOpportunityList(){
		return this.myOppList;
	}

ManageFAST : 
public List<FAST__c> 						fast{get;set;}
	private List<FAST_OPP__c> 					fastOppList;
	private List<ManageOpp>						manageOppList{get;set;}
	private manageUser 							oppUser;
	public Date 								quarter;

public ManageFAST() {
		fast = new List<FAST__c>();
		oppUser = new ManageUser();
	}

	public void loadFAST(){
		List<FAST__c> fast = new List<FAST__c>();
		fast = [SELECT Id, Sales_ID__c, Forecast_Manager_ID__c, Quarter_Date__c, Commit_Manager__c, Transactionnal_Amount_Forecast_Exit__c, Transactionnal_Amount_Optimistic__c, Transactionnal_Amount_Pessimistic__c FROM FAST__c];
	}

public void initFASTOppList(){
		oppUser.load(UserInfo.getUserId());
		//quarter = Date.newInstance(1960, 2, 17);
		oppUser.loadOpportunityList(quarter);
		

		for(FAST_OPP__c fo : oppUser.getOpportunityList())
		{
		}
 





	}

Thanks