• dev per
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
I am trying to understand how salesforce generates the PDF preview on a contnet file that is of .docx? When we click on preview for a docx file in content, it initially says preview not available but after sometime that preview is enabled. Does this mean Salesforce converts the docx to pdf and saves it somewhere on the server? If Yes is there a way to access this pdf copy directly? Apperciate any help! 
Hi,

I have an attachment in Notes & Attachment for a custom object(Cust A). On Cus A object, I created a formula field(see formula below) to generate URL for the latest attachment.

When I click on the formula field URL,  it throws this error "Insufficient Privileges.You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary."

But it works fine I click on the  view link from the note & attachment relatedlist.

On comparing both URL, below is how it looks

Url on Notes & Attachment view:
https://xxxx--stage--c.cs28.content.force.com/servlet/servlet.FileDownload?file=00Pxxxxxxxxxx

Url on the formula field view:
https://xxxx--stage.cs28.my.salesforce.com/servlet/servlet.FileDownload?file=00Pxxxxxxxxxxx

Formula -- 

The only difference I see is the namespace "--c". How do I handle this in Formula?

IF (NOT(ISBLANK(AttachmentId__c)),HYPERLINK('/servlet/servlet.FileDownload?file=' + AttachmentId__c, $Label.View, '_blank'),NULL)
 
Hi,

I am currently locked out of my Developer Edition. Had tons of things I was working on and now unable to log in.
there any way I can reset the password. 

The security answer attempt also failed. So having hard time to reset password through forgot password.

Please help!

userID: sfdc@dev01.com
Hi,

Can you please give me a technical difference for using Lightning over Angular. What are the pros and cons in each of the implementaion and How is lighting different from angular. 

I am not looking for general difference like lighinging is new and angular is tested etc., but more technical understanding of how lightning makes it easier compared to the same implementation done in Angular. what feature do we have in lightning componenets that are not in Angular etc., 

Any insight on this will be really helpful. Thanks!
Hi,

Can anyone please provide me a sample code to define a method in an apex class , that would take input parameters for header of a table, list of records to display in the rows and styling for the table itslef. Basically this method should output HTML string which will be rendered in VF. 

The table has to be dynamic, meaning that depending on the header values provided, it should be able to spit out corresponding HTML table string. so if there are 3 headers provided then the table should only show three columns.

Can anyone please help with a sample code for this. Thanks!
Hi,


All I am trying to do is if the Opty status is changed to Stage A or Stage B  and if there are no Service contract associated with it then perform some action.

But my question is , Do I need to check  set size before calling contains() method on a set.
I have a trigger on opty where a set of Opty Ids are created,  if a Service contract is associated to it. But the set size (Set.size()>0) is not checked before using contains method (Set.sontains()). Even though its not throwing Dereference to null object , I want to understand what would a Contains method check if the set is empty and why is it not throwing any error.

Please advise.


