• Manju Venkat
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I was just about to finish this super badge when I encountered this error. I have updated the map component(which comes in unmanaged packaged that you install for this) as per the requirement and placed it on to the page using lightning app builder and the component is even showing up on the page but for some reason the platform keeps throwing me this error below. I tried many different things, I even deleted the whole Map bundle and created a new one and placed it on the page but the same error keeps popping. I have run out of ideas and really frustrated now. Any help is greatly appreciated :(

P.S Hoping its not because of some silly mistake

Error image
I was just about to finish this super badge when I encountered this error. I have updated the map component(which comes in unmanaged packaged that you install for this) as per the requirement and placed it on to the page using lightning app builder and the component is even showing up on the page but for some reason the platform keeps throwing me this error below. I tried many different things, I even deleted the whole Map bundle and created a new one and placed it on the page but the same error keeps popping. I have run out of ideas and really frustrated now. Any help is greatly appreciated :(

P.S Hoping its not because of some silly mistake

Error image
I created a Visualforce page and Apex controller to clone a record. What I need now is to have the Save and Cancel button redirect back to the originating record. I have no experience with Apex or VF and was able to create this with the help of this developer forum. Can anyone help me with what code to add and where to put it, to get the Save Button and Cancel Button to redirect back to the original record? 

Here's the vf page code: 

<apex:page standardController="OpportunityLineItem" extensions="customcloneOpportunityLineItem">
<apex:form >
<apex:pageBlock title="Opportunity Product details">
<apex:pageBlockSection title="Opportunity Prodcut Edit" columns="1">
<apex:inputfield value="{!OpportunityLineItem.OpportunityId}"/>
<apex:inputField value="{!OpportunityLineItem.Product2Id}" />
<apex:inputField value="{!OpportunityLineItem.Quantity}" />
<apex:inputField value="{!OpportunityLineItem.Unit_List_Price__c}" />
<apex:inputfield value="{!OpportunityLineItem.Unit_Sales_Price__c}"/>
<apex:inputfield value="{!OpportunityLineItem.Unit_Cost__c}"/>
<apex:inputfield value="{!OpportunityLineItem.ProductCode}"/>
<apex:inputfield value="{!OpportunityLineItem.Product_Family__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!cloneopportunitylineitem}" value="Save" />
<apex:commandButton action="{!cloneopportunitylineitem}" value="Cancel" />
</apex:pageBlockButtons>
        </apex:pageBlock>
</apex:form>
</apex:page>

Here's the Apex Class: 

public class customcloneOpportunityLineItem
{private opportunitylineitem l;
public customcloneOpportunityLineItem(apexpages.standardcontroller std){
this.l = (opportunitylineitem)std.getrecord();
}

public void cloneOpportunityLineItem(){
opportunitylineitem l1 = new OpportunityLineItem();
l1 =l.clone();
insert l1; 
}
}