Skip to main content

#Collaboration12 discussing

we would like to modify some fields in our objects in that way that if they are filled in the user is prompted to attach a file or the changes cannot be saved. 

 

for example: field "invoice received date". When the user puts in the date for when he/she received the invoice, he/she gets prompted to attach the invoice otherwise he/she will not be able to save the changes. 

 

Obviously the file name has to fulfil certain requirements so we can have more than one document attached to the object.

 

I wonder if you could work with criterias or if there's an app for this. My research so far has not been successful. this idea came up in the context of setting up a paperless office. I somehow think that I cannot be the first person to be after such feature/app.   

 

I'm looking forward to hearing your tipps and tricks

 

Thanks
1 answer
  1. Sep 18, 9:32 PM

    Hi Kathrin,

    You're definitely not the first person to want this for a paperless setup! Standard Salesforce validation rules can't check whether an attachment is present before saving a record, but here are the three best ways to achieve this:

    1. Use a Visualforce Page or Flow (No-Code/Low-Code) Replace the standard record edit page with a Visualforce page or a screen Flow. When the user populates the "Invoice Received Date", you can dynamically render a file upload input on the next screen and make it a required field before allowing the final submit/save.

    2. Apex Trigger (For Strict Validation) If you want to enforce this at the database level regardless of where the record is edited:

    • Write a before update trigger on the object that checks if Invoice_Received_Date__c is changed or populated.
    • Query the Attachment (or ContentDocumentLink) child records for that object.
    • If no attachment matches your required naming criteria, use addError() to prevent the save and display your custom error message (e.g., "You must attach the invoice document before saving this date.").

    3. AppExchange Route Search the AppExchange for "Required Attachments" or "File Upload Validation" apps. There are several pre-built managed packages designed specifically to enforce mandatory file attachments based on field criteria or stage gates.

    Hope this gives you a good direction for your paperless office initiative!

0/9000
Is it possible to re-order the comments on individual ideas so that the most recent comment is at the top of the page rather than the bottom?
1 answer
  1. Sep 17, 8:22 PM

    Hi Amy,

    If you’re referring to the standard Ideas

    functionality, the comments are displayed in chronological order, with the newest comments appearing at the bottom. There isn’t a standard setting to reverse the order so the most recent comment appears first. 

     

    If having the newest comment at the top is important, it would require a custom solution, such as a custom Visualforce page/component that queries and displays the Idea comments in descending date order.

0/9000

I am looking to edit a salesforce email template to create our organization newsletter. I am using a "fully editable template". However, as I am watching a tutroial/demo it seems as though the demonstration has more editing capabilities than I do. 

 

 

On the left of their screen there is the option "Editing Modes" and either the Block Edit or the Live Edit can be enabled. When the block edit is choosen you can drag and drop into the email. My current configuration does show this level of editing and therefore I can not seem to fully edit my template. Any ideas if I need to upgrade or something?

 

 
1 answer
  1. Sep 17, 8:07 PM

    Hi Gia,

    The difference is likely related to the Email Template Builder features available in your Salesforce edition/org configuration, rather than the template itself. 

     

    The Editing Modes, including Block Edit and Live Edit, are part of the enhanced template editing experience and may not be available in every Salesforce version or configuration. The tutorial may also have been recorded in a different Salesforce release. 

     

    I’d first check which Salesforce release/edition you’re using and whether the Email Template Builder features are enabled for your org and user profile. 

     

    If you can share a screenshot of your template editor and the Salesforce edition/release, it would be easier to identify what’s missing.

0/9000
Hi there,

 

I have 2 lookup fields on our opportunities that are updated via a process builder. We want the leave these fields as lookup fields so users can click and go to that record however we dont want the users to be able to edit these fields.

 

Since you can't make lookup fields read only is there another way I could prevent the users from editing these fields.

 

I though about a validation rule but wasn't exactly sure how to set that up.

 

When the system makes an automated record update like that which user does it look like the update came from?

 

TIA!
2 answers
  1. Oct 22, 2019, 9:29 PM
    Hi Lindsay,

     

    You can make a lookup field as read-only at the page layout level if not at the global level. As you can see in the below screenshot Partner Contact is a lookup to contact object and can update as Read-only at the page layout level. Let me know if this works.

     

    Hi Lindsay, You can make a lookup field as read-only at the page layout level if not at the global level.
