• Peter Theodore
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
Wondering if I can get a little help with this. My company has a very static form of a URL pattern, as follows:

https://www.mycompany.com/p/[ID]

Where [ID] is the Id of a record on our site. I'm struggling to write a REGEX to verify that a URL that matches my company's format appears in an email body. I have the email handler all set up, I just need to analyze whether a URL that appears in the body matches that format or not. I understand how to use the Pattern and Matcher classes, so all I need is the REGEX for the compiler. Any help at all would be appreciated!
Hi all,

I'm a bit stumped here, so hoping y'all can help me out. I've created a trigger on the Case object to fire the assignment rules and auto-response rules when a case is submitted from our Community (it's an unauthenticated community, so all cases coming in are using the Site Guest User for case submission). The code as it exists below works 100% of the time: 
 
trigger CaseAssignment on Case (after insert) {
    //Variable decleration
    List<Case> caseList = new List<Case>();
    User communityUserObj = new User();
    User adminUserObj = new User();
   
    if(Trigger.isAfter && Trigger.isInsert){
        //Fetching the integration user details
        communityUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'scguest' LIMIT 1];
        adminUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'peter' LIMIT 1];
           
        for (Case caseObj : Trigger.new) {
            if (UserInfo.getUserId()  == communityUserObj.Id || UserInfo.getUserId() == adminUserObj.Id) {
                caseList.add(new Case(id = caseObj.id));
            }
        }
   
        Database.DMLOptions dmo = new Database.DMLOptions();
        dmo.assignmentRuleHeader.useDefaultRule = true;
        Database.update(caseList, dmo);
    }
}
However, when I add the highlighted line of code, the user on the Community page gets an "Insufficient access on cross reference id" error:
 
trigger CaseAssignment on Case (after insert) {
    //Variable decleration
    List<Case> caseList = new List<Case>();
    User communityUserObj = new User();
    User adminUserObj = new User();
   
    if(Trigger.isAfter && Trigger.isInsert){
        //Fetching the integration user details
        communityUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'scguest' LIMIT 1];
        adminUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'peter' LIMIT 1];
           
        for (Case caseObj : Trigger.new) {
            if (UserInfo.getUserId()  == communityUserObj.Id || UserInfo.getUserId() == adminUserObj.Id) {
                caseList.add(new Case(id = caseObj.id));
            }
        }
   
        Database.DMLOptions dmo = new Database.DMLOptions();
        dmo.assignmentRuleHeader.useDefaultRule = true;
        dmo.EmailHeader.triggerAutoResponseRule = true;
        Database.update(caseList, dmo);
    }
}
I've checked all of my permissions for the Guest User and everything is working as it should, but I feel there's a permission or setting I'm missing that would get me around this error. I don't think it's a mixed DML issue, because I'd be getting that error instead, right? Any insight you have would be appreciated. Thanks!

 
I'm working with a team of my engineers and they're trying to run SOQL queries on the Opportunity object by logging in through our API-only user's account (it's the account we use for all of our integrations). I've created several custom fields to support these queries, but when they try and query on the fields they are getting a field not available error. The fields are on the page layout and FLS is read/write for the API-only user.

I'm at a loss as to why they're not able to query on these fields. They have access to other custom fields, so this seems strange to me. Please let me know if I need to provide any further info in order to help resolve this.
I've built a custom controller to handle a Chatter Publisher global action that uses a Visualforce page. I need some help writing the test class for the controller so I can deploy. Here is the code for my controller:
 
public with sharing class CreateRequestController {
    public Marketing_Request__c theRequest {get; set;}
    public String lastError {get; set;}
    public CreateRequestController() {
        theRequest = new Marketing_Request__c();
        lastError = 'error';
    }
      
    public PageReference createRequest() {
        createNewRequest();
        theRequest = new Marketing_Request__c();
        return null;
    }
       
     private void createNewRequest() {      
        try {
            insert theRequest;
            
            FeedItem post = new FeedItem();
            post.ParentId = ApexPages.currentPage().getParameters().get('id');
            post.Body = 'created a Marketing Request';
            post.type = 'LinkPost';
            post.LinkUrl = '/' + theRequest.Id;
            post.Title = 'Marketing Request For ' + theRequest.Type_of_Request__c;
            insert post;
        } catch(System.Exception ex){
           lastError = ex.getMessage();
        }
    }   
}

