• Pradeepkumar Dani 5
  • NEWBIE
  • 24 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies
Somehow I was not able to complete this challenge due to above error:
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">

    <aura:attribute name="accountRecord" type="Account"/>
    <aura:attribute name="record" type="Object"/>
    <aura:attribute name="recordSaveError" type="String" default=""/>

    <force:recordData aura:id="recordHandler"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.record}"
    targetFields="{!v.accountRecord}"
    targetError="{!v.recordSaveError}"
    mode="EDIT"
    fields="Name"/>
    
    <!-- Display an editing form -->
    <div class="Record Details">
        <lightning:card iconName="action:edit" title="Edit Account">
            <div class="slds-p-horizontal--small">
                <lightning:input  label="Account Name" value="{!v.accountRecord.Name}"  name="Account Name"  />
                <br/>
                <lightning:button label="Save Account" onclick="{!c.handleSaveRecord}" class="slds-m-top--medium"/>
            </div>
        </lightning:card>
    </div>
        
    <!-- Display error message -->
    <aura:if isTrue="{!not(empty(v.recordSaveError))}">
        Error: <ui:outputText value="{!v.recordSaveError}"/>
    </aura:if>
 
 </aura:component>
 
({
    handleSaveRecord : function(component, event, helper) {
        component.find("recordHandler").saveRecord($A.getCallback(function(saveResult) {
            if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {
                // handle component related logic in event handler
                component.set("v.recordSaveError", "");
                                
            } else if (saveResult.state === "INCOMPLETE") {
                console.log("User is offline, device doesn't support drafts.");
            } else if (saveResult.state === "ERROR") {
                console.log('Problem saving record, error: ' + JSON.stringify(saveResult.error));
                var errMsg = "";
                // saveResult.error is an array of errors, 
                // so collect all errors into one message
                for (var i = 0; i < saveResult.error.length; i++) {
                    errMsg += saveResult.error[i].message + "\n";
                }
                component.set("v.recordSaveError", errMsg);                
                
            } else {
                console.log('Unknown problem, state: ' + saveResult.state + ', error: ' + JSON.stringify(saveResult.error));
            } 
        })); 
    }
})

Please help, Thanks :) 
During hands-on, I wasn't able to get the quick actions to Salesforce1 & Lightning Expiriece section in the layouts as stated in the steps. 

Its strange and want to know whether any of you have faced the same !

 Any advice? The error is "Challenge Not yet complete... here's what's wrong: We could not find the correct tasks created from the "Bank Loan Opportunity" template according to the requirements. Make sure you created the action plan using the correct action plan template and created it logged in as the correct user. "
 
Somehow I was not able to complete this challenge due to above error:
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">

    <aura:attribute name="accountRecord" type="Account"/>
    <aura:attribute name="record" type="Object"/>
    <aura:attribute name="recordSaveError" type="String" default=""/>

    <force:recordData aura:id="recordHandler"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.record}"
    targetFields="{!v.accountRecord}"
    targetError="{!v.recordSaveError}"
    mode="EDIT"
    fields="Name"/>
    
    <!-- Display an editing form -->
    <div class="Record Details">
        <lightning:card iconName="action:edit" title="Edit Account">
            <div class="slds-p-horizontal--small">
                <lightning:input  label="Account Name" value="{!v.accountRecord.Name}"  name="Account Name"  />
                <br/>
                <lightning:button label="Save Account" onclick="{!c.handleSaveRecord}" class="slds-m-top--medium"/>
            </div>
        </lightning:card>
    </div>
        
    <!-- Display error message -->
    <aura:if isTrue="{!not(empty(v.recordSaveError))}">
        Error: <ui:outputText value="{!v.recordSaveError}"/>
    </aura:if>
 
 </aura:component>
 
({
    handleSaveRecord : function(component, event, helper) {
        component.find("recordHandler").saveRecord($A.getCallback(function(saveResult) {
            if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") {
                // handle component related logic in event handler
                component.set("v.recordSaveError", "");
                                
            } else if (saveResult.state === "INCOMPLETE") {
                console.log("User is offline, device doesn't support drafts.");
            } else if (saveResult.state === "ERROR") {
                console.log('Problem saving record, error: ' + JSON.stringify(saveResult.error));
                var errMsg = "";
                // saveResult.error is an array of errors, 
                // so collect all errors into one message
                for (var i = 0; i < saveResult.error.length; i++) {
                    errMsg += saveResult.error[i].message + "\n";
                }
                component.set("v.recordSaveError", errMsg);                
                
            } else {
                console.log('Unknown problem, state: ' + saveResult.state + ', error: ' + JSON.stringify(saveResult.error));
            } 
        })); 
    }
})

Please help, Thanks :) 
This question is regarding Lightning Experience (formerly Lightning Desktop) and not Lightning Components.  The issue is that the Lightning Experience modal's interior content height does not seem to respect the Action's height nor appears to be settable anywhere.

In this simplified example, we have an Action that is set to a height of 750px that simply opens a VF page with some sample text.

User-added image

