• Sean Nolans
  • NEWBIE
  • 40 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies

 am looking to build a query that includes a date range.
I want to be able to say departure_date_c + 330 days from now

We have this in a formula field and it looks like this 
departures_dates__r.date__c < (TODAY() + 330)


But I want to be able to edit my sql query in your tool to include this .You builder does not allow for something like this but it looks like I can manually edit your SOQL query 


Any ideas how to turn the above formual field into a query

thanks 
 
No way in SF to update worklow (field) when a file is attached to a record in using native SF
So using a trigger - I took an example from the forums 

I am trying to say when the attachment contains signed as it will be Esigned 

But I am getting this 
Error: Compile Error: Unexpected token '.'. at line 11 column 44

This is what I have 

trigger TestAttachmentCheck on Attachment (after insert, after update, after delete, after undelete) {
    List <Account> AccountList = new List<Account>();
     List <Account> AccountListToUdpdate = new List<Account>();
    Set <Id> AccountIds = new Set <Id>();
    
    if(trigger.isInsert || trigger.isUpdate)
    {
    for(Attachment attach : trigger.New){
         //Check if added attachment is related to Account or not
         if(attach.ParentId.getSobjectType() == Account.SobjectType){
            if(string.valueOf(attach.Name)).contains('signed'))
               AccountIds.add(attach.ParentId);
         }
    }
    }
    
    if(trigger.isDelete || trigger.isUndelete)
    {
    for(Attachment attach : trigger.old){
         //Check if added attachment is related to Account or not
         if(attach.ParentId.getSobjectType() == Account.SobjectType){
            if(string.valueOf(attach.Name)).startswith('.xls'))
               AccountIds.add(attach.ParentId);
         }
    }
    }
    
    AccountList = [select id, CIN_Uploaded__c from Account where id in : AccountIds];
    for(Account Account : AccountList){    
    
           Account accountToUpdate = new accountToUpdate();
           AccountToUpdate.Id = account.Id;
           AccountToUpdate.CIN_Uploaded__c  = true;
           AccountListToUdpdate.add(accountToUpdate);
                
    }
       
        update AccountListToUdpdate;
}
I wish to generate a URL in order to pass data from a thrid party connctor (Zapier) to SFDC. Does anyone know how I could generate such a URl from SFDC that could be query a REST API endpoint ?

https://zapier.com/help/how-get-started-webhooks-zapier/#using-the-retrieve-poll-trigger-option

The would be used to listne for changes in another application ?

thanks



 
I am attempting to render text colo based on critieria 

the output text works but the colour fails to render as expected 

<apex:page standardController="order__c" >
  
  <apex:outputField style="color: {!IF(order__c.order_status__c ="Confirmed",'red','green')}" value="{!order__c.order_status__c}"  />
    </apex:page>

Do I need a custom controller 
or should this work with a standard controller ?

any assistance would be apprecatied

thanks

 
I have created a simply trigger that adds the values of two currency fields and renders the full amout into a total field.
I need assistance creating a class for this trigger so that I can deploy it

trigger Sum ON order__c(before insert, before update) {

    for (order__c o: Trigger.new) {
        if (Trigger.isUpdate && o.new_total_field__c != Trigger.oldMap.get(o.Id).new_total_field__c) {
            
            continue;       
        }
        o.new_total_field__c = o.hss_qty_price__c + o.sb_qty_price__c ;

    }
}

Any feedback would be greatly appreciated 

Thanks

D
Content cannot be displayed: The value 'null' is not valid for operator '>'

What is strange is that that sys admin does not get the message and the page renders well but not for users they get the above error


example  of synthax
<apex:outputlabel value= "{!IF(order__c.hss_qty_price__c > 0, "Includes HSS ", "No hss" )}" /> <apex:outputText value = "{!IF(order__c.hss_qty_price__c > 0, order__c.hss_qty_price__c, " " )}" />


Any suggestsion would be great

thanks 

 
I have an IF statment inside a  <apex:outputText value= and it works well when I select regular text out put inside " " 
EG this works well 
 <apex:outputText value= "{!IF(order__c.departure_city_qty_price__c >  0, "Includes Departure City Qty Price",  "No Departure city extras" )}" />

However I need to be able to reference a field lable inside of my " " out put
Something like this 
 <apex:outputText value= "{!IF(order__c.departure_city_qty_price__c >  0, "{!order__c.Deal_Option_Purchased__c" )}",  " " )}" />


so the idea is that you get to see the field that is included - make sense ?

See screesnhot for further details

Suggestions would be apprecatied
 screenshot



 

I wish to render an field output on a VF page if another field value is  > 0 

 <apex:pageBlockSection >
  
  <apex:outputField> value= "{!IF(order__c.hss_qty_price__c >  0, "This includes HSS and Stay Behind price",  "All clear no extras" )} />
             
  
   </apex:pageBlockSection>


This is hwo it works in my formula but I have hit a compile error there so need to move into a page

