BusinessHours object & fields not being recognised

Issue #1174 resolved
Justin Julicher created an issue

When you have the following code it shows all the BusinessHours fields & object as invalid:

   List<BusinessHours> bhs = [SELECT Name,TimeZoneSidKey, SundayStartTime, SundayEndTime, MondayStartTime, MondayEndTime, TuesdayStartTime, TuesdayEndTime, WednesdayStartTime, WednesdayEndTime, ThursdayStartTime, ThursdayEndTime, FridayStartTime, FridayEndTime, SaturdayStartTime, SaturdayEndTime FROM BusinessHours WHERE IsActive = TRUE AND Name != 'Office Hours'];

Comments (6)

  1. Scott Wells repo owner

    Hmmmm...I'm unable to reproduce that behavior. Here's what the provided statement looks like for me:

    Issue1174.png

    and that resolves to the following entry for BusinessHours in the offline symbol table:

    // Generated by Illuminated Cloud on Sun Nov 04 12:02:43 CST 2018. Do not edit.
    
    global class BusinessHours extends SObject 
    {
        global CaseChangeEvent BusinessHours;
        global List<Case> Cases;
        global User CreatedBy;
        global Id CreatedById;
        global Datetime CreatedDate;
        global static final SObjectTypeFields fields;
        global Time FridayEndTime;
        global Time FridayStartTime;
        global Boolean IsActive;
        global Boolean IsDefault;
        global User LastModifiedBy;
        global Id LastModifiedById;
        global Datetime LastModifiedDate;
        global Datetime LastViewedDate;
        global Time MondayEndTime;
        global Time MondayStartTime;
        global String Name;
        global Time SaturdayEndTime;
        global Time SaturdayStartTime;
        global SObjectType SObjectType;
        global Time SundayEndTime;
        global Time SundayStartTime;
        global Datetime SystemModstamp;
        global Time ThursdayEndTime;
        global Time ThursdayStartTime;
        global String TimeZoneSidKey;
        global Time TuesdayEndTime;
        global Time TuesdayStartTime;
        global Time WednesdayEndTime;
        global Time WednesdayStartTime;
    
        global BusinessHours()
        {
        }
    }
    

    It sounds like that object isn't being included in your OST. Can you check for its presence? If it's missing, do you mind regenerating your OST to see if that brings it in? If it doesn't, we'll need to determine why the object isn't being included.

  2. Justin Julicher reporter

    Ok. Sorry about that a full rebuild of the offline symbol table resolved the issue.

    thanks.

  3. Scott Wells repo owner

    Not a problem at all, though I'm curious about how you ended up with an OST without that object to start. Please let me know if that happens again.

  4. Justin Julicher reporter

    I'm thinking I killed Webstorm during the generation of the OST as it had frozen and so possibly left the OST in an incomplete state?

  5. Log in to comment