Below is my code 
trigger trg_aftr_ins_upd on Opportunity (after insert, after update) {
    Boolean skipValidations = false;
    skipValidations = SkipTriggerValidation.performTriggerValidations();
    if(skipValidations == false){  
    Set<String> optyCancelledStages = new Set<String>();
        optyCancelledStages.add('Stage A');
        optyCancelledStages.add('Stage B');  
    Map<Id, String> optyIdProjectStatusMap = new Map<Id, String>();    
   
    Set<id> scOpptySet=new Set<id>();
    if(trigger.isupdate){
    for(ServiceContract sc:[select id,opportunity__c from ServiceContract where Opportunity__c in:trigger.newMap.keyset()]){
        scOpptySet.add(sc.opportunity__c);
        
    }
   }
   for(Opportunity o:Trigger.new)
   {
    Opportunity oldOpportunity = null;
        if(trigger.isUpdate){
        oldOpportunity = trigger.oldMap.get(o.Id);
        }   
          
           if(trigger.isUpdate && oldOpportunity.stageName != o.StageName  && optyCancelledStages.contains(o.StageName))
        {
          
            if( !scOpptySet.contains(o.id)  ) /// this is currently working but will this throw Derefernce to Null pointer in any scenario?                                                                              
                optyIdProjectStatusMap.put(o.Id, wfUtil.CANCELLED);
        }
          
      
        if(optyIdProjectStatusMap != null && !optyIdProjectStatusMap.isEmpty()){
            //Perform some action here......
        }
  }
 
 }
Hi ,

I have a question related to the "after update trigger" execution order when a DML update is performed on the same object. :
Lets says there are two contacts C1 and C2 and I need to update the field F2 on C2 based on some values in F1 on C1.

I check logic in first FOR loop and update F1 on C1 (upon a update trigger) then check few other logic and update F2 on C2 .

I know its not best practice to use after trigger for updating same object on which the trigger is invoked but in my case I dont have an option. Also, all i need to understand, how would after tirgger behave if there are 2 update statements for an object in the after update trigger of the same object.

So if update DML operation happens on C1(contact) first then will it  retrigger the "after update trigger" before continuing to the rest of the code  or will it continue on the second for loop and run the DML update operation on C2(contact) before recurrsively calling the same trigger again due to after update event? 

the pusedo code for the same is something like below:

trigger trg_contact_update on contact (before update) {

for  ( contact c : trigger.new ){
  doing some thing ...
    contactMap.add( c.id, c);
}

map< id, contact> c1Contact = new map<id,contact> ([select id , F1 where id in :contactMap.keys()]) 
for ( contact c1: c1Contact) {
  //do something
 String oldF1value = c1.F1;
c1.F1 = ' ';
c1List.add(c1);
}

if( c1List.size()> 0)
update c1List; 

for ( contact c2: c2Contact) {
  //do something
if(c1.F1 = ' ')
c2.F2 = oldF1value ;
c2List.add(c1);
}

if( c2List.size()> 0)
​update c2List; 
}

Please do not check for logic or issues in the above code, my intention is to understand how "after update trigger " behave in the case when there are 2 update DML operation. Please share your thoughts on the same.
 
Hi,

I am creating a workflow on a custom object. The condtion to trigger this workflow rule is when the status__c == 'Inactive' and custom__r.email ==email__c then send mail to custom__r.email .
custom__c is a look up field on USER and email__c is a email field.

The problem I have is to handle email aliases.There are two domain which actually are kinda same. for ex; abc@domainplus.com is same as abc@domain.com. but the above condition fails for these domain. How do i handle this?

Below is the code smaple I have:
AND(
ISPICKVAL(Status__c, "Inactive")
, custom__r.Email == Email__c
, NOT(ISBLANK(custom__c))
)
I am trying to understand how salesforce generates the PDF preview on a contnet file that is of .docx? When we click on preview for a docx file in content, it initially says preview not available but after sometime that preview is enabled. Does this mean Salesforce converts the docx to pdf and saves it somewhere on the server? If Yes is there a way to access this pdf copy directly? Apperciate any help! 
Hi ,

I have a question related to the "after update trigger" execution order when a DML update is performed on the same object. :
Lets says there are two contacts C1 and C2 and I need to update the field F2 on C2 based on some values in F1 on C1.

I check logic in first FOR loop and update F1 on C1 (upon a update trigger) then check few other logic and update F2 on C2 .

I know its not best practice to use after trigger for updating same object on which the trigger is invoked but in my case I dont have an option. Also, all i need to understand, how would after tirgger behave if there are 2 update statements for an object in the after update trigger of the same object.

So if update DML operation happens on C1(contact) first then will it  retrigger the "after update trigger" before continuing to the rest of the code  or will it continue on the second for loop and run the DML update operation on C2(contact) before recurrsively calling the same trigger again due to after update event? 

the pusedo code for the same is something like below:

trigger trg_contact_update on contact (before update) {

for  ( contact c : trigger.new ){
  doing some thing ...
    contactMap.add( c.id, c);
}

map< id, contact> c1Contact = new map<id,contact> ([select id , F1 where id in :contactMap.keys()]) 
for ( contact c1: c1Contact) {
  //do something
 String oldF1value = c1.F1;
c1.F1 = ' ';
c1List.add(c1);
}

if( c1List.size()> 0)
update c1List; 

for ( contact c2: c2Contact) {
  //do something
if(c1.F1 = ' ')
c2.F2 = oldF1value ;
c2List.add(c1);
}

if( c2List.size()> 0)
​update c2List; 
}

Please do not check for logic or issues in the above code, my intention is to understand how "after update trigger " behave in the case when there are 2 update DML operation. Please share your thoughts on the same.
 
Hi,

I am creating a workflow on a custom object. The condtion to trigger this workflow rule is when the status__c == 'Inactive' and custom__r.email ==email__c then send mail to custom__r.email .
custom__c is a look up field on USER and email__c is a email field.

The problem I have is to handle email aliases.There are two domain which actually are kinda same. for ex; abc@domainplus.com is same as abc@domain.com. but the above condition fails for these domain. How do i handle this?

Below is the code smaple I have:
AND(
ISPICKVAL(Status__c, "Inactive")
, custom__r.Email == Email__c
, NOT(ISBLANK(custom__c))
)