• SkiesnPies
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 14
    Replies
Struggling a bit with the new Lightning UI and a few short comings. 

Wondered if anyone had found any work arounds ? 

By far the biggest issue I have is clicking links and not being able to open them in a new browser tab. As standard when working, I am forever holding Cmd down (probably ALT on windows) to open a document in a new tab of my browser. I often want to open several documents or settings all in different tabs (for a million different reasons). Since everything moved to JS, there are no <A> tags on the page, only JS events, so you don't get the option when right clicking on links to open in a new tab (or if you do, it tries to open a javascript statement and fails), its all now behaving like a single page application, but one that is worse than the prior classic UI. 

Does anyone else know a way around this? 

Other minor frustrations -
1)  there doesn't seem to be an icon to refresh views - you have to re-load the whole page (slow). 
2) Breadcrumbs are largely absent - so its not easy to go back to the last place you were. 
3) Its extra clicks to open tabs (I can't believe they didn't make the home navigator customisable from day 1). 

I am sure they will get there with the new UI and I am sure it will be great when they do, but feeling as though I might advise my clients to "hang on a bit" before switching. 
Struggling a bit with the new Lightning UI and a few short comings. 

Wondered if anyone had found any work arounds ? 

By far the biggest issue I have is clicking links and not being able to open them in a new browser tab. As standard when working, I am forever holding Cmd down (probably ALT on windows) to open a document in a new tab of my browser. I often want to open several documents or settings all in different tabs (for a million different reasons). Since everything moved to JS, there are no <A> tags on the page, only JS events, so you don't get the option when right clicking on links to open in a new tab (or if you do, it tries to open a javascript statement and fails), its all now behaving like a single page application, but one that is worse than the prior classic UI. 

Does anyone else know a way around this? 

Other minor frustrations -
1)  there doesn't seem to be an icon to refresh views - you have to re-load the whole page (slow). 
2) Breadcrumbs are largely absent - so its not easy to go back to the last place you were. 
3) Its extra clicks to open tabs (I can't believe they didn't make the home navigator customisable from day 1). 

I am sure they will get there with the new UI and I am sure it will be great when they do, but feeling as though I might advise my clients to "hang on a bit" before switching. 
Hi, I have had lots of problems getting a PDF rendered with images that live in attachments. The attachments render beautifully when my VF page is presented in HTML, but as soon as I say renderas="PDF" the images become broken.

Neither of these tags work : 
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/> 
<img src="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
(note: I deliberately set the URL to the full path during testing / experimentation). 

I have read that you need to set your remote site settings to contain your server, so the PDF generation can look back to Salesforce to see the records, see below for my settings. 

Should this work? Are my remote site settings wrong or did I fundamentally miss something? Thanks in advance. 

Broken Image
Remote site settings
Hi, I have a problem with images not rendering correctly in my PDF's if I use getContentAsPDF . They they render fine if I view them in the VF page directly in the browser though (so I know the URL works fine for my image). 

My VF page has an image tag like this : 
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>    

Note : I hard coded the full instance name as a test - I have tried also using just a relative path

When I open my page and pass in the attachment ID, the image renderes fine but when running from my my VF controller using getContentAsPDF (I am wanting to attach the PDF as an attachment to a custom object) , the image displays broken like this : 

Broken Image

I had read that it was possible to do what I am doing, and I read you needed to set up remote site settings - which I did (see screen shot below) 

Remote site settings
Did I get my remote site settings wrong? Is what I am trying to do actually possible? Did I do something dumb? It seems a viable way to do things but I am stumped as to why it won't now work....

Any ideas? 
Hi, I have a problem iwth images not rendering correctly in my PDF's if I use getContentAsPDF . They they render fine if I view them in the VF page directly in the browser though (so I know the URL works fine for my image). 

My VF page has an image tag like this : 
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>    

Note : I hard coded the full instance name as a test - I have tried also using just a relative path

When I open my page and pass in the attachment ID, the image renderes fine but when running from my my VF controller using getContentAsPDF (I am wanting to attach the PDF as an attachment to a custom object) , the image displays broken like this : 

Broken Image

I had read that it was possible to do what I am doing, and I read you needed to set up remote site settings - which I did (see screen shot below) 

Remote site settings
Did I get my remote site settings wrong? Is what I am trying to do actually possible? Did I do something dumb? It seems a viable way to do things but I am stumped as to why it won't now work....

