• JWikk
  • NEWBIE
  • 40 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 20
    Replies
I am succesfully creating contentversion through the SOAP API, but when creating a contentdocument link (that links my document to another object record) I get an error: INSUFFICIENT_ACCESS_OR_READONLY

What access does the authenticated user need for proper access? Is it to do with the object I am linking the content file to? If so, what permission is needed?
  • May 12, 2017
  • Like
  • 0
Sometimes our soap endpoint fails to handle our outbound messages and SF gets to retry over the next 24 hours. However, what happens if the triggering user has since logged out and we include their session id in the outbound message? Does the message continue to try in vain? Or is the session id kept valid even though the user has logged out?
  • March 24, 2017
  • Like
  • 0
I want to ensure that a page layout is only useful for Salesforce1 or mobile browser app only. It looks like I can only assign by profile, as opposed to also when same use is using mobile device.

How do I not only assign a page layout to a profile but also say to use this only for mobile devices?

  • April 30, 2014
  • Like
  • 0
In SF1, what is the quickest way to get a list of records of a custom object?

Is it really flexible pages or can I enable an object for mobile use to see it in the SF1 app?
  • April 30, 2014
  • Like
  • 0

We register users through the Site.createPortalUser function where we send email to the new user.

 

userId = Site.createPortalUser(u, accountId, registerPassword,true);

 The standard email template contains information of the username and password. However, we were hoping we could also send them a unique generated url that they would click on to confirm that they own the given email account. This would activate the user's access.

 

Has anyone done this with registration of portal users?

  • October 30, 2013
  • Like
  • 0

When we add field level help (the question mark hover), the field help works in Salesforce. However, on the customer portal the hover text doesn't show.

 

Anyone come across this?

  • October 03, 2013
  • Like
  • 0

There are lots sample code and getting started, but no documentation (that I could find) about the methods available in the SDK itself. We happen to be building an android hybrid app, but where is the API guide for the mobile SDK for hybrid use?

  • September 27, 2013
  • Like
  • 0

How can I tell in a Contact record whether it has been portal enabled? The only flag I see is can self-register.

 

When I view contact, the portal button on the contact knows the contact is portal enabled with a different menu. How can I tell by looking at the same contact record when I query?

  • September 13, 2013
  • Like
  • 0

When do you need to setup a connected app configuration? We have a native iPad app that uses Oath2 and the native SF login page without needing a Connected app config in this org. When is this required?

  • August 23, 2013
  • Like
  • 0

We are using the template SiteRegistration Sites VF page to allow users to login. And made a minor controller code change to the PORTAL_ACCOUNT_ID as per instructions on : http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites

 

We successfully register one user, but after the 2nd attempt of a another new user, we get the message 'You are already logged in'

 

We used the template, made only a minor change. What did we do wrong?

 

We are thinking it may be that we can't re-use the same account id? But has anyone else got this before?

 

James

BasicGov Systems

  • June 14, 2013
  • Like
  • 0

Hi we are used to customer portal and also creating VF pages in regular SF. We are used to querying data in our constructor by first passing in an id which is read of the URL.

 

However with Sites, there are no more standard pages so the id is harder to pass around between VF pages. Is there a resource on how to setup our own header and sidebar as a template while jumping from one custom VF page to another(drill down)? What's the best practice?

 

More specifically when a user clicks on the name field link on one VF page (list), how do we jump to another VF page (detail)? Do we just prepend /apex/pagename to url targets?

 

Also do you have header and sidebar visualforce pages as includes when using the VF page in Force.com Sites?

 

Any documentation that provides a way to think through user navigation?

 

-James

  • May 16, 2013
  • Like
  • 0

I cloned an authenticated website profile so I can edit the profile's objects settings. However, I cannot see our custom objects with this profile and the authenticated website license.

 

What do I need to do to see my objects under Object Settings so I can set read/write permissions? My objects are currently Public Read/Write. Do I need to create sharing rules?

 

Currently our behaviour is that the authenticated website user can view our VF page, but cannot see the controller's list of records successfully queried (rows show blank).

  • May 14, 2013
  • Like
  • 0

Hi there, our code is describing a list of sobjects. The describe call is returning with the error: "INVALID_TYPE: sObject type 'MUSW__Permit__c' is not supported."

 

We know this is due to the profile not given any permissions on a particular object in the list. How do we check in the code to see if the user's profile has access to the objects first and then call describe on the list?

 

The situation is in an scontrol, but we need to learn how to do this in apex also. Our main concern is that describe calls are expensive in time, so we want to minimize the amount of describe calls to make.

 

