• mbhardwaj
  • NEWBIE
  • 60 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 66
    Replies

Hi,

 

I want to throw the error message for comments field if everytime Date field is updated

 

I have written the formula below but whenever comments field is not blank it is not working properly.

 

isblank(Comments__c)
&&
ISCHANGED(Date__c)

 

Can anyone help?

i have some code in apex a function basically

 

 public PageReference find(){
    System.debug('Helloji');
     describe.uniqueFields= new Map<String,String>();
   List<String> ss  = xxx1.split(';');
   System.debug('ss is '+ss );
   System.debug('all fields are '+ describe.allFieldsKeySet);
   
   for(String s : ss)
  { 
  
   System.debug('s is'+s);
   describe.uniqueFields.put(s,describe.allFields.get(s).label);
   }
    return null;}

 

in this function i am getting two logs

11:20:53.322 (322688000)|USER_DEBUG|[450]|DEBUG|all fields are (AccountNumber, AccountSource, Active__c, AnnualRevenue, BillingCity, BillingCountry, BillingLatitude, BillingLongitude, BillingPostalCode, BillingState, ...)

 

11:20:53.322 (322278000)|USER_DEBUG|[449]|DEBUG|ss is ([AccountSource])

 

11:20:53.322 (322829000)|USER_DEBUG|[455]|DEBUG|s is[AccountSource]

 i am not getting why its showing 

s =[AccountSource]

it should be like s = AccountSource  .after that i applied s.removeStart('['); s.removeEnd(']');

still getting same value of s

because it is not AccountSource so

describe.allFields.get(s).labelis getting de - referencing null object because describe.allFields.get(s) returning null thats why

here allFields a map <String, CustomClass>()

and allFieldsKeySet is the keyset of allFields .can you please help how to resove this issue and why s is [AccountSource] no AccountSource

 

Hi !

 

I'm trying to set the ownerid from a specific taks.

 

trigger CriarTarefa_Impressao_e_Nova_separacao2 on Task (after update) {
    
    
Set<Id> ownerId=new Set<Id>();
    List<Task> taskNova = new List<Task>();   

     for(Task tsk:[SELECT Id, ownerid, whatid FROM Task WHERE subject = '- Iniciador do Fluxo -' AND id IN :Trigger.new])
        ownerId.add(tsk.ownerid);
 
    for (Task t : Trigger.new){
        Task oldt = Trigger.oldMap.get(t.ID);
    
        if(t.status != oldt.status){
            
        if (t.subject == 'Impressão - Atualização de dados' && t.status == 'Concluído'){
                taskNova.add (new Task(
                         Subject = 'Impressão - Formando tem fotos separadas?',
                         Status = 'Nenhum',
                         WhatID = t.WhatID,
                         Description = t.description,
                         OwnerId = ownerid,
                         ActivityDate = Date.today()));
    }
            if (t.subject == 'Impressão - Formando tem fotos separadas?' && t.Formando_tem_montagens__c == 'SIM' && t.status == 'Concluído' || t.subject == 'Impressão - Preencher quantidades' && t.Formando_tem_montagens__c == 'SIM' && t.status == 'Concluído'){
                taskNova.add (new Task(
                         Subject = 'Impressão - Informe o caminho da pasta',
                         Status = 'Nenhum',
                         WhatID = t.WhatID,
                         Description = t.description,
                         OwnerId = ownerid,
                         ActivityDate = Date.today()));
       }
    }
    insert taskNova;
            }

 

But I get this error:

"Invalid initial expression type for field Task.OwnerID, expecting: Id"

Normally, after an Opportunity is created, a Payment is automatically created with it. We rely heavily on this function. For some reason, this stopped working spontaneously. No settings were changed to my knowledge. Can anyone suggest where we can look? 

Hi Friends,

 

I have one object and 20 profiles in the org. each profile has different access (CRUD) on this object. now i want to quick check which profile has what permissions on this object. i can check by going to each and every profile but it takes more time. can any one suggest me the quick view to show the object permissions on all profiles?

 

by using field accessibility we can select a field and we can see field access for all profiles. like this can we see object permisssions for all profiles.

 

Thanks in advance

Hi All,

 

I need to send an email with a PDF attachment.  I have developed a normal visualforce page (didn't render as PDF). And then using apex code, am getting the body of it, and sending it as PDF attachment.

 

I am receving the email with the PDF attachment, but when I try to open the PDF, it isn't opening.  It gives the following decode error - "Adobe reader cannot open the PDF because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)"

 

Below is the Apex class that is taking the body of vf page and making it a PDF attachment.  Please let me know if I am missing anything.  Thanks.

 

global class CustomersPDF_SendEmail implements Schedulable {

    global void execute(SchedulableContext sc) {    
        
        PageReference pdf = Page.CustomersPDF;
        pdf.getParameters().put('id','001O000000ECvg4');
     
        Blob body;
     
        try {
          body = pdf.getContent();
        } 
        catch (VisualforceException e) {
          body = Blob.valueOf('Some Text');
        }
     
        Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
        attach.setContentType('application/pdf');
        attach.setFileName('KeyCustomers.pdf');
        attach.setInline(false);
        attach.Body = body;
     
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setUseSignature(false);
        mail.setToAddresses(new String[] {'abc@gmail.com'});
        mail.setSubject('Customers PDF - Demo');
        mail.setHtmlBody('Check the attachment!');
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] { attach }); 
     
        // Send the email
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });               
    
    }
}

 

 