0/9000
Is there any way to upload SCORM files to Salesforce within the Rich Text tool? Not using an LMS, just as a video to view within our app.

 

For example, I'm able to upload a YouTube link in there but is there any way to do a SCORM file? 

 

Thank you. 

 

 
3 answers
  1. Feb 4, 2021, 9:27 PM
    I did a quick search in the Help Toolbar: SCORM and after a quick review of the results, my fastest conclusion would be to go to the AppExchange for a solution.

     

    That being said, there are other alternatives that you could use to accomplish your goal (which I'm not 100% sure I understand, but feel free to clarify).

    If all you want is a video, you could use the Rich Text Component to simply put up a link to the videos.

     

    I've also recommended CircleHD.com, it will provide detailed feedback on your users interaction with the videos you want them to watch... Contact:  Asmara Hagos, asmara.hagos@circlehd.com, 817-655-5501. Let her know I sent you.

     

    Good Luck, and please remember to mark this as the "Best Answer" if it solved your problem. 

     

    -Dominic
0/9000
Hello - 

 

I am looking for the best / easiest way to mass edit records from within a related list on custom objects.

 

I found this: https://appexchange.salesforce.com/listingDetail?listingId=a0N300000018mbBEAQ (https://appexchange.salesforce.com/listingDetail?listingId=a0N300000018mbBEAQ) but the documentation to expand to custom objects seems outdated as I can't find the templates noted to clone. 

 

 
5 answers
0/9000
Hi,

 

I am trying to mass delete files from SalesForce Content using the contentdocumentid (obtained from an export of the ContentWorkspaceDocument object).

 

The error message that I am getting is the following: "Cannot complete this operation. You cannot remove a document from its owning workspace. :  "

 

Thanks for your suggestions.
15 answers
0/9000
Is anyone done this earlier?  as we cannot merge 2 pdf files into 1 pdf file with apex, i would like to use any third party open source javascript libraries , what is the best approach or options to do this kind of requirement, any suggestions are appreciated , TIA
7 answers
  1. Jul 27, 10:12 AM

    pdf-lib is what most people use for this. Upload it as a static resource, load it in an LWC with loadScript, pull the files' base64 VersionData from Apex, merge in the browser, then save the result back as a new ContentVersion.

    Main reason to do it client-side rather than Apex: you skip the 6MB/12MB heap limit, so large files still work.

     

    const merged = await PDFLib.PDFDocument.create();for (const b64 of base64Files) {  const doc = await PDFLib.PDFDocument.load(b64);  const pages = await merged.copyPages(doc, doc.getPageIndices());  pages.forEach(p => merged.addPage(p));}const out = await merged.saveAsBase64();

    If the library misbehaves under Lightning Web Security, the usual workaround is running pdf-lib in a Visualforce page inside an iframe and passing data with postMessage.

    If you'd rather not host the library, Api2Pdf and Adobe PDF Services both do merge via callout — but the files leave your org, which rules them out for most healthcare/finance work. 

     

    https://hicglobalsolutions.com/blog/how-to-merge-and-brand-pdf-files-in-salesforce-using-lwc-visualforce-pdf-lib/

0/9000
Getting the following error: The following record failed to process. OrderItem MAS_CO2-... The issue was: Required fields are missing: [PricebookEntryId].Order Products must have a Price Book Entry that belongs to the Price Book related to the parent Order.: Price Book Entry ID. Enter a List Price.: List Price.

 

These products have a list price of 0. What do we need to do to remove the error? Please help! Thanks : )

 

 
4 answers
  1. Jul 22, 1:57 PM

    For this error , Salesforce allows users to update ListPrice(UnitPrice) on PricebookEntry. But it won't automatically reflect in OrderItem. So the ListPrice value here becomes different.  

     

    So users have to manually update to the historical value on PricebookEntry??

0/9000
When we refereshed our sandbox, most of the users email addresses were appended with ".invalid". I need to remove that for some of the users, however whenever i try to edit the user and save, it returns again with the ".invalid." How can I update the sandbox user emails? 
13 answers
  1. Jul 16, 2020, 5:23 PM
    Hi Mike,

     

    One way is to click on Edit, change the email address to remove invalid and check 'Generate new password and notify user immediately' option on the user record and then Save.

     

    This option lets you change the Email address instantly, but the users will have to reset their password using the link that is sent out to them which you can't avoid
0/9000