Any ideas? 

Have a strange problem stopping a go live today :

 

Am creating a page reference in order to diver to an external site. 

 

The URL I am diverting to (not real) is : 

https://mydomain.redirect.php?obcdefghijklmn

 

so I have

 

String mystring = 'https://mydomain.redirect.php?obcdefghijklmn';

and then

PageReference redirectPage = new PageReference(mystring);

redirectPage.setRedirect(true);

return redirectPage;

 

however what I end up with in my divert is : 

https://mydomain.redirect.php

 

 

and if change my code to do this : 

PageReference redirectPage = new PageReference(mystring);

system.debug('StoredURL=' + redirectPage.getURL());

redirectPage.setRedirect(true);

return redirectPage;

 

the debugger shows the same 

https://mydomain.redirect.php

 

ie. it has lost all the parameters?????

 

What I did find is that Apex doesn't do this if the URL is 

https://mydomain.redirect.php?MYPARAM=obcdefghijklmn;

 

But it seems rather unfair that SFDC is making decisions about what is a valid URL and what isn't - as the PHP URL's all get broken (I can't control what URL's I will get as they come from an API call out). 

 

Any suggestions? I know I could return the string to my VF page and divert using JS but for security reasons (don't ask) I can't do this.....

 

 

Hi, I have a requirement to intercept the save event on a standard object (Task in this case) and based on criteria in  the task, possibly divert to a VF page. 

 

On existing records (ie. when the users clicks the EDIT button), this is straightforward with the following steps :

  • Customise the EDIT button to add a &saveURL to the URL when opening the task in editmode, the SaveURL will divert on save to VFpage1 and pass VFPage1 the parameter of the Task that is being edited.
  • VFPage1's controller can then lookup the task using the supplied ID and decide based on the task values if it should divert to VFPage2 or just go back to the saved task.  

This works nicely, however : 

 

Problem is : 

How to replicate this functionality for NEW task records. At the time the task is created , I can't pass the ID of the record to VFPage1 as the task at this stage doesn't have an ID, so VFPage1 is unable to lookup the task that just got saved. How to get my new ID into some code somewhere to make this divert decision?

 

I could do it in Javascript if I could make the task save to a "ready only" version of itself when it was saved, but again, the &SAVEURL to make it do this would need the ID of the task which doesn't yet exist.

 

Is there any way to  code this ? I just want to be able to make a decision in either VF, Apex or Javascript as to where to go when my new task saves based on values in the Task record. 

 

Thanks in advance......

 

 

 

Had some problems in IE9 with a VF page being called from a modal popup (works fine in all other browsers). The problem is when I clicked my NEXT button to re-render the page (see example below), it popped up a NEW window (so I now have 2 pop up windows open) instead of re-rendering . 

 

Anyway, when debugging this, I found it was much worse (the page wasn't working at all in IE) so built the following test page to test it with very simple code:

 

<apex:pagecontroller="TestIE"  title="Test IE 2x Pages">

<apex:form>

 

<apex:pageBlockrendered="{!ShowPage2=false}">

PAGE1<br/>

        <apex:outputTextstyleclass="labelCol">Value ($US)</apex:outputText>

        <apex:InputTextid="Value"value="{!DollarValueString}"/>  

</apex:pageBlock>

 

 

<apex:pageBlockrendered="{!ShowPage2=true}">

PAGE2<br/>

        <apex:outputTextstyleclass="labelCol">The Name</apex:outputText>

        <apex:InputTextid="TheName"value="{!TheName}"/>  

</apex:pageBlock>

 

<apex:commandButtonvalue="Next"action="{!ShowPageTwo}"rendered="{!ShowPage2==false}"/>

</apex:form>

</apex:page>

 

then my controller code : 

 

publicwithsharingclass TestIE {

 

public String TheName{get;set;}

public String DollarValueString{get;set;}

public Boolean ShowPage2 {get;set;}

 

// Test Init

public TestIE()

{

TheName = 'Example Name';

DollarValueString = '999';

ShowPage2 = false;

 

} // end init

 

// *********************************************

// *********** Switch To Next Page *************

// *********************************************

public PageReference ShowPageTwo()

{

ShowPage2 = true;

returnnull;

 

} // end method

 

 

} // end class

 

Didn't seem as though I could make that much simpler? Its just 2 screens which change when you click "NEXT".  It works fine in all browsers (I am on Winter13 in a sandbox by the way) but in IE the NEXT button does nothing and when I checked I have a number of JS errors!

 

SCRIPT16385: Not implemented

SfdcCore.js, line 71 character 160
SCRIPT5009: 'Sfdc' is undefined
VFState.js, line 1 character 1
SCRIPT16385: Not implemented

main.js, line 944 character 160
SCRIPT438: Object doesn't support property or method 'hook_isAccessibleMode'
main.js, line 431 character 71
SCRIPT438: Object doesn't support property or method 'hook_isAccessibleMode'
main.js, line 431 character 71
SCRIPT5009: 'Sfdc' is undefined
main.js, line 998 character 35
SCRIPT5009: 'Sfdc' is undefined
testie, line 85 character 1
SCRIPT5009: 'SfdcApp' is undefined
main.js, line 197 character 174

 

I know using IE is asking for trouble but I would have thought standard VF would be ok (the client has it as standard so I need to make it work in IE). ? 

 

Anyone have any suggestions on what the JS errors are and what is wrong with my nice and simple page? Second question I guess is why the new popup window opens but I guess I need to sort the above issue first. Thanks in advance. 

Is it possible to traverse the configuration objects in APEX script? 

 

I would like run a trigger from the USER object which checks to see if the user appears on any approval configurations before I allow the user record to be made in-active (I don't mean check to see if they have OUTSTANDING approvals but I mean check if they could ever appear on ANY approvals in the future - ie. are they listed in any approval steps). 

 

Does Salesforce expose these objects to developers? I have had a search for these objects but the only ones I can find relating to approvals relate to firing off and managing an approval process on an existing object. 

 

Note: a bit of an APEX newbie alert (been a developer for years but new to APEX and quite new to SF). :smileyhappy:

 

Thanks in advance. 

Struggling a bit with the new Lightning UI and a few short comings. 

Wondered if anyone had found any work arounds ? 

By far the biggest issue I have is clicking links and not being able to open them in a new browser tab. As standard when working, I am forever holding Cmd down (probably ALT on windows) to open a document in a new tab of my browser. I often want to open several documents or settings all in different tabs (for a million different reasons). Since everything moved to JS, there are no <A> tags on the page, only JS events, so you don't get the option when right clicking on links to open in a new tab (or if you do, it tries to open a javascript statement and fails), its all now behaving like a single page application, but one that is worse than the prior classic UI. 

Does anyone else know a way around this? 

Other minor frustrations -
1)  there doesn't seem to be an icon to refresh views - you have to re-load the whole page (slow). 
2) Breadcrumbs are largely absent - so its not easy to go back to the last place you were. 
3) Its extra clicks to open tabs (I can't believe they didn't make the home navigator customisable from day 1). 

