• lifewithryan
  • NEWBIE
  • 85 Points
  • Member since 2014
  • Salesforce Practice Lead
  • Flexion, Inc.


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 17
    Replies
Is it possible to replace standard salesforce layouts with lightning component (like a visualforce page with standard conroller).

Our client would like to use SKUID to make user interface more friendly and be able to edit records right from the list view. But salesforce specialist involved in project implementation said that it is preferable to use lightning.

I could not find any confirmation in documentation that this is possible to replace standard detail or list layout with somethid build on Linghtning.

Guys, Can somebody confirm that this is possible?
Hi developers,

In this opportunity my question comes from about the test classes and coverage from this to apex classes

I have two classes, one is Apex Class and the other is the Test Class. My question is why my Apex Class is 0% coverage??? Run the test class and this finish OK. Please guide me how can I for coverage the code in my Apex Class?

I put the code from the two classes.

Thanks for the support 

APEX CLASS 

public class contactExtension {

    private final Contact contact;
    private string idContact;
    private final Moneda__c monedabob;
    private string idMonedabob;
    private final Moneda__c monedausd;
    private string idMonedausd;
    public decimal x {get;set;}
    public decimal totalUsd {get;set;}

    public contactExtension(ApexPages.StandardController contactController) {
       this.contact = (Contact)contactController.getRecord();
       idContact = contact.id;
    }
         
    public List<Beneficio__c> getBeneficiosBob()
    {
        Moneda__c monedabob = [select Name from Moneda__c where Moneda__c.name = 'Bolivianos'];
        idMonedabob = monedabob.id;
        x = 0;
        for (Beneficio__c ben : [select monto_estimado__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob]){
            if (ben.monto_estimado__c == null){
                ben.monto_estimado__c = 0;
            }
            x = ben.monto_estimado__c + x;
        }
               
        return [select Catalogo_Beneficio__c, Name, Moneda__c, monto_estimado__c, proposito__c,fecha_entrega__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob];
    }
             
    public List<Beneficio__c> getBeneficiosUsd()
    {
        Moneda__c monedaUsd = [select Name from Moneda__c where Moneda__c.name = 'Dolares'];
        idMonedausd = monedausd.id;
       
        totalUsd = 0;
        for (Beneficio__c ben : [select monto_dolares__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedausd]){
            totalUsd = ben.monto_dolares__c + totalUsd;
        }       
        return [select Catalogo_Beneficio__c, Name, Moneda__c, monto_dolares__c, proposito__c,fecha_entrega__c  from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedausd];
    }
}

TEST CLASS

