• Vikram SFDC
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Custom Object: Product__c
Custom Fields: Name, Quantity__c, Address__c, EmiNumber__C.

If User Creates a record :

Name ='Samsung Pro Max';
Quantity=10;
Address='xxxx'.



After Save
Here i need to Create same product with ten Records.
Say...!

Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.

Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.

Name ='Samsung Pro Max';
Quantity =1;
Address='xxxx'.

------------->so on 10 times
including the first record  to be updated as 1
so that i can track each item seperately .
Can this action can be acheived using the flow.


Thanks 
Prathushya Reddy.




 
Hi,

I have a requirement to update the checkbox "DocumentsApproved__c" 
when both files "Passport' and 'Status Certificate" are uploaded.

And i  was trying to acheive this through Trigger.
Can someone help me i have tried this but its not working.

trigger ContentDocumentLinkTrigger on ContentDocumentLink ( after INSERT, before DELETE ) {
    List<String> linkedEntIds = new List<String>();
    
    for( ContentDocumentLink link : Trigger.new ) {
        linkedEntIds.add( link.LinkedEntityId );
    }
    
    List<ContentDocumentLink> conDocLinks = new   List<ContentDocumentLink>();
    conDocLinks = [
        SELECT  LinkedEntityId
        FROM    ContentDocumentLink
        WHERE   Id IN :Trigger.newMap.keyset()
        AND     LinkedEntity.Type = 'Account' 
        AND     ContentDocument.Title LIKE 'Diplomatic Passport'
        AND     LinkedEntityId IN :linkedEntIds
    ];
    
    if( !conDocLinks.isEmpty() ) {
        List<Account> accToUpdate = new List<Account>();
        
        for( ContentDocumentLink conDocLink : conDocLinks ) {
            Account acc = new Account();
            
            acc.Id  = conDocLink.LinkedEntityId;
            acc.DocumentsApproved__c   = Trigger.isInsert;
            
            accToUpdate.add( acc );
        }
        
        UPDATE accToUpdate;
    }
}