I am sure they will get there with the new UI and I am sure it will be great when they do, but feeling as though I might advise my clients to "hang on a bit" before switching. 
Hi, I have had lots of problems getting a PDF rendered with images that live in attachments. The attachments render beautifully when my VF page is presented in HTML, but as soon as I say renderas="PDF" the images become broken.

Neither of these tags work : 
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/> 
<img src="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>
(note: I deliberately set the URL to the full path during testing / experimentation). 

I have read that you need to set your remote site settings to contain your server, so the PDF generation can look back to Salesforce to see the records, see below for my settings. 

Should this work? Are my remote site settings wrong or did I fundamentally miss something? Thanks in advance. 

Broken Image
Remote site settings
Hi, I have a problem with images not rendering correctly in my PDF's if I use getContentAsPDF . They they render fine if I view them in the VF page directly in the browser though (so I know the URL works fine for my image). 

My VF page has an image tag like this : 
<apex:image url="https://c.na11.visual.force.com/servlet/servlet.FileDownload?file={!AttachmentID}"/>    

Note : I hard coded the full instance name as a test - I have tried also using just a relative path

When I open my page and pass in the attachment ID, the image renderes fine but when running from my my VF controller using getContentAsPDF (I am wanting to attach the PDF as an attachment to a custom object) , the image displays broken like this : 

Broken Image

I had read that it was possible to do what I am doing, and I read you needed to set up remote site settings - which I did (see screen shot below) 

