• MGimelli
  • NEWBIE
  • 10 Points
  • Member since 2016
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
I am using a lightning:datatable to display various fields, including a URL field which links to a printable PDF.

In the Spring 18 release, the URL field in the datatable now points to "javascript:void(0)" in the href attribute and the title attribute now contains the url which I am trying to set in the href field. 

Can someone please provide me a code example on how to get the href refrecne to work correctly?
Hi - 

I have an inline visualforce page, which is pretty basic: 

<apex:page standardController="Account" tabStyle="Account">
    <script src="https://code.jquery.com/jquery-1.11.2.js"></script>
    <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
    <script src="/support/console/29.0/integration.js" type="text/javascript"></script>
    <apex:includeScript value="/soap/ajax/32.0/connection.js"/>
    <apex:includeScript value="/soap/ajax/32.0/apex.js"/>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/redmond/jquery-ui.css"/>
    <apex:form id="formID">
        <apex:pageBlock title="Add/Update Account Address" >
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Update Account Address" action="{!save}" id="inlineEditSave" onclick="RefreshPrimaryTab('{!Account.Id}')"/>
                <!-- <apex:commandLink value="Update Account Address" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/> -->
            </apex:pageBlockButtons>
            <apex:messages />
            <apex:pageBlockSection title="Add/Update Account Address" collapsible="false">
                <apex:repeat id="fieldSetRepeat" value="{!$ObjectType.Account.FieldSets.SampleFieldSet}" 
                var="field">
                    <apex:inputField value="{!Account[field]}" required="{!field.required}"/>
                </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <script type="text/javascript">
            function RefreshPrimaryTab(id) 
            {    
                if(sforce.console.isInConsole()) {
                    // alert(sforce.console.isInConsole());
                    sforce.console.getFocusedPrimaryTabId(showTabId);
                } else {
                    //Standard functionality
                }
            }

            var showTabId = function showTabId(result) 
            {
                var tabId = result.id;
                alert('Primary Tab IDs: primaryTabId ' + tabId );
                sforce.console.refreshPrimaryTabById(tabId, true);
            };       

        </script>
    </apex:form>
</apex:page>


On my page, I have a fieldset to utilize a mananaged package for Address updates. The fieldset contains the Address fields on the Account object, the user enters their data and hits the "Add Update Account Address", which performs the standard "Save" action. I need to reload the page in the Service Console to show the user the updated address. Unfortuantely, the javascript I have written fires faster than the records save to the database, so it is showing as the old value. 

Any assistance is greatly appreciated. 

Thanks, 

Mikayla
 

Hi - 
I have a probelm where I need to query back all content documents in my system to then run a scheduled job to clean up old documents. I am finding certian docuemtns I can only query if I explicitly set the Id in the WHERE clause, for example: 

SELECT Id
FROM ContentDocument
WHERE Title LIKE 'Some Document'

This query returns no results. But if I do a search in Salesforce of "Some Document", document results come back with this title. I can grab one of those documents Ids and run a query like this: 

SELECT Id
FROM ContentDocument
WHERE Id = '069...."

And the query would return a result with a title of "Some Document" 

I have tried adding the "USING SCOPE Team" qualifier in the "FROM" clause, and had some success with this, but I am still not able to query all documents in Salesforce. Does anyone have any suggestions on how I can query back ALL docuemnts? I have a system admin profile. 

Thanks, 

Mikayla 

Hi - 

We have a schedueld job that is designed to remove old documents that no longer need to be in our system. It appears around 6/20 (Summer 16?) permissions were changed and we were not able to query all documents via the system administrator profile. I have fixed this issue by adding "USING SCOPE Team" to our query.

I am now receving an "INSUFFICIENT_ACCESS_OR_READONLY" on the Content Document object when trying to run the delete through a class ran by a schedueld job. I have tested a one off delete of the object via the Developer console and am able to successfully delete the job thorugh there. I have also checked my class to ensure the job is running under my profile, which it is. 

It seems strange to me I can run a detele through the developer console but am unable too when running the schedueld job on the same object.

Code Snippit: 

//scope in this case is passed in as an SObject of ContentDocument
global void execute(Database.BatchableContext BC,List<SObject> scope) {
 if( dataCleanup.Delete__c )
            delete scope;
}
I am using a lightning:datatable to display various fields, including a URL field which links to a printable PDF.