@isTest public class ContactTest {          
        testMethod private static void getBeneficiosBob()
        {
            Account a= new Account(Name = 'Fundacion Inti Raymi');
            insert a;
           
            Operacion__c operacion= new Operacion__c(Name = 'Kori Chaca');
            insert operacion;
           
            Departamento__c departamento = new Departamento__c(Name = 'Oruro');
            insert departamento;
           
            Provincia__c provincia= new Provincia__c(Name = 'Cercado', Departamento__c = departamento.id);
            insert provincia;
           
            Municipio__c municipio= new Municipio__c(Name = 'Caracollo', Provincia__c = provincia.id);
            insert municipio;
           
            Comunidad__c comunidad= new Comunidad__c(Name = 'Iroco');
            insert comunidad;           
           
            Organizacion__c organizacion= new Organizacion__c (Name = 'Iroco');
            insert organizacion;
                                               
            Moneda__c monedabob = new Moneda__c(Name = 'Bolivianos', sigla__c = 'BOB');
            insert monedabob;
           
            Contact contacto = new Contact(Firstname= 'Alejandra', Lastname = 'Helguero', Carnet_Identidad__c = '22334455', Operacion__c = operacion.id, Departamento__c = departamento.id, Provincia__c = provincia.id, Municipio__c = municipio.id, Comunidad__c = comunidad.id, Organizacion__c = organizacion.id);
            insert contacto;

            Categoria_beneficio__c categoria = new Categoria_beneficio__c(Name = 'Produccion Ganadera');
            insert categoria;
           
            Subcategoria_beneficio__c subcategoria = new Subcategoria_beneficio__c(Name = 'Ganaderos', Categoria_Beneficio__c = categoria.id);
            insert subcategoria;
           
            Catalogo_beneficios__c tipo_beneficio= new Catalogo_beneficios__c(Name= 'Sanidad Animal', Nombre__c = 'Sanidad Animal', Categoria_Producto__c = categoria.id, Subcategoria_producto__c = subcategoria.id);
            insert tipo_beneficio;           
           
            for(Integer i = 0; i < 20; i++){
                Beneficio__c b = new Beneficio__c(Contacto__c = contacto.id, Moneda__c = monedabob.id, monto_estimado__c = 100.56, Catalogo_Beneficio__c = tipo_beneficio.id, fecha_entrega__c = Date.newInstance(2014, 06 ,20));
                insert b;
            }           
           
            Moneda__c monedabobS = [select Name from Moneda__c where Moneda__c.name = 'Bolivianos'];
            String idMonedabob = monedabobS.id;
           
            Decimal x = 0;
            for (Beneficio__c ben : [select monto_estimado__c from Beneficio__c where Contacto__c = :contacto.id and Moneda__c = :monedabob.id]){
                if (ben.monto_estimado__c == null){
                    x = ben.monto_estimado__c + x;
                }
            }
            Beneficio__c[] beneficios = [select Catalogo_Beneficio__c, Name, Moneda__c, monto_estimado__c, proposito__c,fecha_entrega__c from Beneficio__c where Contacto__c = :contacto.id and Moneda__c = :monedabob.id];
            System.assert(beneficios != null, 'Retorna valores');
        }
}
I ran across something interesting today and was wondering if anyone has seen similar behavior.

For a current project I have some custom settings that is used to set a configured unit price (hourly cost) on a provided service.  I also have a custom Request object and a custom Request Item object. Each Request is made of up one or more Request Items that may incur multiple costs based on work performed. These items are rolled up to the parent and then a trigger is used to calculate the cost of services rendered and from that an invoice is generated.

The trigger retrieves these base costs from the custom settings. The kicker here is that the custom settings has those field types set to Currency.  When I retrieve them and subusequently use them in a mathematical equation such as: Total_Admin_Hours__c * settings.Admin_Hourly_Cost__c, I get an exception stating that the arguments are illegal.

I verified that it was indeed the settings that it was choking on by hard-coding an arbitrary decimal value and it worked. After many head-scratches, I finally changed the custom settings field types to Number instead and everything worked as expected.  

Is there something going on inside the big black box that I'm not understanding fully or did I find some sort of "bug/feature?"

Incidentally, I wrote a unit test to verify that indeed it didn't like Currency. Something like:
@isTest static void test_decimal_multiplication() {
     RequestSettings__c settings = TestUtility.createSettings(null); //nothing to see here ;)
     Decimal total = 1 * settings.Admin_Cost__c; //Admin_Cost__c is set to 1.00 in custom settings
     System.assertEquals(1.00, total); <---- this actually passes if I remember correctly

--BUT--

  RequestSettings__c retrievedSettings = RequestSettings__c.getInstance();
  System.assertNotEquals(null, retrievedSettings.Admin_Cost__c);
  System.assertEquals(1.00, retrievedSettings.Admin_Cost__c);
  total = 1 * retrievedSettings.Admin_Cost__c;
  System.assertEquals(1.00, total); <--- fails if field type is Currency, passes when Number
}


