• GuyClairbois
  • NEWBIE
  • 210 Points
  • Member since 2009

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 6
    Questions
  • 128
    Replies
Hello all,

I tried overriding a standard "New" action on a custom object and it works fine for internal users. However, that makes the "New" button vanish completely in communities. Here's what my component implements:
implements="lightning:actionOverride, forceCommunity:availableForAllPageTypes"
The use case for this is prepopulating some fields on the child record using information retrieved from Apex.

So main question is: are Lightning Component Action Overrides supported in Partner Communities? If so, what could I be doing wrong?

Regards,
Before Summer 15, I used

 Account.IsPartner = true;

Sometime this approach ran into weird code exception. but It did work for most time.

Now in sandbox with Summer 15. the same code is broken.  it already runs into exception

System.SObjectException: Field is not writeable: Account.IsPartner 
Currently I am working on my DEV401 certification and as an excersise I tried making an IBAN validation rule. Since it actually works I thought I post it here. For some reason the rule editor didn't allow me to concatenate numbers so I had to convert them to text first and convert the result back to a number so I could MOD97 it. 
Suggestions for improvement of course are welcome.

MOD(
VALUE(
TEXT(CASE(MID(IBAN__c,5,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
TEXT(CASE(MID(IBAN__c,6,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
TEXT(CASE(MID(IBAN__c,7,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
TEXT(CASE(MID(IBAN__c,8,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
RIGHT(IBAN__c,
(CASE(LEFT(IBAN__c,2),
"AL",28,"AD",24,"AT",20,"AZ",28,"BE",16,"BH",22,"BA",20,"BR",29,"BG",22,
"CR",21,"HR",21,"CY",28,"CZ",24,"DK",18,"DO",28,"EE",20,"FO",18,"FI",18,
"FR",27,"GE",22,"DE",22,"GI",23,"GR",27,"GL",18,"GT",28,"HU",28,"IS",26,
"IE",22,"IL",23,"IT",27,"KZ",20,"KW",30,"LV",21,"LB",28,"LI",21,"LT",20,
"LU",20,"MK",19,"MT",31,"MR",27,"MU",30,"MC",27,"MD",24,"ME",22,"NL",18,
"NO",15,"PK",24,"PS",29,"PL",28,"PT",25,"RO",24,"SM",27,"SA",24,"RS",22,
"SK",24,"SI",19,"ES",24,"SE",24,"CH",21,"TN",24,"TR",26,"AE",23,"GB",22,
"VG",24,
8
)-8)
)
&
TEXT(CASE(MID(IBAN__c,1,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
TEXT(CASE(MID(IBAN__c,2,1),
"A",10,"B",11,"C",12,"D",13,"E",14,"F",15,"G",16,"H",17,"I",18,"J",19,"K",20,"L",21,"M",22,"N",23,"O",24,"P",25,"Q",26,"R",27,"S",28,"T",29,"U",30,"V",31,"W",32,"X",33,"Y",34,"Z",35,8))
&
MID(IBAN__c,3,2)
)
,97
)
<> 1

Hi Guys,
I am trying to rebuild the Excel formula "Rate" definition see below, did someone already rebuild it in Apex, or can provide me some hints.

The goal is, to get the interest rate, based on the loan duration, monthly rate, and Loan amount.

Thanks a lot.

 

Sunny regards

 

 

 

RATE(nper, pmt, pv, [fv], [type], [guess])
Nper  Required. The total number of payment periods in an annuity.
Pmt  Required. The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.
Pv  Required. The present value — the total amount that a series of future payments is worth now.
Fv  Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).
Type  Optional. The number 0 or 1 and indicates when payments are due.

I have a Pageblocktable which displays a set of values. Now each row in this table has a commandbutton whose action method will display another table below this pageblocktable.Now I want to highlight the row  whose commandbutton I clicked. Can somebody help me with this?

I am running in to an issue with generating apex code using a WSDL. The generated apex code does not seem to recognize the <xsd:extension> tage. Is this a known issue? 

 

Here is the WSDL snippet:

 

<xs:complexType name="Account">
<xs:complexContent>
<xs:extension base="snet:BaseObject">
<xs:sequence>
          <xs:element minOccurs="0" name="Reference" type="snet:AccountReference"/>
          <xs:element minOccurs="0" name="AccountName" nillable="true" type="xs:string"/>
           <xs:element minOccurs="0" name="AccountNote" nillable="true" type="xs:string"/>
           <xs:element minOccurs="0" name="Status" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

 

However, the generated Apex code, does not seem to extend the BaseObject.

 

 public class Account {
        public uriSubscribenetIntrawareCom.AccountReference Reference;
        public String AccountName;
        public String AccountNote;
        public String Status;
        public Boolean AccountNoteToNull;
        private String[] Reference_type_info = new String[]{'Reference','uri:subscribenet.intraware.com','AccountReference','0','1','false'};
        private String[] AccountName_type_info = new String[]{'AccountName','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] AccountNote_type_info = new String[]{'AccountNote','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] Status_type_info = new String[]{'Status','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'uri:subscribenet.intraware.com','true','false'};
        private String[] field_order_type_info = new String[]{'Reference','AccountName','AccountNote','Status'};
    }

 

Any ideas on how to get around this issue? 

I've been trying to use the Excel Connector for the last two weeks to manage the data in our organisation, but I'm having a problem where I get the following error in Excel which is preventing me from using this tool:

 

Error Generated by request::An internal server error has occured while processing your request.
Url:https://www.salesforce.com/services/Soap/c/13.0

ExceptionCode : 5103

The first couple of times I tried to use Excel Connector it worked fine. However I then started seeing this error every time I tried to use it - the error appears after I put in my password in Excel Connector and click Login.

 

We are on Salesforce Professional. I have tried uninstalling and reinstalling the toolkit and connector, but it hasn't made a difference. I'm using Excel 2010 32-bit on Windows 7 64-bit.

 

I can log in to Salesforce in my browser on the same computer.

 

I've checked that IE is not in Offline Mode, and verified that Excel can actually connect to the internet (pinged a URL using VBA script).

 

I've tried disabling my antivirus (MSE) and windows firewall.

 

I've tried changing the server url as suggested by this thread (had to modify registry keys to do this as that field was not editable in the connector.

 

None of these resolutions worked.

 

Has anyone experienced and managed to resolve this, or can anyone suggest any other possible resolutions?

I'm having trouble saving from eclipse, and receive following error:

 

Save error: Unable to perform save on all files: Destination URL not reset. The URL returned from login must be set in the SforceSerice

 

The thing is, I do not continuesly get it, it get it some hours, in a row, and then I don't anymore. Without changing any sf login settings. Sometimes it passes by by restarting eclips, sometimes it doesn't.

 

I've got running projects on different sf organizations, and sometimes i can't save to one because of this error, but have no trouble saving to another. Trying to look up the error, i mostly came across problems with API webservice connection problems, and no mentions of IDE problems.

 

Does anyone know what the issue might be, and how to fix/avoid it ?

In my component I use actionfunction and rerender

<apex:component controller="MultiSelectBoxController">
	...	
	<apex:panelGrid columns="4">
		...
		<apex:actionFunction name="moveDown" action="{!moveDown}" reRender="selectedRight"/> 
		
		...
	
	    <apex:selectList id="selectedRight" required="false" value="{!selectedRight}" multiselect="true" size="20" style="width:250px">
	        <apex:selectOptions value="{!rightOptions}"/> 
	    </apex:selectList>
	
	    <apex:panelGroup layout="block" style="text-align: center; padding:10px;">
	        Up<br/>
	        <a href="javascript&colon;moveUp();" style="text-decoration:none">
	            <img src="/s.gif" alt="Move Up" class="upArrowIcon" title="Move Up"/>
	        </a><br/>
	        ...
	    </apex:panelGroup>
	</apex:panelGrid>

</apex:component>

By debuging I am sure that my action method is called correctly

 

public class MultiSelectBoxController {

	...
	
	public PageReference moveDown() {
		// For each selected item right
		for(Integer r=0; r<selectedRight.size(); r++) {
			
			// Iterate over right list
			for(Integer pos=rightOptions.size()-2; pos >=0; pos--) {
				// When select item is found 
				if(rightOptions[pos].getValue() == selectedRight[r]) {
					// Save item above
					SelectOption tmp = rightOptions[pos+1];
					// Switch options with item above
					rightOptions[pos+1] = rightOptions[pos];
					rightOptions[pos] = tmp;
				}
			}
		} 
		return null; 
	}
}

 Even in Firebug I can see the AJAX POST request coming from the rerender. But on the page nothing happens although the rightOptions have changed...

 

After an hour of trial and error I hand this over to someone whos smarter than me....

 

Robert

Hello ,

 

I tried to push some objects and its fields from sandbox to production. But, after uploading the objects and thier dependent fields, the data has been uploaded successfully and i got mail from salesforce that, Your change set was uploaded successfully

 

Then when i look in to the production in Inbound Change Sets  there are no Change sets available for the deployment.

 

And i have pushed the data from sandbox many times, and every time i am getting the same problem as mentioned above.

 

So please anyone can help me or if any one faced the same problem. please let me know the solution.

 

Thanks & Regards,

Anirudh.

Hi,

 

Can someone suggest if there is any helptext kind of thing available in the Visual Force.

 

This is regarding the help icon which, when hovered by a mouse gives a help text explanation

 

which is present in the Standard objects & Custom Objects for the standard fields in them.

 

Is there a way of achieving this through javascript?

 

Please give me pointers in this issue. TIA.

Hey,
Getting some strange behaviour. I have a trigger that creates sharing rules when an object is created, so that customer portal users can see the object in their portal. Basically the object setup is "User" - "Contact" - "Membership Card". So anytime a membership card is created for a contact, a sharing rule is created so the user can see it via the portal.

This works fine if the new membership card is created by a standard user in SFDC.

However, the portal user has the abilty to create a membership card from a VisualForce page in the portal, and when they do the sharing rule trigger throws up the error: "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY" on the line where i insert the sharing rule

However I thought that triggers run under the system account?

 

Any help is greatly appreciated

I'm trying to sign an XML document in one of my Apex classes.  Does Apex have any built in classes for signing XML documents?  Ie, like using the javax.xml.crypto.dsig.XMLSignature class or the Apache Santuario library?  I've looked at the Crypto.sign function, but I don't think it does what I need it to do (or if it does, please let me know!).

 

Thanks for any suggestions!

 

Kelly 

Hello, I have installed Excel connector and have not yet been able to import a report. I have chosen a variety of report types and report locations and get the same error message each time. Is there a setting I need to adjust? Thanks!

 

Error: Unable to retrieve the requested report. Please log in to Salesforce using a web browser to confirm the report's availability.
I am trying to create a Date of Birth field. Whether you are using a VF page or a regular page layout, when you use the calendar in Salesforce, it only lets you pick from years going forward. So the calendar is useless for something like a Date of Birth since obviously the year is before this year. Obviously the user can type the date, but is there any other way to adjust how the calendar behaves.
How do i resolve this...This is my code...I am sending an XML to an endpoint n number of times(its in a for loop)...Cant i do that?

public PageReference saveUsers() {
String[] listOfSelectedUsers = getUsers();
String domainId = System.currentPageReference().getParameters().get('ex');
for(String presentVar: listOfSelectedUsers)
{

Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://84.40.30.147/cm/spws');
req.setMethod('POST');

TestExtranet__c extranet = [select Extranet_Name__c from TestExtranet__c where id = :domainId];
Lead lead = [select id,firstname,lastname,email from Lead where id = :presentVar];
String requestXML = buildXMLRequest('createUser',extranet.Extranet_Name__c,lead.id,lead.firstname,lead.lastname,lead.email);

req.setBody(requestXML);
HttpResponse res = h.send(req);
XmlStreamReader reader = res.getXmlStreamReader();
boolean errorExists = parseResponseForError(reader);
if(!errorExists)
{
Extranet_User_Mapping__c mapping = new Extranet_User_Mapping__c();
mapping.Extranet_Id__c = domainId;
mapping.Leads__c = presentVar;
insert mapping;
}else
{

}


}
PageReference userConfPage = new PageReference('/apex/userConfirmation?ex='+ System.currentPageReference().getParameters().get('ex'));
return Page.userConfirmation;
}