I've basically taken the controller code from this Salesforce reference and repurposed it: https://help.salesforce.com/HTViewHelpDoc?id=creating_vf_pages_for_custom_actions.htm

Any help would be greatly appreciated, and please let me know if you need more info.
This may be too general of a question, but I'll ask it anyway. We have a number of bulk data load jobs (for one specific object) that are stuck in the Open status under the In Progress section of the Monitor Bulk Data Load Jobs screen. We have not hit any type of limit (we're only processing 1000 records per batch, and our 24-hour API limit is in check), so I'm wondering why these jobs would be just sitting in the In Progress queue. I've attached a screenshot so you can see what I'm talking about. Thanks for any help!

User-added image
This may be too general of a question, but I'll ask it anyway. We have a number of bulk data load jobs (for one specific object) that are stuck in the Open status under the In Progress section of the Monitor Bulk Data Load Jobs screen. We have not hit any type of limit (we're only processing 1000 records per batch, and our 24-hour API limit is in check), so I'm wondering why these jobs would be just sitting in the In Progress queue. I've attached a screenshot so you can see what I'm talking about. Thanks for any help!

User-added image
Hi all,

I'm a bit stumped here, so hoping y'all can help me out. I've created a trigger on the Case object to fire the assignment rules and auto-response rules when a case is submitted from our Community (it's an unauthenticated community, so all cases coming in are using the Site Guest User for case submission). The code as it exists below works 100% of the time: 
 
trigger CaseAssignment on Case (after insert) {
    //Variable decleration
    List<Case> caseList = new List<Case>();
    User communityUserObj = new User();
    User adminUserObj = new User();
   
    if(Trigger.isAfter && Trigger.isInsert){
        //Fetching the integration user details
        communityUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'scguest' LIMIT 1];
        adminUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'peter' LIMIT 1];
           
        for (Case caseObj : Trigger.new) {
            if (UserInfo.getUserId()  == communityUserObj.Id || UserInfo.getUserId() == adminUserObj.Id) {
                caseList.add(new Case(id = caseObj.id));
            }
        }
   
        Database.DMLOptions dmo = new Database.DMLOptions();
        dmo.assignmentRuleHeader.useDefaultRule = true;
        Database.update(caseList, dmo);
    }
}
However, when I add the highlighted line of code, the user on the Community page gets an "Insufficient access on cross reference id" error:
 
trigger CaseAssignment on Case (after insert) {
    //Variable decleration
    List<Case> caseList = new List<Case>();
    User communityUserObj = new User();
    User adminUserObj = new User();
   
    if(Trigger.isAfter && Trigger.isInsert){
        //Fetching the integration user details
        communityUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'scguest' LIMIT 1];
        adminUserObj = [SELECT Id, Name, Alias FROM User where Alias = 'peter' LIMIT 1];
           
        for (Case caseObj : Trigger.new) {
            if (UserInfo.getUserId()  == communityUserObj.Id || UserInfo.getUserId() == adminUserObj.Id) {
                caseList.add(new Case(id = caseObj.id));
            }
        }
   
        Database.DMLOptions dmo = new Database.DMLOptions();
        dmo.assignmentRuleHeader.useDefaultRule = true;
        dmo.EmailHeader.triggerAutoResponseRule = true;
        Database.update(caseList, dmo);
    }
}
I've checked all of my permissions for the Guest User and everything is working as it should, but I feel there's a permission or setting I'm missing that would get me around this error. I don't think it's a mixed DML issue, because I'd be getting that error instead, right? Any insight you have would be appreciated. Thanks!

 
I'm working with a team of my engineers and they're trying to run SOQL queries on the Opportunity object by logging in through our API-only user's account (it's the account we use for all of our integrations). I've created several custom fields to support these queries, but when they try and query on the fields they are getting a field not available error. The fields are on the page layout and FLS is read/write for the API-only user.

I'm at a loss as to why they're not able to query on these fields. They have access to other custom fields, so this seems strange to me. Please let me know if I need to provide any further info in order to help resolve this.

hello,

 i have two picklist  fields(single select ) in visualforce page like select _state and select_city. when i choose values  it has to disply total records list line by line   form the custome object by satisfying criteria otherwise throw an error like 'no records found for u criteria'. (using vf,apex,custom object)

  • December 23, 2012
  • Like
  • 0