Ideas?

 

  • March 03, 2012
  • Like
  • 0

Within the Mobile SDK, is there the ability to access the SF Offline edition database? If not, is that was the Adobe AIR SDK is for?

 

James

 

  • January 17, 2012
  • Like
  • 0

When we install our managed code in our client environment the system.debug statements are no longer visible. Is there a way to find out how the code is doing in the installed environment? Normally, code is not visible in the install environment but we would like to have the occasional debug line showing so we can see what data is causing our classes to fail. We heard assertions show, but is that only when evaluate to false?

 

Ideas?

  • December 15, 2011
  • Like
  • 0

We have trigger code (after update) running twice due to a workflow field update. The code works with values unrelated to the field update rule. We do check if the trigger.old fields != trigger.new fields (field values were actually changed). However, we can't tell that the trigger code already did the work and so should exit before performing the same work again. We have experimented with static variables and static methods and it looks promising so far.

 

If(TriggerTransaction.isPosted(payments[i].id) && payments[i].BGBK__Amount__c != null)
        	continue;
        Else
        	TriggerTransaction.post(payments[i].id);

 

 

Does anyone have best practice code snippets to handle this situation?

 

Note:

As per SF order of execution, triggers are run first, then workflow is run and if there were updates run triggers again. 

 

James

BasicGov Systems

  • November 24, 2011
  • Like
  • 0

Hi we are integrating our salesforce app with REST webservice from ESRI. It happens to be a geocoder service.

 

Each of our clients may have a different service host, name, and parameters. What is the best way to develop this connection while still being configurable across each of our clients? If we use custom settings, should I create one for each service?

 

So far I have 3 methods:

 

buildRequest

sendRequest

receiveRequest

 

James

BasicGov.com

  • December 16, 2010
  • Like
  • 0

is it possible to have javascript run upon opening a visual page? I know I can get the apex controller constructor to run, but I want javascript to access the browser url.

 

The following only works in development mode:

<script type="text/javascript">
    
    var detailURL= parent.document.referrer;
    detailURL = detailURL.substring(detailURL.lastIndexOf('/')+1);

    function init() {
        
        if ((detailURL > "" ) && (detailURL.length == 15)) {
            alert('pushing '+detailURL);
            nowPushURL(detailURL);
            
        }
    }
    parent.onload = init; //window.onload;
    </script>

 

  • September 20, 2010
  • Like
  • 0

is there a way to convert a list of sobjects into a string?  I don't really care about the format, just that the field values can be string searched. Something like this:

 

 

List<sobject> pparcels = database.query('select ...');
String relatedMatches = pparcels.toString(); //toString doesn't exist
if (relatedMatches.indexOf(affectedIds[i]) > -1) {
...
}

 

 

  • June 22, 2010
  • Like
  • 0
I am succesfully creating contentversion through the SOAP API, but when creating a contentdocument link (that links my document to another object record) I get an error: INSUFFICIENT_ACCESS_OR_READONLY

What access does the authenticated user need for proper access? Is it to do with the object I am linking the content file to? If so, what permission is needed?
  • May 12, 2017
  • Like
  • 0

There are lots sample code and getting started, but no documentation (that I could find) about the methods available in the SDK itself. We happen to be building an android hybrid app, but where is the API guide for the mobile SDK for hybrid use?

  • September 27, 2013
  • Like
  • 0

We are using the template SiteRegistration Sites VF page to allow users to login. And made a minor controller code change to the PORTAL_ACCOUNT_ID as per instructions on : http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites

 

We successfully register one user, but after the 2nd attempt of a another new user, we get the message 'You are already logged in'

 

We used the template, made only a minor change. What did we do wrong?

 

We are thinking it may be that we can't re-use the same account id? But has anyone else got this before?

 

James

BasicGov Systems

  • June 14, 2013
  • Like
  • 0

Hi we are used to customer portal and also creating VF pages in regular SF. We are used to querying data in our constructor by first passing in an id which is read of the URL.

 

However with Sites, there are no more standard pages so the id is harder to pass around between VF pages. Is there a resource on how to setup our own header and sidebar as a template while jumping from one custom VF page to another(drill down)? What's the best practice?

 

More specifically when a user clicks on the name field link on one VF page (list), how do we jump to another VF page (detail)? Do we just prepend /apex/pagename to url targets?

 

Also do you have header and sidebar visualforce pages as includes when using the VF page in Force.com Sites?

 

Any documentation that provides a way to think through user navigation?

 

-James

  • May 16, 2013
  • Like
  • 0

Hi,

 

