• Dano Blevins
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

Using a pure Visualforce page is there a good way to build something to upload files as a guest user that can exceed 10MB limits?

 

I have tried making it a chatter upload but it gives me a error page saying you need to login for that. The chatter upload is for a guest account ona publicly accessible site. It works great as a logged in user but this is not the intention of the site as it is a public site with no login or account creation options.

Tried using a lightning:fileUpload but it doesn't work when embedded directly into a VF page with a guest user account.

Any suggestions on what I am missing on this?

 

We have a custom object called Provider_Case__c, I need to find every Provider case that does not have an attachment called 'Licensing Inspection Report'
 
We have a lot of Provider_Case__c records and tons of attachments so if you run this without batch you will hit SOQL 50K limits. This is something I just need to run as a one off item to identify these (so we don't need automation or trigger) and if possible just have it all dump into a debug file I can download.
The following code not working and need help figuring out why.
 
global class ProviderCasesWithoutAttachments implements Database.Batchable<sObject>
{
    Set<Id> setAttachmentParentId = new Set<Id>();
    Global Database.QueryLocator start(Database.BatchableContext BC) {
       String query = 'SELECT ParentId from Attachment where parent.type = \'Provider_Case__c\' AND CreatedDate >= 2017-01-01T00:00:00Z AND Name =\'Licensing Inspection Report\' ';
       System.debug('query -> ' + query);
       return Database.getQueryLocator(query);
       }
    Global void execute(Database.BatchableContext BC, List<SObject> records) {
    List<Attachment> attchList = (List<Attachment>)records;
       
    for(Attachment a : attchList ){
        setAttachmentParentId.add(a.ParentId);
        }
        List<Provider_Case__c> lstPC =
            [SELECT Id, Name, RecordType_Name__c
            FROM Provider_Case__c
            WHERE (RecordType_Name__c = 'Annual Compliance'OR RecordType_Name__c = 'Finalized'OR RecordType_Name__c = 'Monitoring Visit') AND ID NOT IN : setAttachmentParentId];
   System.debug('These PCases Are: ' + lstPC); }
   Global void finish(Database.BatchableContext BC) {
   }
}

 

I have a list of fields on Account and an equal list of fields on Checklist_Library__c. Each field is a Boolean and there are 22 fields in total. 

I have a third object called Compliance__c which is related to both the Account and the Checklist_Library__c.  I need to look at the values and if any PAIR (from Account and Checklist_Library__c) == TRUE then Compliance__c status = "Not Applicable"

So if account.Value_1__c && Checklist_Library.Value_1__c == True, then Compliance.Status = "Not Applicable"

We are trying to do this on insert of the Compliance records and we generate approx 500 of them each time so I need to look at each compliance item and check to see if the status should be set to NA.

Each of the Compliance items are all related to 1 Account, but each Compliance item has a different Checklist_Library__c item it is related to.

So I need to loop through the Compliances being created, compare the flagged values on the Account, and see if the Compliances related Checklist_Library has any of the same named values flagged. I am trying really hard not to nest select statments inside a loop but that is what I keep running into. I list the Account values, then for each compliance item I query the related checklist libary for values in the same order and compare each value in the list and if ANY are equal, then I change status to true. Is there a better way to go about this?

We have a field on Account and on a custom object called Program that is named the same thing and I am trying to query to see which Programs have Program.Status_Internal__c that != Account.Status_Internal__c.
This is the SOQL I am trying
SELECT ID,Status_Internal__c,
(SELECT ID,Status_Internal__c FROM Program__r)
FROM Account
WERE Account.Status_Internal__c != Program__r.Status_Internal__c


This gives me two errors, one on the WHERE clause and if you remove the WHERE Clause it still gives me the following error:
ERROR at Row:2:Column:48
Didn't understand relationship 'Program__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
 
What is needed to make this QUERY work correctly?

Using a pure Visualforce page is there a good way to build something to upload files as a guest user that can exceed 10MB limits?

 

I have tried making it a chatter upload but it gives me a error page saying you need to login for that. The chatter upload is for a guest account ona publicly accessible site. It works great as a logged in user but this is not the intention of the site as it is a public site with no login or account creation options.

Tried using a lightning:fileUpload but it doesn't work when embedded directly into a VF page with a guest user account.

Any suggestions on what I am missing on this?

 

Hi! I am facing a small problem, but so far I was not able to solve this issue.
Is anyone can help me to solve this?

The function MONTH(TODAY())-3 should return 11, but I think that is return -1 and of course does not exist the month -1 :)
Redlining__Effec_Date__c <
DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY()))

 

I have a list of fields on Account and an equal list of fields on Checklist_Library__c. Each field is a Boolean and there are 22 fields in total. 

I have a third object called Compliance__c which is related to both the Account and the Checklist_Library__c.  I need to look at the values and if any PAIR (from Account and Checklist_Library__c) == TRUE then Compliance__c status = "Not Applicable"

So if account.Value_1__c && Checklist_Library.Value_1__c == True, then Compliance.Status = "Not Applicable"

We are trying to do this on insert of the Compliance records and we generate approx 500 of them each time so I need to look at each compliance item and check to see if the status should be set to NA.

Each of the Compliance items are all related to 1 Account, but each Compliance item has a different Checklist_Library__c item it is related to.

So I need to loop through the Compliances being created, compare the flagged values on the Account, and see if the Compliances related Checklist_Library has any of the same named values flagged. I am trying really hard not to nest select statments inside a loop but that is what I keep running into. I list the Account values, then for each compliance item I query the related checklist libary for values in the same order and compare each value in the list and if ANY are equal, then I change status to true. Is there a better way to go about this?

We have a field on Account and on a custom object called Program that is named the same thing and I am trying to query to see which Programs have Program.Status_Internal__c that != Account.Status_Internal__c.
This is the SOQL I am trying
SELECT ID,Status_Internal__c,
(SELECT ID,Status_Internal__c FROM Program__r)
FROM Account
WERE Account.Status_Internal__c != Program__r.Status_Internal__c


This gives me two errors, one on the WHERE clause and if you remove the WHERE Clause it still gives me the following error:
ERROR at Row:2:Column:48
Didn't understand relationship 'Program__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
 
What is needed to make this QUERY work correctly?