Thougths? I'm not ruling out the possibility that I mucked with something else and magically it worked, but it definitely wasn't liking the CURRENCY setting...I will probably try to reproduce this in a dev org somewhere just to clear my head, but was hoping maybe someone had a nugget for me as to why it would fail if Currency is supposed to be a Decimal anyway...
I am new to Salesforce1 development so kindly excuse if the query seems trivial. I have a requirement to build a 2 page registration app for our sales team which they would be using on there IPADS. The first page will take event details and 2nd page will take details of people registring. This data will be saved in Salesforce custom object which would trigger lead creation. Also the app should not require the Sales team to login. 

Is it possible to build such apps using Lightning1? If not can someone point me to correct direction.

Thanks,
Vandana
We are trying to execute a VB Script in salesforce but we only get an email from salesforce with the message:
An unexpected error occurred. Please include this ErrorId if you contact support: 1112784119-827309 (313661600)

We are trying to select activities from account and related to costum object
I'm trying to render an invoice for a user while at the same time attaching it to the applicable records in our database.
My current structure for the method is as follows:
public PageReference processSelection(){
        List<ID> batchList = new List<ID>();
                
        containerList = new List<ContractWrapper>();
        updateList = new List<MG_Contract_Holder__c>();
        MG_Contract_Holder__c updCon = new MG_Contract_Holder__c();
        if(tContractList.size() > 0){
        	containerList.addall(tContractList);
        	}
        if(twcContractList.size() > 0){
        	containerList.addall(twcContractList);
        	}
        if(gapContractList.size() > 0){
        	containerList.addall(gapContractList);
        	}
        if(mppContractList.size() > 0){
        	containerList.addall(mppContractList);
        	}
        if(wsContractList.size() > 0){
        	containerList.addall(wsContractList);
        	}
        if(upppcContractList.size() > 0){
        	containerList.addall(upppcContractList);
        	}
        if(upppContractList.size() > 0){
        	containerList.addall(upppContractList);
        	}
        if(uppContractList.size() > 0){
        	containerList.addall(uppContractList);
        	}
        if(sealContractList.size() > 0){
        	containerList.addall(sealContractList);
        	}
        if(pdrContractList.size() > 0){
        	containerList.addall(pdrContractList);
        	}
        if(mpppcContractList.size() > 0){
        	containerList.addall(mpppcContractList);
        	}
        if(mpppContractList.size() > 0){
        	containerList.addall(mpppContractList);
        	}
        if(keyContractList.size() > 0){
        	containerList.addall(keyContractList);
        	}
        if(keyplContractList.size() > 0){
        	containerList.addall(keyplContractList);
        	}
        if(etchContractList.size() > 0){
        	containerList.addall(etchContractList);
        	}
        		
        Integer selectedCount2 = 0;
		
		for(contractWrapper sub : containerList){
            if(!sub.selected){
                continue;
                }
            if(sub.selected == true){
                selectedCount2++;
                }
            if(selectedCount2 > 0){
                subNum = sub.subNum;
                subVin = sub.subVin;
                system.debug('subNum: ' + subNum);
                system.debug('subVin: ' + subVin);
                updCon = [SELECT Contract_Status__c, Batch__c FROM MG_Contract_Holder__c WHERE Contract_Number__c =:subNum AND Vin_Number__c =:subVin];
                batchList.add(updCon.Batch__c);
                system.debug('updCon');
                updCon.Contract_Status__c = 'Submitted - Pending Payment';
                updateList.add(updCon);
                }
                }
            if(selectedCount2 == 0){
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'You must select at least one record to submit before proceeding.'));
                return null;
                }
                update updateList;
                
                Set<ID> myset = new Set<ID>();
				List<ID> result = new List<ID>();
				myset.addAll(batchList);
				result.addAll(myset);
    			PageReference page = new PageReference('/apex/pages/CM_RemitReport');                
                page.setRedirect(true);
    			for(integer i = 0; i < result.size(); i++){
    				Attachment attach = new Attachment();
        			Blob body;
        			body = page.getContent();
        			attach.Body = body;
        			attach.Name = 'RemitRegister.pdf';
        			attach.ParentId = result[i];
        			insert attach;
        			}
    			return page;
                }