im trying to parse the XSD file and getting Error: Failed to parse wsdl: targetNamespace not specified in wsdl:definitions 

 

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Conduit.CPServices.Common.Model.FileManager" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/Conduit.CPServices.Common.Model.FileManager" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:import schemaLocation="http://qa-srv07:83/FileManager.svc?xsd=xsd2" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xs:import schemaLocation="http://qa-srv07:83/FileManager.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:complexType name="FileUploadedResult">
<xs:sequence>
<xs:element minOccurs="0" name="FileManagerItem" nillable="true" type="tns:FileManagerItem"/>
<xs:element minOccurs="0" name="FileStatus" type="tns:FileUploadStatus"/>
<xs:element minOccurs="0" name="FileUrl" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="IsFileUploaded" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:element name="FileUploadedResult" nillable="true" type="tns:FileUploadedResult"/>
<xs:complexType name="FileManagerItem">
<xs:sequence>
<xs:element minOccurs="0" name="DateCreated" type="xs:dateTime"/>
<xs:element minOccurs="0" name="DateLastScaned" nillable="true" type="xs:dateTime"/>
<xs:element minOccurs="0" name="FileExtension" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="FullFileName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="FullPath" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Id" type="ser:guid"/>
<xs:element minOccurs="0" name="OriginalFileName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="RawLog" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="RemoteFileUrl" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="ScanResource" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="ScheduleType" nillable="true" type="xs:int"/>
<xs:element minOccurs="0" name="SendingId" nillable="true" type="xs:long"/>
<xs:element minOccurs="0" name="Status" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="FileManagerItem" nillable="true" type="tns:FileManagerItem"/>
<xs:simpleType name="FileUploadStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="SUCCESS"/>
<xs:enumeration value="MAX_LENGTH"/>
<xs:enumeration value="UNHANDLED_EXCEPTION"/>
<xs:enumeration value="UNAUTHORIZED_EXTENSION"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="FileUploadStatus" nillable="true" type="tns:FileUploadStatus"/>
<xs:complexType name="FileInformationResult">
<xs:sequence>
<xs:element minOccurs="0" name="FileManagerItem" nillable="true" type="tns:FileManagerItem"/>
<xs:element minOccurs="0" name="IsFileFound" type="xs:boolean"/>
<xs:element minOccurs="0" name="IsFinishedScanning" type="xs:boolean"/>
<xs:element minOccurs="0" name="ScanReport" nillable="true" type="tns:VirusTotalReport"/>
</xs:sequence>
</xs:complexType>
<xs:element name="FileInformationResult" nillable="true" type="tns:FileInformationResult"/>
<xs:complexType name="VirusTotalReport">
<xs:sequence>
<xs:element minOccurs="0" name="RawLog" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="permalink" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="positives" type="xs:int"/>
<xs:element minOccurs="0" name="scan_date" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="scans" nillable="true" type="q1:ArrayOfKeyValueOfstringanyType" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:element minOccurs="0" name="total" type="xs:int"/>
<xs:element minOccurs="0" name="verbose_msg" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="VirusTotalReport" nillable="true" type="tns:VirusTotalReport"/>
<xs:complexType name="QueueManagerInsertResult">
<xs:sequence>
<xs:element minOccurs="0" name="InvalidUrls" nillable="true" type="q2:ArrayOfstring" xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:element minOccurs="0" name="IsSuccess" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:element name="QueueManagerInsertResult" nillable="true" type="tns:QueueManagerInsertResult"/>
<xs:complexType name="ArrayOfQueueItemResult">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="QueueItemResult" nillable="true" type="tns:QueueItemResult"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfQueueItemResult" nillable="true" type="tns:ArrayOfQueueItemResult"/>
<xs:complexType name="QueueItemResult">
<xs:sequence>
<xs:element minOccurs="0" name="DateLastScanned" nillable="true" type="xs:dateTime"/>
<xs:element minOccurs="0" name="Id" type="ser:guid"/>
<xs:element minOccurs="0" name="IsVirusFound" type="xs:boolean"/>
<xs:element minOccurs="0" name="ScanResource" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="SendingId" type="xs:long"/>
<xs:element minOccurs="0" name="Source" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Status" type="xs:int"/>
<xs:element minOccurs="0" name="Url" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="QueueItemResult" nillable="true" type="tns:QueueItemResult"/>
</xs:schema>

 

 

 

How should i parse the XSD file

 

Thanks

  • April 09, 2013
  • Like
  • 0

We have trigger code (after update) running twice due to a workflow field update. The code works with values unrelated to the field update rule. We do check if the trigger.old fields != trigger.new fields (field values were actually changed). However, we can't tell that the trigger code already did the work and so should exit before performing the same work again. We have experimented with static variables and static methods and it looks promising so far.

 