HI All,

 

I need to delete the chatter post based on some condition like

feeds which start from "(abc) and its posted by system administrator.

i wrote the batch ,but it delete all the post in the feed.

That is also particular about the feed like accountfeed

" AccountFeed[] feed = [SELECT Id FROM AccountFeed ]; Delete feed;

 

"

 

how to add the condition here .. and suppose if in the chatter i have the feed that starts with "abc" how to delete that .:)

 

can any one help me out Please.

 

Regards

Sailer

Hi all

 

How to convert Event StartDateTime into User's Local Timezone. By default the time portion is always transferred in the Coordinated Universal Time (UTC) time zone. I need to convert into user's timezone. 

I need to create a button on account, When clicked, this button should show a table which lists all status types and counts of contacts of each status type for that account. Status is picklist field which is having 4 options.

Hi All,
 
   I'm facing the problem from exception message.Actually,my requirement is i need to insert the list of records.while inserting if any exceptions for each record, i need to get all the error messages with record id.please help to me , how can i handle this error messgaes for each record.

Thanks to All....

Currently I am using the de organisation for developer account.But there is no Sandbox option for developer account and I couldn't find it.

 

As I want to familiarize myself with as we might face in real Enterprise version sandbox and production, I want to create free sandbox for my developer account. 

 

And want to learn the deployment between sandbox and production environment.

 

And suggesstion on how to create free sandbox environment for Developer account?

How can I change the label of related list 'Contact Role' , which can be found in Opportunaty detail page?

i am running soql query dynamically using search.query() and i am facing error 

System.QueryException: expecting a right parentheses, found 'OFFSET'

 

 

my query is 

 

FIND 'USA' IN ALL FIELDS RETURNING Account (SicDesc,ParentId,TickerSymbol,LastModifiedDate,NumberOfEmployees,NumberofLocations__c,ShippingCity,ShippingLatitude,BillingLongitude,Jigsaw,BillingCountry,ShippingCountry,Site,AccountNumber,BillingStreet,Active__c,LastViewedDate,BillingCity,ShippingLongitude,Rating,CreatedById,IsDeleted,Id,ShippingPostalCode,Industry,UpsellOpportunity__c,AccountSource,Phone,SLAExpirationDate__c,Type,OwnerId,ShippingState,BillingLatitude,AnnualRevenue,BillingState,LastActivityDate,BillingPostalCode,SystemModstamp,SLASerialNumber__c,Description,LastReferencedDate,LastModifiedById,Website,ShippingStreet,Fax,SLA__c,CustomerPriority__c,MasterRecordId,Name,CreatedDate,JigsawCompanyId,Sic,Ownership ORDER BY Name OFFSET= 0 LIMIT 5)


i tried many things but every time i am getting some error can any one please tell what should be the right query for selecting 5 accounts with offset 0 including all fields ??

Hi

I am storing object field name in other object

 

EX

  objeContainer - objects store name, start_c.  name means calendar name , strats_c store startingDate. 

 

first

 

 i need to get field name 

then 

from the field name i need to get value from other object 

 

i am getting field name by the following query 

 

thisEvent =SELECT Id, Name, start__c from myCalendar__c Limit 4

 

here after i need to get values from other object 

 

here i am getting problem . how to query fieldname and get their appropriate values

i am getting error when i query like this 

like this 

 

select  thisEvent.Id,thisEvent.Name,thisEvent.start__c

 

 i got strucked in this stage how to proceed further .

 

Suggestions and examples are welcome 

Thanks in advance