Remote site settings
Did I get my remote site settings wrong? Is what I am trying to do actually possible? Did I do something dumb? It seems a viable way to do things but I am stumped as to why it won't now work....

Any ideas? 
Hi, I tried to report this bug to salesforce, but was redirected here.
This is very likely internal salesforce issue.
When you try to do any operation with integer received from lightning component (@AuraEnabled), you got 
FATAL_ERROR|Internal Salesforce.com Error
 
public with sharing class TestController2 {
    @AuraEnabled
    public static integer getTestResult(integer pageNumber) {
        return pageNumber + 1;
    }
}


Full log included:
34.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
23:30:39.143 (143052245)|EXECUTION_STARTED
23:30:39.143 (143081946)|CODE_UNIT_STARTED|[EXTERNAL]|01pU0000001YzfB|TestController2.getTestResult
23:30:39.143 (143501666)|METHOD_ENTRY|[1]|01pU0000001YzfB|TestController2.TestController2()
23:30:39.143 (143599706)|SYSTEM_MODE_ENTER|false
23:30:39.143 (143634027)|SYSTEM_MODE_EXIT|false
23:30:39.143 (143644512)|METHOD_EXIT|[1]|TestController2
23:30:39.144 (144047168)|FATAL_ERROR|Internal Salesforce.com Error
23:30:39.144 (144066440)|CUMULATIVE_LIMIT_USAGE
23:30:39.144 (144066440)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

23:30:39.144 (144066440)|LIMIT_USAGE_FOR_NS|Vendavo|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

23:30:39.144 (144066440)|CUMULATIVE_LIMIT_USAGE_END

23:30:39.144 (144134140)|CODE_UNIT_FINISHED|TestController2.getTestResult
23:30:39.147 (147174875)|EXECUTION_FINISHED

Note that system.debug('pageNumber: ' + pageNumber); works. But all other integer operations fail.
Please advise how to circumvent this issue.

Have a strange problem stopping a go live today :

 

Am creating a page reference in order to diver to an external site. 

 

The URL I am diverting to (not real) is : 

https://mydomain.redirect.php?obcdefghijklmn

 

so I have

 

String mystring = 'https://mydomain.redirect.php?obcdefghijklmn';

and then

PageReference redirectPage = new PageReference(mystring);

redirectPage.setRedirect(true);

return redirectPage;

 

however what I end up with in my divert is : 

https://mydomain.redirect.php

 

 

and if change my code to do this : 

PageReference redirectPage = new PageReference(mystring);

system.debug('StoredURL=' + redirectPage.getURL());

redirectPage.setRedirect(true);

return redirectPage;

 

the debugger shows the same 

https://mydomain.redirect.php

 

ie. it has lost all the parameters?????

 

What I did find is that Apex doesn't do this if the URL is 

https://mydomain.redirect.php?MYPARAM=obcdefghijklmn;

 

But it seems rather unfair that SFDC is making decisions about what is a valid URL and what isn't - as the PHP URL's all get broken (I can't control what URL's I will get as they come from an API call out). 

 

