• Jacob.Marshall
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Salesforce Developer
  • StratusG


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm currently in the process of updating an org's custom code to allow us to replace Attachments with Files.  We had a trigger that would previously save an image as an attachment, then use an embedded visualforce page on the layout to display that image.  I've successfully altered the code to save the image as a File, but need assistance in viewing the file in the layout.

The previous visualforce page to view attachments was this:
<apex:page standardcontroller="Medical_Information_Request__c" standardStylesheets="false" showHeader="false" sidebar="false">
    <img src="/servlet/servlet.FileDownload?file={!Medical_Information_Request__c.SignatureId__c}"/>
</apex:page>
SignatureId__c stored the Id of the attachment.  This img src url did not work for files, and I had temporary luck with viewing this image as a file with the following:
<apex:page standardcontroller="Medical_Information_Request__c" standardStylesheets="false" showHeader="false" sidebar="false">
    <img src="/sfc/servlet.shepherd/version/download/{!Medical_Information_Request__c.SignatureId__c}?asPdf=false"/>
</apex:page>
In the above, I'm saving the Id of the ContentVersion object that I saved.  I've also tried using the Id of the ContentDocument  Unfortunately, after a refresh when viewing the object page I get this error:
User-added imageWhen I try with the ContentDocument Id, the object's layout loads, but the image doesn't.

I can see the file is properly saved and it linked to the object correctly:
User-added image
If I put the SignatureID in the url, it does load:
User-added imageOne last curiousity, which might be a red herring, is that the download button on the file page gives a new Id that isn't the ContentDocument Id or the ContentVersion Id:
https://c.cs78.content.force.com/sfc/servlet.shepherd/version/download/0681k0000000FId?asPdf=false&operationContext=CHATTER
What object does this Id relate to?

I'd appreciate any assistance
I'm trying to display an image that is stored as a Document. Starting with the most basic example, I am using the following:
 
<apex:page standardcontroller="Document">

  <apex:outputField value="{!Document.name}"/>
  <apex:image id="theImage" value="!Document.Logo.jpg" width="100" height="100"/>

</apex:page>

passing the ID of the document in through the URL. It's Name displays OK, but the image does not, just showing as a 'dummy' 100x100 blank square. What syntax do I need to use? Or do I need a different approach some how?
Note, I do not want to use a Static Resource.
Thanks
Is it possible to fully package Process Builder processes, and supporting items?

If we can package them, can customer's modify them or deactivate them?

Thanks in advance
Todd
Hi all,

I am running into the CPU time limit exceeded error when I try to bulk import data into our org. Because I don't have coding knowledge myself, I was hoping to use visual workflows instead. The data that we sync has up to 22 fields that have 0's and 1's for the field input and I want to change these into "Yes" and "No" picklist values. The reason that I didn't want to use a formula field is because sometimes we also manually create records and I wanted to be able to choose Yes/No values. I also couldn't use checkboxes as per the instructions I received. 

Here is process flow I created

User-added image

What I did is I created 22 action groups for each of the binary fields. The action group criteria was to check if the picklist value is a 0 or 1 and if so, it'll kick in the immediate actions.

Here is part of the error message I received below. It seems like it's running but it's just slow..? 
Flow Details
Flow Name: Listing_Workflow_for_Binary_Fields
Type: Workflow
Version: 3
Status: Active

Flow Interview Details
Interview Label: Listing_Workflow_for_Binary_Fields-3_pba__Listing__c
Current User: Keith Kiefer (005150000066qU6)
Start time: 1/22/2017 4:13 PM
Duration: 17 seconds

How the Interview Started
Keith Kiefer (005150000066qU6) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a091500001MLez0AAD
RecursiveCountVariable = 0.00

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "1/22/2017 4:13 PM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)

DECISION: myRule_1_pmetdec
Executed this outcome: myRule_1_pmetnullrule
Outcome conditions: or
1. {!myVariable_old} (null) Is null true
Logic: One condition must be true (OR)

RECORD UPDATE: myRule_1_A1
Find all pba__Listing__c records where:
AssessmentsYN__c Equals 1
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AssessmentsYN__c = Yes
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

RECORD UPDATE: myRule_1_A2
Find all pba__Listing__c records where:
AssessmentsYN__c Equals 0
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AssessmentsYN__c = No
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

DECISION: myDecision2
Executed this outcome: myRule_3
Outcome conditions: and
1. {!formula_myRule_3} (true) Equals true
Logic: All conditions must be true (AND)

DECISION: myRule_3_pmetdec
Executed this outcome: myRule_3_pmetnullrule
Outcome conditions: or
1. {!myVariable_old} (null) Is null true
Logic: One condition must be true (OR)

RECORD UPDATE: myRule_3_A1
Find all pba__Listing__c records where:
AuctionYN__c Equals 1
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AuctionYN__c = Yes
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

RECORD UPDATE: myRule_3_A2
Find all pba__Listing__c records where:
AuctionYN__c Equals 0
Id Equals {!myVariable_current.Id} (a091500001MLez0AAD)
Update the records’ field values.
AuctionYN__c = No
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

I had a few questions regarding how the process builder operates I was hoping one of you could help me understand

1) Is there a difference between the criteria for the action group and the criteria for the immediate action? Since the flow evaluates all the actions regardless, I'm not sure if this makes much of a difference. 
2) Does flow recursion significantly increase the CPU time?
3) I was also thinking of making parallel PB flows to make the workflow look more organized on the back end. Is that okay or would it just cause more problems for me in the long run?

Thanks for reading. I might be missing a few pieces due to a lack of coding knowledge so any insight would be greatly appreciated!

I have an object with a multipicklist field. I need to filter that object based on some values chosen in the flow.Let multipicklist field may contain A;B;C etc. and if user choose B,I need to create a dynamic choice with field that contains B.  Since 'contain' doesn't work with multipicklist field, I need to use apex @InvocableMethod or Plugin method  to filter the object.
1. How can I return the filtered list of objects to the flow to create a dynamic choice. ie how to return sobject collection variable to flow.
2. If it is not possible, Is there any way to pass collection variable from apex class to flow.
3.Is there any other method to solve multipicklist('contain' doesn't work) issue.