In the Spring 18 release, the URL field in the datatable now points to "javascript:void(0)" in the href attribute and the title attribute now contains the url which I am trying to set in the href field. 

Can someone please provide me a code example on how to get the href refrecne to work correctly?
Hi - 

I have an inline visualforce page, which is pretty basic: 

<apex:page standardController="Account" tabStyle="Account">
    <script src="https://code.jquery.com/jquery-1.11.2.js"></script>
    <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
    <script src="/support/console/29.0/integration.js" type="text/javascript"></script>
    <apex:includeScript value="/soap/ajax/32.0/connection.js"/>
    <apex:includeScript value="/soap/ajax/32.0/apex.js"/>
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/redmond/jquery-ui.css"/>
    <apex:form id="formID">
        <apex:pageBlock title="Add/Update Account Address" >
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Update Account Address" action="{!save}" id="inlineEditSave" onclick="RefreshPrimaryTab('{!Account.Id}')"/>
                <!-- <apex:commandLink value="Update Account Address" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/> -->
            </apex:pageBlockButtons>
            <apex:messages />
            <apex:pageBlockSection title="Add/Update Account Address" collapsible="false">
                <apex:repeat id="fieldSetRepeat" value="{!$ObjectType.Account.FieldSets.SampleFieldSet}" 
                var="field">
                    <apex:inputField value="{!Account[field]}" required="{!field.required}"/>
                </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <script type="text/javascript">
            function RefreshPrimaryTab(id) 
            {    
                if(sforce.console.isInConsole()) {
                    // alert(sforce.console.isInConsole());
                    sforce.console.getFocusedPrimaryTabId(showTabId);
                } else {
                    //Standard functionality
                }
            }

            var showTabId = function showTabId(result) 
            {
                var tabId = result.id;
                alert('Primary Tab IDs: primaryTabId ' + tabId );
                sforce.console.refreshPrimaryTabById(tabId, true);
            };       

        </script>
    </apex:form>
</apex:page>


On my page, I have a fieldset to utilize a mananaged package for Address updates. The fieldset contains the Address fields on the Account object, the user enters their data and hits the "Add Update Account Address", which performs the standard "Save" action. I need to reload the page in the Service Console to show the user the updated address. Unfortuantely, the javascript I have written fires faster than the records save to the database, so it is showing as the old value. 

Any assistance is greatly appreciated. 

Thanks, 

Mikayla
 

Hi - 
I have a probelm where I need to query back all content documents in my system to then run a scheduled job to clean up old documents. I am finding certian docuemtns I can only query if I explicitly set the Id in the WHERE clause, for example: 

SELECT Id
FROM ContentDocument
WHERE Title LIKE 'Some Document'

This query returns no results. But if I do a search in Salesforce of "Some Document", document results come back with this title. I can grab one of those documents Ids and run a query like this: 

SELECT Id
FROM ContentDocument
WHERE Id = '069...."

And the query would return a result with a title of "Some Document" 

I have tried adding the "USING SCOPE Team" qualifier in the "FROM" clause, and had some success with this, but I am still not able to query all documents in Salesforce. Does anyone have any suggestions on how I can query back ALL docuemnts? I have a system admin profile. 

Thanks, 

Mikayla 

Hi - 

We have a schedueld job that is designed to remove old documents that no longer need to be in our system. It appears around 6/20 (Summer 16?) permissions were changed and we were not able to query all documents via the system administrator profile. I have fixed this issue by adding "USING SCOPE Team" to our query.

I am now receving an "INSUFFICIENT_ACCESS_OR_READONLY" on the Content Document object when trying to run the delete through a class ran by a schedueld job. I have tested a one off delete of the object via the Developer console and am able to successfully delete the job thorugh there. I have also checked my class to ensure the job is running under my profile, which it is. 

It seems strange to me I can run a detele through the developer console but am unable too when running the schedueld job on the same object.

Code Snippit: 

//scope in this case is passed in as an SObject of ContentDocument
global void execute(Database.BatchableContext BC,List<SObject> scope) {
 if( dataCleanup.Delete__c )
            delete scope;
}