If(TriggerTransaction.isPosted(payments[i].id) && payments[i].BGBK__Amount__c != null)
        	continue;
        Else
        	TriggerTransaction.post(payments[i].id);

 

 

Does anyone have best practice code snippets to handle this situation?

 

Note:

As per SF order of execution, triggers are run first, then workflow is run and if there were updates run triggers again. 

 

James

BasicGov Systems

  • November 24, 2011
  • Like
  • 0

Hey everyone,

I have a problem that probably has a lot of differnet answers so if you think you have a better approach feel free to let me know.

 

I am working on a visualforce page that has an HTML5 canvas element. The canvas loads an image from a publically available document. I need to get the base64 value of this image after the user has modified it. The problem is, because this is hosted on a force.com site, the domain is different than the the one that hosts the image. You cannot use canvas.toDataURL('image/jpeg') on a canvas that has content loaded via drawImage().

 

So the fix I see, like when you have to make a cross domain ajax request is to create a server side proxy. In this case, my proxy needs to act as an image server. I need the visualforce page to get the image requested (as a url argument) and display it, as if it was just an image, not a web page. Alternativly if i could get the base64 encoded value of the image and print that on the page, that would be fine as well.

 

Well feel free to leave any feedback as I am bit stuck for now. Thank you!

Hi there, I am making a large GET httprequest to an external REST service. The amount of output data to be streamed is about 10000 characters. I can paste the URL in my browser address and I get the response just fine. However using httprequest in apex causes the destination server to say partial URL. Is there no way to stream data in 5000 chunks for example in Apex? Say something similar to this jsp page? the apex httprequest object doesn't seem to have much functions for streaming

 

 

HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setDoOutput(true);
con.setRequestMethod(request.getMethod());
int clength = request.getContentLength();
if (clength > 0) {
    con.setDoInput(true);
    InputStream istream = request.getInputStream();
    OutputStream os = con.getOutputStream();
    final int length = 5000;
    byte[] bytes = new byte[length];
    int bytesRead = 0;
    while ((bytesRead = istream.read(bytes, 0, length)) > 0) {
	os.write(bytes, 0, bytesRead);
    }
}
out.clear();
out = pageContext.pushBody();
OutputStream ostream = response.getOutputStream();

// Return content type
String contentType = con.getContentType();
response.setContentType(contentType);
// Override content types with known issues
if (contentType != null) {
	for (int i = 0; i < contentTypesToMapToXml.length; i++) {
		if (contentType.indexOf(contentTypesToMapToXml[i]) >= 0) {
			response.setContentType("application/xml");
			break;
		}
	}
}
InputStream in = con.getInputStream();
final int length = 5000;
byte[] bytes = new byte[length];
int bytesRead = 0;
while ((bytesRead = in.read(bytes, 0, length)) > 0) {
    ostream.write(bytes, 0, bytesRead);
}

 

 

I have a number field that I am referring to in formula field via a merge field. The field has 5 significant digits. However, the formula field is only using 3 digits when merging.

 

{!MUSW__Parcel__c.MUSW__Longitude__c}

 The above field has 5 decimal places of information eg. -85.57575

 

but the formula only merges the value: -85.576. For some reason, it is rounding it when I never asked it to.

 

What can I do?

  • April 16, 2010
  • Like
  • 0

Is there any way using any tools to evaluate javascript code (a retrieved string) inside Apex? Ideally I'm looking for something similar to the eval function of javascript but run within Apex.

 

thanks!

 

James

 

Cloudbench Applications

providers of BasicGov.com

 

Hi. What is the limit to number of id's in the id list when Retrieve is called?
  • October 20, 2009
  • Like
  • 0

Hi Friends,

 

I am having 5 profiles in my developer account lets say profile 1, profile 2,..........profile 5.

I have given read, write permission for profile 1 on account object and only read permission for all other profiles from 2 to 5.

So that profile 1 user can able to add notes & attachments on account, others wont since they dont have the edit permission on accounts.

 

But profile 2 user need to add notes and attachments for an account. If i give edit permission for him, he will get edit permission for all other items in accounts. I want to give him access only to create notes and attachments.

 

Please tell me how to do this

also suggest me a solution for this requirement.

 

Thanks,

Ghilli.

  • September 17, 2009
  • Like
  • 0
For a text field on one of my screens, I want to display a warning message anytime the user changes the field's value so that they are definitely sensitive to the impact of changing the value.

Is there an easy way to add a warning dialog box as part of a custom field's on-change event for a screen created using Force.com Builder (setup UI)?