However, I hit an error on the line:
body = page.getContent();
which is: Exception common.page.PageInterruptException, Cyclical server-side forwards detected
and I'm having trouble resolving it.
Any suggestions would be appreciated.
Greeting:

We have been on a project for a client with a low budget and we want to roll out existing and free salesforce features to accomodate with one of the requirements.

The client would like to expose their change management app to each and every one of their customers, and allow them to create and update records in their (our client) system.

The client would prefer not to rollout customer community.
We are to leverage either Force.com Sites or Site.com Sites (force.com is our first choice for site.com with require external Domain or active Community) to achieve this.

At this point, I would like to specify this to my first force.com/site.com implementation and would like inputs/recommendations.

Request: How does one restrict public access to a Force.com Site and only allows selective users?

Fact the client's org is new (therefore portals are not feature options)
Assume IP restriction will not apply as a security layer.
Assume Customer data is sensitive and can only be viewed by customers and each customer can only view their own data. 

Can the above request be satisfied at low cost with a combinaiton free features or licenced features or a combination of both?

Thank you all in advance.
Hello Everyone,
Appreciate if you can answer me yes or No. I have an custom object with field address, city, state and zip(with some additional fields). Can i override object compare to method to compare only these fields and says object is duplicate or not.  Or do I need to create custom wrapper class ?
I am trying to create a custom button on the Opportunity Page to update the stage.  After you click the button you select from the picklist and hit save. I have used similar code for a button on a list view but I am getting an error message:  Error: Unknown property 'OpportunityStandardController.selected'
 
Please help I am new at Visual Force. Thank you Here is my code;

<apex:page standardController="Opportunity" showHeader="true">
        <apex:form>
        <apex:pageBlock title="Opportunity Stage-Update" mode="edit" id="mub1">
            <apex:pageMessages />
            <apex:pageBlockSection id="mus1">
                <apex:inputField value="{!opportunity.stagename}"> id="stagename">
                                    </apex:inputField>
                                               </apex:pageBlockSection>
           <apex:pageBlockButtons location="bottom" id="mubut">
                <apex:commandButton value="Save" action="{!save}" id="butsav"/>
                <apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pageBlock title="Select Stage" id="muselectedlist">
            <apex:pageBlockTable value="{!selected}" var="opp" id="mutab">
                                <apex:column value="{!opp.stagename}" id="oppstage"/>
            </apex:pageBlockTable>
           </apex:pageBlock> </apex:form>
        </apex:page> 
 
 
  • January 26, 2015
  • Like
  • 0
Hi,

I have been trying to send an email by using visual force template, but not got success. I created a component and used it in my VF Template, but when i use it in apex class and try to send email either it gives the error or send mail with no data.