IF(hss_qty_price__c > 0, "This price includes HSS price",  "All clear no extras" 
Hi,

I am trying to build a VF page that renders a section but only if a mulitselect picklist on a related object has a certain value . I want to say - display if related __r.cf_c CONTAINS cruise
I am getting back the following error 

line 22, column 66: Open quote is expected for attribute "rendered" associated with an element type "apex:pageblockSection"
Error: Open quote is expected for attribute "rendered" associated with an element type "apex:pageblockSection".



Here is what I have 


<apex:page standardController="order__c">
<apex:form >


<apex:pageBlock title="Cabin Booked">



    <apex:pageblockButtons >

    <apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn">
    </apex:commandlink>

    <apex:commandLink value="Cancel" action="{!cancel}" target="_parent" styleClass="btn">
    </apex:commandlink>

    </apex:pageblockButtons>

 
 
     <apex:pageblockSection title="Cabins Booking page" rendered=="{!CONTAINS([order__c].Deal__r.deal_type__c,'cruise')}">
     
     <apex:inputField value="{!order__c.Cruise_Company__c}"/>
     <apex:inputField value="{!order__c.INITIAL__c}"/>
     <apex:inputField value="{!order__c.CABIN_DATE__c}"/>
     <apex:inputField value="{!order__c.Cabin_Number__c}"/>
     <apex:inputField value="{!order__c.Ship_Name__c}"/>
     <apex:inputField value="{!order__c.Ship_Sale_Date__c}"/>
     <apex:inputField value="{!order__c.Cabin_Price__c}"/>
     <apex:inputField value="{!order__c.CABIN_DATE__c}"/>
     <apex:outputField value="{!order__c.Cabin_Paid__c}"/>
 
 <apex:outputField id="derek" value="{!order__c.Status_Output_Field__c}" rendered="{!IF(order__c.Booking_Validation__c ='Travelled' ,true,false)}"/>


 
  </apex:pageBlockSection>
  
  
  </apex:pageBlock>
  

  
</apex:form>
   
</apex:page>
No way in SF to update worklow (field) when a file is attached to a record in using native SF
So using a trigger - I took an example from the forums 

I am trying to say when the attachment contains signed as it will be Esigned 

But I am getting this 
Error: Compile Error: Unexpected token '.'. at line 11 column 44

This is what I have 

trigger TestAttachmentCheck on Attachment (after insert, after update, after delete, after undelete) {
    List <Account> AccountList = new List<Account>();
     List <Account> AccountListToUdpdate = new List<Account>();
    Set <Id> AccountIds = new Set <Id>();
    
    if(trigger.isInsert || trigger.isUpdate)
    {
    for(Attachment attach : trigger.New){
         //Check if added attachment is related to Account or not
         if(attach.ParentId.getSobjectType() == Account.SobjectType){
            if(string.valueOf(attach.Name)).contains('signed'))
               AccountIds.add(attach.ParentId);
         }
    }
    }
    
    if(trigger.isDelete || trigger.isUndelete)
    {
    for(Attachment attach : trigger.old){
         //Check if added attachment is related to Account or not
         if(attach.ParentId.getSobjectType() == Account.SobjectType){
            if(string.valueOf(attach.Name)).startswith('.xls'))
               AccountIds.add(attach.ParentId);
         }
    }
    }
    
    AccountList = [select id, CIN_Uploaded__c from Account where id in : AccountIds];
    for(Account Account : AccountList){    
    
           Account accountToUpdate = new accountToUpdate();
           AccountToUpdate.Id = account.Id;
           AccountToUpdate.CIN_Uploaded__c  = true;
           AccountListToUdpdate.add(accountToUpdate);
                
    }
       
        update AccountListToUdpdate;
}
I wish to generate a URL in order to pass data from a thrid party connctor (Zapier) to SFDC. Does anyone know how I could generate such a URl from SFDC that could be query a REST API endpoint ?

https://zapier.com/help/how-get-started-webhooks-zapier/#using-the-retrieve-poll-trigger-option

The would be used to listne for changes in another application ?

thanks



 
I have created a simply trigger that adds the values of two currency fields and renders the full amout into a total field.
I need assistance creating a class for this trigger so that I can deploy it

trigger Sum ON order__c(before insert, before update) {

    for (order__c o: Trigger.new) {
        if (Trigger.isUpdate && o.new_total_field__c != Trigger.oldMap.get(o.Id).new_total_field__c) {
            
            continue;       
        }
        o.new_total_field__c = o.hss_qty_price__c + o.sb_qty_price__c ;

    }
}

Any feedback would be greatly appreciated 

Thanks

D

I wish to render an field output on a VF page if another field value is  > 0 

 <apex:pageBlockSection >
  
  <apex:outputField> value= "{!IF(order__c.hss_qty_price__c >  0, "This includes HSS and Stay Behind price",  "All clear no extras" )} />
             
  
   </apex:pageBlockSection>


This is hwo it works in my formula but I have hit a compile error there so need to move into a page

IF(hss_qty_price__c > 0, "This price includes HSS price",  "All clear no extras" 
Hi Experts,

I need your assistance updating TIN_Uploaded__c (Checkbox) on Lead if the Attachment (Notes and Attachment) Name starts with "TIN". This box should be unchecked if the Attachment is deleted. Also I have another box that will do the same behavior SLA_Uploaded__c but I don't know how to nest them in the code. I've tried building the code but I'm getting error "Variable does not exist: attach.Name" in Line 14.
 
trigger TestAttachmentCheck on Attachment (after insert, after update, after delete, after undelete) {
    List <Lead> LeadList = new List<Lead>();
    Set <Id> LeadIds = new Set <Id>();
    
    for(Attachment attach : trigger.New){
         //Check if added attachment is related to Lead or not
         if(attach.ParentId.getSobjectType() == Lead.SobjectType){
              LeadIds.add(attach.ParentId);
         }
    }
    LeadList = [select id, CIN_Uploaded__c from Lead where id in : LeadIds];
   	for(Lead lead : LeadList){    
    	if((string.valueOf(attach.Name)).startswith('.xls')){
            lead.CIN_Uploaded__c  = true;
        }
        else{
            lead.CIN_Uploaded__c = false;
        }
    }
        update LeadList;
}
I would appreciate any help.

Thanks.