Instead of the contents of the modal being 750px (Action height) or the content height, you can see the scrollbars and small height.  Manually changing the 'cuf-content' element to a bigger height in developer tools shows the desired output.  We can't change the cuf-content element since this is 'outside' of the modal iframe.

User-added image

Is this an already known bug?  Any workarounds or different approaches? 

Hi All,

 

My requirement is to set the icon on the tab, when visualforce page is loaded in service console.

 

I have tried to implement it using the following link:

 

http://www.salesforce.com/us/developer/docs/api_console/Content/sforce_api_console_settabicon.htm

 

sforce.console.setTabIcon('/img/icon/microphone16.png', null, checkResult);

 

I have inlcuded the following script :

<apex:includeScript value="/support/console/28.0/integration.js"/> and also changed the version of the page as well as controller to 28.0 .

 

Still this setTabIcon is not working for me.

 

Please help me.

 

Any help would be appreciated !!!

 

Thanks & Regards

Palak Agarwal

  • June 17, 2013
  • Like
  • 0

Hi guys!

 

I checked out a certain JAVA fix and noticed that it may just be the solution to this brickwall I ran into. I have the following custom button OnClick Javascript code on a sample object that should imprint both Date and Time values on a DateTime field. I did use the new Date() syntax but it only works for Date fields and not DateTime. I was wondering, how this post would fit into what I've formulated. Thanks in advance!

 

Mine:

 

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} 
var v=new sforce.SObject("Opportunity"); 
v.JavaDateButtonTest__c="{!Opportunity.JavaDateButtonTest__c}"; 
v.id = "{!Opportunity.Id}"; 
if((v.JavaDateButtonTest__c=='')) 

var date = new Date('{!TODAY()}'); 
v.JavaDateButtonTest__c=date; 
result=sforce.connection.update([v]); 
}

 

-----------------------------------------------------------

 

Fix:

 

function fixTime(time){
   if(time < 10) {time = "0" + time};
   return time;
}
function fixDate(date){
  var Month = fixTime(date.getMonth() + 1);
  var Day = fixTime(date.getDate());
  var UTC = date.toUTCString();
  var Time = UTC.substring(UTC.indexOf(':')-2, UTC.indexOf(':')+6);

  var Minutes = fixTime(date.getMinutes());
  var Seconds = fixTime(date.getSeconds());
  return date.getFullYear() + "-" + Month + "-" + Day + "T" + Time; 
}

 -----------------------------

 

I also got this from another site and I'm not sure if this is usable for what I cited above:

 

http://www.ladysign-apps.com/blog/code/salesforce/salesforce-datetime-functions/comment-page-1/#comm...

 

/**
* Set Javascript Date Time to Salesforce Date Time;
* @param dateTimeObj - date time string
* @return salesforce date time object
**/
function setStringToDateTime(dateTimeObj){
    var dateTimeObj;
 
    if (dateTimeObj != null) {
        dateTimeObj = sforce.internal.stringToDateTime(dateTimeObj);
    }
 
    return dateTimeObj;
}
  • June 13, 2012
  • Like
  • 0

Hi,

is it possbile to delete custom fields from a custom objects by using the metadata api in eclipse ? 

Currently when I do this, the .object files is refreshed with the previous content.

 

Thanks in advance

Hello,

 

I'm developing error logger for SFDC and im courius is there a way to get current class and method name?

E.g. i want to add in catch exception brackets line:

 

logNewError(currentClassName, currentMethodName, errorDescription).

 

I hope you got my point;)

 

Best Regards,

Lukas

Hello,

I have a number of custom "New" buttons which are located on a related list (of Opportunities) in the Contact record. The buttons are S-control buttons and are set to render in the same window with a side bar.

They work fine off of the related list - they just bring up a pre-populated opportunity record type. However, when you hover over the related list at the top of the Contact record and push one of the buttons, it renders the new page in the hover box!

Any help here?

Thanks!
Sara

Update: I have compared this custom button/s-control with another that comes with the non-profit template (both create membership opportunity records from a Contact and both are located on the opportunity related list in the contact record) and does NOT render in the hover when pressed, and they are *identical*. Same exact button attributes, and the S-control's Javascript is the same as well. This is a big problem for our client - I am thinking it must be a configuration issue. ?



Message Edited by sarac on 04-23-2008 12:09 AM
  • April 15, 2008
  • Like
  • 0
We're attempting to utilize a custom button to set the value of a custom date/time field. The custom field (PM_REVIEW_DATE) is defined as DateTime. All the button attempts to do is set the field to Now() and then update the case and reload the window. When we click the button, we get the following error:

A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'soapenv:Client',faultstring:"9/12/2007 12:15 PM' is not a valid value for the type xsd:dateTime',}

The javascript defined with the button is as follows:

{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.PM_Review_Date__c='{!NOW()}';
result = sforce.connection.update([c]);
window.location.reload();



As I understand it, NOW returns a datetime. Why am I getting the above error and how do I correct?

Thanks in advance for the help!

Message Edited by TTT on 09-12-200710:02 AM

  • September 12, 2007
  • Like
  • 0