Any suggestions? I know I could return the string to my VF page and divert using JS but for security reasons (don't ask) I can't do this.....

 

 

Hi, I have a requirement to intercept the save event on a standard object (Task in this case) and based on criteria in  the task, possibly divert to a VF page. 

 

On existing records (ie. when the users clicks the EDIT button), this is straightforward with the following steps :

  • Customise the EDIT button to add a &saveURL to the URL when opening the task in editmode, the SaveURL will divert on save to VFpage1 and pass VFPage1 the parameter of the Task that is being edited.
  • VFPage1's controller can then lookup the task using the supplied ID and decide based on the task values if it should divert to VFPage2 or just go back to the saved task.  

This works nicely, however : 

 

Problem is : 

How to replicate this functionality for NEW task records. At the time the task is created , I can't pass the ID of the record to VFPage1 as the task at this stage doesn't have an ID, so VFPage1 is unable to lookup the task that just got saved. How to get my new ID into some code somewhere to make this divert decision?

 

I could do it in Javascript if I could make the task save to a "ready only" version of itself when it was saved, but again, the &SAVEURL to make it do this would need the ID of the task which doesn't yet exist.

 

Is there any way to  code this ? I just want to be able to make a decision in either VF, Apex or Javascript as to where to go when my new task saves based on values in the Task record. 

 

Thanks in advance......

 

 

 

Had some problems in IE9 with a VF page being called from a modal popup (works fine in all other browsers). The problem is when I clicked my NEXT button to re-render the page (see example below), it popped up a NEW window (so I now have 2 pop up windows open) instead of re-rendering . 

 

Anyway, when debugging this, I found it was much worse (the page wasn't working at all in IE) so built the following test page to test it with very simple code:

 

<apex:pagecontroller="TestIE"  title="Test IE 2x Pages">

<apex:form>

 

<apex:pageBlockrendered="{!ShowPage2=false}">

PAGE1<br/>

        <apex:outputTextstyleclass="labelCol">Value ($US)</apex:outputText>

        <apex:InputTextid="Value"value="{!DollarValueString}"/>  

</apex:pageBlock>

 

 

<apex:pageBlockrendered="{!ShowPage2=true}">

PAGE2<br/>

        <apex:outputTextstyleclass="labelCol">The Name</apex:outputText>

        <apex:InputTextid="TheName"value="{!TheName}"/>  

</apex:pageBlock>

 

<apex:commandButtonvalue="Next"action="{!ShowPageTwo}"rendered="{!ShowPage2==false}"/>

</apex:form>

</apex:page>

 

then my controller code : 

 

publicwithsharingclass TestIE {

 

public String TheName{get;set;}

public String DollarValueString{get;set;}

public Boolean ShowPage2 {get;set;}

 

// Test Init

public TestIE()

{

TheName = 'Example Name';

DollarValueString = '999';

ShowPage2 = false;

 

} // end init

 

// *********************************************

// *********** Switch To Next Page *************

// *********************************************

public PageReference ShowPageTwo()

{

ShowPage2 = true;

returnnull;

 

} // end method

 

 

} // end class

 

Didn't seem as though I could make that much simpler? Its just 2 screens which change when you click "NEXT".  It works fine in all browsers (I am on Winter13 in a sandbox by the way) but in IE the NEXT button does nothing and when I checked I have a number of JS errors!

 

SCRIPT16385: Not implemented

SfdcCore.js, line 71 character 160
SCRIPT5009: 'Sfdc' is undefined
VFState.js, line 1 character 1
SCRIPT16385: Not implemented

main.js, line 944 character 160
SCRIPT438: Object doesn't support property or method 'hook_isAccessibleMode'
main.js, line 431 character 71
SCRIPT438: Object doesn't support property or method 'hook_isAccessibleMode'
main.js, line 431 character 71
SCRIPT5009: 'Sfdc' is undefined
main.js, line 998 character 35
SCRIPT5009: 'Sfdc' is undefined
testie, line 85 character 1
SCRIPT5009: 'SfdcApp' is undefined
main.js, line 197 character 174

 

I know using IE is asking for trouble but I would have thought standard VF would be ok (the client has it as standard so I need to make it work in IE). ? 

 

Anyone have any suggestions on what the JS errors are and what is wrong with my nice and simple page? Second question I guess is why the new popup window opens but I guess I need to sort the above issue first. Thanks in advance. 

Hi,

 

When i use the following query for deleting the contentversion stored files,

 

List<contentVersion> lstCV = [select id from contentversion];
system.debug('----->'+lstCV.size());
delete lstCV;

 

 

i got the below error.

 

line 3, column 1: DML operation DELETE not allowed on ContentVersion

 

 

Can any one please tell me, how can i delete the multiple records through a list from contentversion?

Is it possible to traverse the configuration objects in APEX script? 

 

I would like run a trigger from the USER object which checks to see if the user appears on any approval configurations before I allow the user record to be made in-active (I don't mean check to see if they have OUTSTANDING approvals but I mean check if they could ever appear on ANY approvals in the future - ie. are they listed in any approval steps). 

 

Does Salesforce expose these objects to developers? I have had a search for these objects but the only ones I can find relating to approvals relate to firing off and managing an approval process on an existing object. 

 

Note: a bit of an APEX newbie alert (been a developer for years but new to APEX and quite new to SF). :smileyhappy:

 

Thanks in advance. 

Is there any way to mass delete records in a custom object (table)?  The Mass Delete feature under Setup -> Administration Setup -> Data Management -> Mass Delete Records  only seems to perform a mass delete for SDFC standard objects....

 

It is pretty painful to delete records one by one - phew!!

 

 

  • December 21, 2009
  • Like
  • 0