My Controller Class Code:
private void sendEmailNotifications(Map<Id, Store__c> mapRf, EmailTemplate emailTemp) {    	
    	List<Messaging.SingleEmailMessage> mailsToSend = new List<Messaging.SingleEmailMessage>();
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
            
    	for(Id rfId : mapRf.keySet()){
        	Store__c r = mapRf.get(rfId);
        	
        	// fetch list of the uses to whom mails gonna sent
        	List<Id> uIds = new List<Id>();
        	if(mapGrpEmail.containsKey(mapGrpNameRfId.get(rfId))){
        		for(User u : mapGrpEmail.get(mapGrpNameRfId.get(rfId))){
                	uIds.add(u.Id);
                }
        	}
           
            email.setTargetObjectId('005w0000003dyDo');
            String[] toAddresses = new String[] {'abc@xyz.com'}; 
            email.setToAddresses(toAddresses); 
            //email.setWhatId(rfId) ;
			email.setSaveAsActivity(false);
			email.setTemplateId(emailTemp.Id)			
			mailsToSend.add(email);
        }

i am setting userId in setTargetId() method, so if i set Store__c.Id in setWhatId() method it gives me following error:

System.EmailException: SendEmail failed. First exception on row 1; first error: INVALID_FIELD_WHEN_USING_TEMPLATE, When a template is specified the plain text body, html body, subject and charset may not be specified : []

And if i don't set WhatId how i gonna get merged fields to be populated in my template, which is quite annoying. I read somewhere that WhatId supports only When a ContactId is set into setTargetId() but i simply need to UserId.

Here is my template:
 
<messaging:emailTemplate subject="Store - Created" recipientType="User" relatedToType="Store__c">
    <messaging:htmlEmailBody >
        <c:RedFlagComponent rfId="{!relatedTo.Id}" flag="true" /><br/><br/>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>
Here is Componenet:
 
<apex:component controller="RedFlagComponentController" access="global">
    <apex:attribute name="sId" type="Id" description="Id of the store" assignTo="{!storeId}"/>{!isNew}
    
    	<table>
    	<apex:repeat value="{!lstRfs}" var="r">
	    	<apex:outputText rendered="{!isNew}" value="A red flag notification has been raised in {!r.Store__r.Name}, {!r.Address_Concatenated__c }/{!r.External_Reference__c} on {0,date,dd/MM/yyyy}." >
	    		<apex:param value="{!TODAY()}" />
	        </apex:outputText>
	      
	        <br/>
	        <hr/>
		        <tr>
		            <td>Priority: {!r.Priority__c}</td>              
		        </tr>		        
		        <tr>
		            <td>Link to the latest visit: <a href="{!orgUrl}{!r.Photo_Attachments__r[0].Visit__c}" target="_blank">{!r.Photo_Attachments__r[0].Visit__c}</a></td>              
		        </tr>
		        <tr>
		            <td>Link to red flag photos: 
		            	<apex:outputPanel >
		            	<apex:repeat value="{!r.Photo_Attachments__r}" var="p">
		            		<a href="{!orgUrl}{!p.Id}" target="_blank">{!p.Name}</a><br/>
		            	</apex:repeat>
		            	</apex:outputPanel>
		            </td>              
		        </tr>
        </apex:repeat>        
    </table>
    <hr/>
</apex:component>

Any help would be appreciated. Thanks in advance.


Vikram
Hello,

I have a controller below on a VF page off the Opportunity object.  All I am trying to do is pre-populate a custom field (RENEW_Date_Updated__c) with today's date.  When I try to save my VF page, I get the error below.  Does anyone know how I can fix this?  Thanks.

System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
Error is in expression '{!save}' in component <apex:commandButton> in page renewprogupdate: Class.RenewalOppProg.save: line 18, column 1
Class.RenewalOppProg.save: line 18, column 1

 
public class RenewalOppProg{

public List<Opportunity> opps {get; set;}
    private final Opportunity oppty;
    public RenewalOppProg(ApexPages.StandardController myController) {
        opps = new List<Opportunity>();
        oppty = (Opportunity)myController.getrecord();
       }

public Opportunity opp2 = new Opportunity();
    public void OppProg(){
        opp2.RENEW_Date_Updated__c = Date.Today();
        opps.add(opp2);
    }

    public PageReference save() {
    
        update opps;
        {
        PageReference RetPage = new PageReference('/apex/RenewProgView?id=' + opps[0].id);
        RetPage.setRedirect(true);
        return RetPage; 
        }
        }

}


 
Is it possible to replace standard salesforce layouts with lightning component (like a visualforce page with standard conroller).

Our client would like to use SKUID to make user interface more friendly and be able to edit records right from the list view. But salesforce specialist involved in project implementation said that it is preferable to use lightning.

I could not find any confirmation in documentation that this is possible to replace standard detail or list layout with somethid build on Linghtning.

Guys, Can somebody confirm that this is possible?
I ran across something interesting today and was wondering if anyone has seen similar behavior.

For a current project I have some custom settings that is used to set a configured unit price (hourly cost) on a provided service.  I also have a custom Request object and a custom Request Item object. Each Request is made of up one or more Request Items that may incur multiple costs based on work performed. These items are rolled up to the parent and then a trigger is used to calculate the cost of services rendered and from that an invoice is generated.

The trigger retrieves these base costs from the custom settings. The kicker here is that the custom settings has those field types set to Currency.  When I retrieve them and subusequently use them in a mathematical equation such as: Total_Admin_Hours__c * settings.Admin_Hourly_Cost__c, I get an exception stating that the arguments are illegal.

I verified that it was indeed the settings that it was choking on by hard-coding an arbitrary decimal value and it worked. After many head-scratches, I finally changed the custom settings field types to Number instead and everything worked as expected.  

Is there something going on inside the big black box that I'm not understanding fully or did I find some sort of "bug/feature?"

Incidentally, I wrote a unit test to verify that indeed it didn't like Currency. Something like:
@isTest static void test_decimal_multiplication() {
     RequestSettings__c settings = TestUtility.createSettings(null); //nothing to see here ;)
     Decimal total = 1 * settings.Admin_Cost__c; //Admin_Cost__c is set to 1.00 in custom settings
     System.assertEquals(1.00, total); <---- this actually passes if I remember correctly

--BUT--

  RequestSettings__c retrievedSettings = RequestSettings__c.getInstance();
  System.assertNotEquals(null, retrievedSettings.Admin_Cost__c);
  System.assertEquals(1.00, retrievedSettings.Admin_Cost__c);
  total = 1 * retrievedSettings.Admin_Cost__c;
  System.assertEquals(1.00, total); <--- fails if field type is Currency, passes when Number
}


Thougths? I'm not ruling out the possibility that I mucked with something else and magically it worked, but it definitely wasn't liking the CURRENCY setting...I will probably try to reproduce this in a dev org somewhere just to clear my head, but was hoping maybe someone had a nugget for me as to why it would fail if Currency is supposed to be a Decimal anyway...
Hi developers,

In this opportunity my question comes from about the test classes and coverage from this to apex classes

I have two classes, one is Apex Class and the other is the Test Class. My question is why my Apex Class is 0% coverage??? Run the test class and this finish OK. Please guide me how can I for coverage the code in my Apex Class?

I put the code from the two classes.

Thanks for the support 

APEX CLASS 

public class contactExtension {

    private final Contact contact;
    private string idContact;
    private final Moneda__c monedabob;
    private string idMonedabob;
    private final Moneda__c monedausd;
    private string idMonedausd;
    public decimal x {get;set;}
    public decimal totalUsd {get;set;}

    public contactExtension(ApexPages.StandardController contactController) {
       this.contact = (Contact)contactController.getRecord();
       idContact = contact.id;
    }
         
    public List<Beneficio__c> getBeneficiosBob()
    {
        Moneda__c monedabob = [select Name from Moneda__c where Moneda__c.name = 'Bolivianos'];
        idMonedabob = monedabob.id;
        x = 0;
        for (Beneficio__c ben : [select monto_estimado__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob]){
            if (ben.monto_estimado__c == null){
                ben.monto_estimado__c = 0;
            }
            x = ben.monto_estimado__c + x;
        }
               
        return [select Catalogo_Beneficio__c, Name, Moneda__c, monto_estimado__c, proposito__c,fecha_entrega__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob];
    }
             
    public List<Beneficio__c> getBeneficiosUsd()
    {
        Moneda__c monedaUsd = [select Name from Moneda__c where Moneda__c.name = 'Dolares'];
        idMonedausd = monedausd.id;
       
        totalUsd = 0;
        for (Beneficio__c ben : [select monto_dolares__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedausd]){
            totalUsd = ben.monto_dolares__c + totalUsd;
        }       
        return [select Catalogo_Beneficio__c, Name, Moneda__c, monto_dolares__c, proposito__c,fecha_entrega__c  from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedausd];
    }
}

TEST CLASS

@isTest public class ContactTest {          
        testMethod private static void getBeneficiosBob()
        {
            Account a= new Account(Name = 'Fundacion Inti Raymi');
            insert a;
           
            Operacion__c operacion= new Operacion__c(Name = 'Kori Chaca');
            insert operacion;
           
            Departamento__c departamento = new Departamento__c(Name = 'Oruro');
            insert departamento;
           
            Provincia__c provincia= new Provincia__c(Name = 'Cercado', Departamento__c = departamento.id);
            insert provincia;
           
            Municipio__c municipio= new Municipio__c(Name = 'Caracollo', Provincia__c = provincia.id);
            insert municipio;
           
            Comunidad__c comunidad= new Comunidad__c(Name = 'Iroco');
            insert comunidad;           
           
            Organizacion__c organizacion= new Organizacion__c (Name = 'Iroco');
            insert organizacion;
                                               
            Moneda__c monedabob = new Moneda__c(Name = 'Bolivianos', sigla__c = 'BOB');
            insert monedabob;
           
            Contact contacto = new Contact(Firstname= 'Alejandra', Lastname = 'Helguero', Carnet_Identidad__c = '22334455', Operacion__c = operacion.id, Departamento__c = departamento.id, Provincia__c = provincia.id, Municipio__c = municipio.id, Comunidad__c = comunidad.id, Organizacion__c = organizacion.id);
            insert contacto;

            Categoria_beneficio__c categoria = new Categoria_beneficio__c(Name = 'Produccion Ganadera');
            insert categoria;
           
            Subcategoria_beneficio__c subcategoria = new Subcategoria_beneficio__c(Name = 'Ganaderos', Categoria_Beneficio__c = categoria.id);
            insert subcategoria;
           
            Catalogo_beneficios__c tipo_beneficio= new Catalogo_beneficios__c(Name= 'Sanidad Animal', Nombre__c = 'Sanidad Animal', Categoria_Producto__c = categoria.id, Subcategoria_producto__c = subcategoria.id);
            insert tipo_beneficio;           
           
            for(Integer i = 0; i < 20; i++){
                Beneficio__c b = new Beneficio__c(Contacto__c = contacto.id, Moneda__c = monedabob.id, monto_estimado__c = 100.56, Catalogo_Beneficio__c = tipo_beneficio.id, fecha_entrega__c = Date.newInstance(2014, 06 ,20));
                insert b;
            }           
           
            Moneda__c monedabobS = [select Name from Moneda__c where Moneda__c.name = 'Bolivianos'];
            String idMonedabob = monedabobS.id;
           
            Decimal x = 0;
            for (Beneficio__c ben : [select monto_estimado__c from Beneficio__c where Contacto__c = :contacto.id and Moneda__c = :monedabob.id]){
                if (ben.monto_estimado__c == null){
                    x = ben.monto_estimado__c + x;
                }
            }
            Beneficio__c[] beneficios = [select Catalogo_Beneficio__c, Name, Moneda__c, monto_estimado__c, proposito__c,fecha_entrega__c from Beneficio__c where Contacto__c = :contacto.id and Moneda__c = :monedabob.id];
            System.assert(beneficios != null, 'Retorna valores');
        }
}
Hi,

The CRM I am working has 22 Active triggers in Opportunity Object. Every time I am trying to update any thing related to Opportunity, it is giving me 101 SOQL error. Even when I deploying Class,testClass in production is giving same error.

Any idea how to deal with this situation.

Hello Board,

 

Salesforce doc says,

 

When a rich text area field is used in a formula, the HTML tags are stripped out before the formula is run. For example, when a rich text area field is used in a validation rule's criteria, the HTML tags are removed before the evaluation.

 

I am creating a cross object formula field with return type TEXT to access Rich Text Area field. But RTA field was not available there.

 

What I am missing here?

 

Thanks,

Devendra