• Xeon Arian
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi All,
I am very new to development and aI have to change one validation rule on Opportunity into trigger using custom settings.
For example:Validation rule on an opportunity has some profiles, some roles and stage 
something like below-
AND(
ISPICKVAL(StageName ,"Pending"), 
ISPICKVAL(StageName ,"Closed") , 
NOT($Permission.Bypass_Rule_Exclusion), 
$Profile.Name <> " Contractor", 
$UserRole.Name <> "Analyst")

and I need to change this validation rule into trigger.
I can move this hardcoded values to custom settings,but I am not sure how to write a trigger .
Could someone please help me.
Hi,
I have a requirement to make to make a file private and be available to only the user whose role name consists the name of the file for a specific custom object. For this I am trying to retrieve from Content Document Link with the custom object name LinkedEntity.Type and ContentDocumentid as filters, when I hard code the ContentDocumentid it is working fine but when I try to dynamically provide the ContentDocumentId then the query is not returning any result. I am adding a snippet of my code. Please Help!!. Thanks
List<Id> listOfConDocuId = new List<Id>();

    
    for(ContentVersion cv: Trigger.new){
        if((!cv.Title.contains('product proposal')) || (!cv.Title.contains('final')) || (!cv.Title.contains('packet')))
            listOfConDocuId.add(cv.ContentDocumentId);
    }
    
    Map<Id, Project__c> mapOfProjectId = new Map<Id, Project__c>([SELECT Id FROM Project__c]);
    
    Set<Id> setOfProjectId = mapOfProjectId.keySet();
       
    List<ContentDocumentLink> LinkedProject = [SELECT ContentDocumentId, LinkedEntityId, ContentDocument.Title FROM ContentDocumentLink where LinkedEntityId in :setOfProjectId and LinkedEntity.Type='Project__c' and ContentDocumentId IN :listOfConDocuId];

 
Hi ,

I am trying to create a custom button that will use onclick javascript but the button is not available in lightning . I know that lightning does not support onclick javascript. Can anyone help me with this issue by providing a replacement for it in lightning? Below is the code I am using in onclick javascript.
 
{!REQUIRESCRIPT("/soap/ajax/18.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/18.0/apex.js")}

 window.open('/apex/GetReport?OpportunityId='+'{!Opportunity.Id}','_self')

Thanks
Hi All,
I am very new to development and aI have to change one validation rule on Opportunity into trigger using custom settings.
For example:Validation rule on an opportunity has some profiles, some roles and stage 
something like below-
AND(
ISPICKVAL(StageName ,"Pending"), 
ISPICKVAL(StageName ,"Closed") , 
NOT($Permission.Bypass_Rule_Exclusion), 
$Profile.Name <> " Contractor", 
$UserRole.Name <> "Analyst")

and I need to change this validation rule into trigger.
I can move this hardcoded values to custom settings,but I am not sure how to write a trigger .
Could someone please help me.