• 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 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))
)