• SachinSankad
  • NEWBIE
  • 45 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 22
    Replies

Hi All,

 

I need to write a after insert trigger on Opportunity Team Member object to create a Opportunity Split.

 

For example, if we have 2 members in Opportunity Team member then it should be 50% each.

 

Please help me it's urgent.

 

Thanks,

Sachin.

Hi All,

 

I want to clear two picklist values & one textfield value on click event of command link.

 

I have used actionFunction to call controllers method to clear the fields.

 

But whenever i click clear link on VF page, values vanish for 1-2 sec & again previous values are set in picklists as well as textfield.

 

I want to implement it through Apex only.

 

Can anybody tell me possible reason for this??

 

Thanks

Sachin.

Hi All,

 

I want to retrieve all fields of reference object/lookup object from another object.

 

I have one picklist  to select object, after selecting another picklists containing fields of object get populated.

 

So i want to retrieve all fields of reference/lookup object in fields picklist.

 

Please help me to retrieve those fields. Please share reference/sample code.

 

Thanks 

Sachin

Hi All,

 

Anybody implemented the filter logic like equals to, not equals to ,contains, does not contains, starts with & ends with in apex code & Visualforce page??

 

Please share sample code & references ASAP.

Hi All,

 

I am adding dynamic rows using add button which contains 2 picklists & one text field.

 

When i am adding two rows & changing value in second row's picklist it's overwriting the same picklist value in first row. 

 

How to avoid it?

 

Please reply ASAP.

 

 

Hi All,

 

I am using apex:pageBlockSection in apex:repeat tag which is not collapsible even collapsible property is set to true.

 

I have used the solutions from previous discussions too which are not working for me.

 

Here is my VF page code. Please help me to get it working i.e collapsible & expandable on click.

 

<apex:form id="myForm">
<apex:pageBlock title="Schedule" id="pgSchedule">

<apex:pageBlockButtons >
<apex:commandButton value="Edit" action="{!editRevenueSchedule}" rerender="pgBlckSchedule" id="isbtn1" status="gridLoadingStatus"/>
<apex:commandButton value="Save" action="{!saveRevenueSchedule}" rerender="pgBlckSchedule" id="isbtn2" status="gridLoadingStatus1"/>
</apex:pageBlockButtons>

<apex:outputPanel id="pgBlckSchedule">
<apex:actionStatus id="gridLoadingStatus">

<apex:facet name="start">
<apex:image value="/img/loading32.gif" />
</apex:facet>

<apex:facet name="stop">

<apex:outputPanel rendered="{!isDisplay}">

<apex:repeat value="{!lineItemScheduleList}" var="lineItemSchedule1" id="theRepeat">

<apex:pageBlockSection title="Revenue Schedules for Product {!lineItemSchedule1.name}" columns="1" collapsible="true" id="revenueSchedule">
<apex:pageBlockTable value="{!lineItemSchedule1.lstInnerClassOppLineItmSch}" var="lineItemScheduleItem">

<apex:column headerValue="Date" width="15%">
<apex:outputText value="{0,date,dd/MM/yyyy}">
<apex:param value="{!lineItemScheduleItem.ScheduleDate}" />
</apex:outputText>
</apex:column>

<apex:column headerValue="Revenue" width="15%">
<apex:outputText value="{!lineItemScheduleItem.Revenue}" />
</apex:column>

<apex:column headerValue="Comments" width="15%">
<apex:outputText value="{!lineItemScheduleItem.Description}" />
</apex:column>

</apex:pageBlockTable>

<script>
twistSection(document.getElementById('{!$Component.pgSchedule.pgBlckSchedule.theRepeat.revenueSchedule}').getElementsByTagName('img')[0])
</script>

</apex:pageBlockSection>
</apex:repeat>

</apex:outputPanel>

</apex:facet>
</apex:actionStatus>

 

Thanks,

Sachin.

Hi All,

 

Here is my controller & VF page.

 

My save button is not working when i'm saving date after modification.

 

Please need help. It's urgent.

 

VF Page:-

 

<apex:page standardController="Contract"    extensions="RevenueScheduleForOpportunity">
    <apex:form id="myForm">
        <apex:pageBlock title="schedule" id="pgBlckSchedule">
            
            <apex:pageBlockButtons >
                 <apex:commandButton value="Edit" action="{!editRevenueSchedule}" />
<!--                   <apex:commandButton value="Save1" action="{!savedRevenueSchedule}"/> -->
                 
                  <apex:commandButton value="SaveNew" action="{!savedRevenueSchedule1}"/>  
            </apex:pageBlockButtons>
            
            <apex:pageBlockTable value="{!OpportunityLineItemSchedule}"
                var="oppLineItemSchedule" rendered="{!bIsDisplay}">

                <apex:column >
                    <apex:facet name="header">Date</apex:facet>
                    <apex:outputText value="{0,date,dd/MM/yyyy}">
                        <apex:param value="{!oppLineItemSchedule.ScheduleDate}" />
                    </apex:outputText>
                </apex:column>

                <apex:column >
                    <apex:facet name="header">Revenue</apex:facet>
                    <apex:outputText value="{!oppLineItemSchedule.Revenue}" />
                </apex:column>

                <apex:column >
                    <apex:facet name="header">Comments</apex:facet>
                    <apex:outputText value="{!oppLineItemSchedule.Description}" />
                </apex:column>

        </apex:pageBlockTable>
                    
        <apex:pageBlockTable value="{!editedList}"  var="objEdit" rendered="{!if(bIsDisplay == false, true, false)}">

                
<!--                 <apex:pageBlockTable value="{!editedList}"  var="objEdit" rendered="true"> -->
                <apex:column >
                    <apex:facet name="header">Date</apex:facet>
                    <apex:inputText value="{!objEdit.scheduleDate}" >
<!--                         <apex:param /> -->
                    </apex:inputText>
                </apex:column>

                <apex:column >
                    <apex:facet name="header">Revenue</apex:facet>
                    <apex:inputText value="{!objEdit.revenue}">
<!--                     <apex:param value="{!objEdit.revenue}" /> -->
                    </apex:inputText>
                </apex:column>

                <apex:column >
                    <apex:facet name="header">Comments</apex:facet>
                    <apex:inputText value="{!objEdit.description}" />
                </apex:column>

        </apex:pageBlockTable>
        
    </apex:pageBlock>        
    </apex:form>
</apex:page>

 

Controller:-

 

public with sharing class RevenueScheduleForOpportunity
{
    public List<OpportunityLineItemSchedule> lstOppLineItemSch;
    public boolean bIsDisplay{get; set;}
    
    public List<editRevenueSchedule> editedList{get; set;}
    OpportunityLineItem objOpportunityLineItem;
    Map<Id, OpportunityLineItemSchedule> opportunityLineItemScheduleMap = new Map<Id, OpportunityLineItemSchedule>();
    
    public RevenueScheduleForOpportunity(ApexPages.StandardController stdController)
    {
            system.debug('=========In parametrized standard Constructor=>');
              Contract objContract = (Contract)stdController.getRecord();
            objContract = [Select Opportunity__c From Contract where Id =:objContract.Id];
            //System.debug('List of Contracts=======>'+objContract);
            objOpportunityLineItem = [Select OpportunityId, Id From OpportunityLineItem
                                                       Where OpportunityId =:objContract.Opportunity__c];
            //System.debug('List of OpportunityLineItem====>'+objOpportunityLineItem);
            bIsDisplay  = true;
    }
    
    public List<OpportunityLineItemSchedule> getOpportunityLineItemSchedule()
    {
        if(lstOppLineItemSch==null)
        {
            opportunityLineItemScheduleMap = new Map<Id, OpportunityLineItemSchedule>([Select OpportunityLineItemId, ScheduleDate, Revenue, Description
                                                                                                                                              From OpportunityLineItemSchedule
                                                                                                                                              Where OpportunityLineItemId=:objOpportunityLineItem.Id
                                                                                                                                              Order by ScheduleDate]);
                                                                                                        
            lstOppLineItemSch = opportunityLineItemScheduleMap.values();
            lstOppLineItemSch.sort();
            System.debug('List of OpportunityLineItemSchedule==========='+opportunityLineItemScheduleMap.size());
            //List<editRevenueSchedule> lst = getEditRevenueSchedule();
        }
        //return opportunityLineItemScheduleMap.values();
        return lstOppLineItemSch;
    }
    
    public void editRevenueSchedule()
    {

        bIsDisplay = false;            
        //system.debug('=========In===>');
        //bIsDisplay  = true;
        //Pagereference editRef = new Pagereference('/apex/RevenueScheduleSave');
        //editRef.setRedirect(true);
        
        editedList  = new List<editRevenueSchedule>();
        //List<editRevenueSchedule> lsteditRevenueSchedule = new List<editRevenueSchedule>();
        editRevenueSchedule objEdit;
        
        if(lstOppLineItemSch != null)
        {
            for(OpportunityLineItemSchedule objOpp : lstOppLineItemSch)
            {
                objEdit = new editRevenueSchedule();
                system.debug('=========In==For=>');
                objEdit.scheduleDate = (objOpp.ScheduleDate != null) ? objOpp.ScheduleDate : Date.valueOf('');
                objEdit.revenue = (objOpp.Revenue != null) ? objOpp.Revenue : 0.0;
                objEdit.description = (objOpp.Description != null) ? objOpp.Description : '';
                objEdit.Id= objOpp.Id;
                editedList.add(new editRevenueSchedule(objEdit.scheduleDate, objEdit.revenue , objEdit.description,  objEdit.Id));
                //system.debug('List lsteditRevenueSchedule in for loop of getEditRevenueSchedule ============>'+lsteditRevenueSchedule);
                system.debug('Size of list editedList in getEditRevenueSchedule function======'+editedList);
            }
            //editedList.addAll(lsteditRevenueSchedule);
        }
    
    //    return null;
    }
    
    public Pagereference savedRevenueSchedule1()
    {
        system.debug('=== Exceuted');
        List<OpportunityLineItemSchedule> opportunityLineItemScheduleList = new List<OpportunityLineItemSchedule>();
        OpportunityLineItemSchedule objOppLineItmSc = new OpportunityLineItemSchedule();
        
        if(editedList != null)
        {
            system.debug('==If  =Exceuted'+editedList.size());
            for(editRevenueSchedule objEditSc : editedList)
            {
                system.debug('===For==========Exceuted');
                if(opportunityLineItemScheduleMap.containsKey(objEditSc.Id ))
                {
                    System.debug('===If=========Exceuted');
                    objOppLineItmSc = new OpportunityLineItemSchedule();
                    objOppLineItmSc = opportunityLineItemScheduleMap.get(objEditSc.Id);
                    objOppLineItmSc.ScheduleDate = objEditSc.scheduleDate;
                    objOppLineItmSc.Revenue = objEditSc.revenue;
                    
                    objOppLineItmSc.Description = objEditSc.description;
                
                    opportunityLineItemScheduleList.add(objOppLineItmSc);
                }
            }
            
            if(opportunityLineItemScheduleList !=null)
            {
                List<Database.Saveresult> bdSave = database.update(opportunityLineItemScheduleList) ;
                System.debug(' List after clicking save button ==============>'+bdSave);
            }
        }
        return null;
    }
    
    public class editRevenueSchedule
    {
        public Date scheduleDate{get;set;}
        public Double revenue{get;set;}
        public String description{get;set;}
        public String Id{get;set;}
        
        public editRevenueSchedule (){}
        
        public editRevenueSchedule(Date scheduleDate, Double revenue, String description, Id oppLISchedule)
        {
            this.scheduleDate = scheduleDate;
            this.revenue = revenue;
            this.description = description;
            this.id = oppLISchedule;
        }            
    }
        
}

Hi ,

 

 I  have list view button on account, The button have select multiplem records and need to show google map. 

 

1. i am not getting proper marker on googlemap

2. i am not getting all selected address in google map

 

<apex:page sidebar="false" standardController="Account" recordSetVar="SelectedAccounts" extensions="MapController">
<head>
<script type='text/javascript' src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<style>
#map {
font-family: Arial;
font-size:12px;
line-height:normal !important;
height:400px;
padding: 20px;
}
.roundCornerCss{
/* outer shadows (note the rgba is red, green, blue, alpha) */
-webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 1px 6px rgba(23, 69, 88, .5);

/* rounded corners */
-webkit-border-radius: 12px;
-moz-border-radius: 7px;
border-radius: 7px;

/* gradients */
background: -webkit-gradient(linear, left top, left bottom,
color-stop(0%, white), color-stop(15%, white), color-stop(100%, #D7E9F5));
background: -moz-linear-gradient(top, white 0%, white 55%, #D5E4F3 130%);
}

</style>
<script type='text/javascript'>
var geocoder;
var map;
var infowindow = new google.maps.InfoWindow();
var places = [];
var title_content = new Array();
var popup_content = new Array();
var address = new Array();
var address_position = 0;
var timeout = 600;
function initialize() {



var myOptions = {
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false

}
geocoder = new google.maps.Geocoder();

<apex:repeat value="{!selected}" var="loc" id="addressesId">

title_content.push("Name: "+"{!loc.Name}"+" \nClick for more Detail");
address.push("{!loc.BillingStreet}, {!loc.BillingCity},"
+" {!loc.BillingPostalCode},{!loc.BillingCountry}");
popup_content.push("<b>Account Name: {!loc.Name}"
+"<br/>Street: {!loc.BillingStreet}"
+"<br/>City: {!loc.BillingCity}<br/>Postal Code: {!loc.BillingPostalCode}"+
+"<br/>Country: {!loc.BillingCountry }</b>");
</apex:repeat>

map = new google.maps.Map(document.getElementById("map"), myOptions);
addMarker(address_position);

}
function addMarker(position) {
geocoder.geocode({'address': address[position]}, function(results, status){
if (status == google.maps.GeocoderStatus.OK) {
alert(address[position]);
places[position] = results[0].geometry.location;
alert(places[position]);
//center map
map.setCenter(results[0].geometry.location);

var marker = new google.maps.Marker({
position: results[0].geometry.location,
title:title_content[position],
icon: getMapIconUrl(position+1),
map: map
});
google.maps.event.addListener(marker, 'click', function() {
if (!infowindow) {
infowindow = new google.maps.InfoWindow();
}
infowindow.setContent(popup_content[position]);
infowindow.open(map, marker);
});


}
else{
if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT){
setTimeout(function() { addMarker(position); }, (timeout * 3));
}
}
address_position++;
if (address_position < address.length){
setTimeout(function() { addMarker(address_position); }, (timeout));
}
});
}
function getMapIconUrl(markerNumber){
if(markerNumber > 2){
markerNumber = markerNumber%2;
}
var mapIconUrl = "{!URLFOR($Resource.GoogleMarkers, 'GoogleMark/1.png')}";
var newIcon = markerNumber+'.png';
mapIconUrl = mapIconUrl.replace('1.png',newIcon);
return mapIconUrl;
}
</script>
</head>
<body>
<div id="map" class="roundCornerCss"></div>
<script>
initialize();
</script>

</body>


</apex:page>

 

 

 

Hi ,

 

I want to use Jquery in visualforce , can i have any materials to learn jquery in salesforce , 

plz any materials send that url

 

 

Regards,

GaneZ

Hi,

 

 According to requirement we overrided the view page. Now in that page want to display related list to display the task associated with that record. How to display those related list with task pls let me know how to do it. thanks

HI,

 

Could you please help me in implementing a progress bar on a VF page.

I have a button which implements add functionality. I need some progress image kind of thing will appear when i click the button.

 

For Example - when we place a cursor on any field in recent items (Homepage) . A circle kind of loading appers.

 

 

Regards

How to use scrollbar for pageblocktable

 

Thanks

Hi All,

I created a JS that changes the "Setup" button for specific users.

Iused a sidebar component, and I works great except when the user enters the console, there is no sidebar, and the button is shown because the JS is not loaded.

Can anyone suggest how to run JS in salesforce console?

Thank you,

Hi I'm new to apex development,

 

I'm just trying to get a general idae on the tools available and when to use them.

 

When do you use the eclipse force.com IDE vs the Developer console?

 

writting code I assume you do in the IDE.

how about debugging?  

and test runs?  I'm finding I sometimes get errors on tests run in salesforce.com but not in the IDE.

do people generally deploy from IDE or salesforce.com?

 

Phrased another way,  what do you do in the devloper console, and what do you do in the IDE?

 

 

Thanks for any insight..  

 

-Joe

Hi,

 

Is ther any way to show result in a inputbox after 10 sec..Is there any time bound we can give.

 

 

Regards

Sidhartha

Hi,

 

Am trying to upload this package and I am getting the following error. Looks like something changed in summer 13. I get an error with the following three formula.

 

1.

If (
AND (
ISPICKVAL(Status__c, 'Yes'),
ISPICKVAL(LineType__c,'Free'),
TODAY() > ( Account__r.temp_c + Date__c ),
TODAY() <= Account__r.temp__c + Date__c )
)
,
Value__c
,
0
)

 

2.

Money__r.DueDate__c (Date field)

 

3.

Money__r.Status__c (Picklist)

 

The error i am getting for all three is:

 

Field ************* is inaccessible. Please review all fields referenced by the formula. Context: common.formula.EntityFormulaContext

 

Thanks

Uves

  • July 03, 2013
  • Like
  • 0

I set up to run the schedular by running the below statement in console. but when I check from ScheduledJob, it doesn't appear.

 

1) I want to run every 2 mintues between 5:30 - 5: 55 minutes.

 

System.Schedule('Testing', '0 30-55/2 17 * * ?', new Schedular_MySchedular());

 

If I don't set up per minutes, such as System.Schedule('Testing', '0 30 17 * * ?', new Schedular_MySchedular()); the job appears in ScheuledJob list.

 

What might be the issue?

 

2) If I want to run schedular for every hour, how can I configure it?

 

Thanks ahead.

I have a $25 product. If I create an Opportunity Line Item with a quantity of 12, my total price is $300. I want to discount the Total Price to $200 (a 1/3 discount).

 

If I enter a discount percentage of 33.33333%, it gets rounded or truncated to 33.33%, and my Total Price ends up at $200.01.

 

Any ideas how I can I get my Total Price to $200?

i am running soql query dynamically using search.query() and i am facing error 

System.QueryException: expecting a right parentheses, found 'OFFSET'

 

 

my query is 

 

FIND 'USA' IN ALL FIELDS RETURNING Account (SicDesc,ParentId,TickerSymbol,LastModifiedDate,NumberOfEmployees,NumberofLocations__c,ShippingCity,ShippingLatitude,BillingLongitude,Jigsaw,BillingCountry,ShippingCountry,Site,AccountNumber,BillingStreet,Active__c,LastViewedDate,BillingCity,ShippingLongitude,Rating,CreatedById,IsDeleted,Id,ShippingPostalCode,Industry,UpsellOpportunity__c,AccountSource,Phone,SLAExpirationDate__c,Type,OwnerId,ShippingState,BillingLatitude,AnnualRevenue,BillingState,LastActivityDate,BillingPostalCode,SystemModstamp,SLASerialNumber__c,Description,LastReferencedDate,LastModifiedById,Website,ShippingStreet,Fax,SLA__c,CustomerPriority__c,MasterRecordId,Name,CreatedDate,JigsawCompanyId,Sic,Ownership ORDER BY Name OFFSET= 0 LIMIT 5)


i tried many things but every time i am getting some error can any one please tell what should be the right query for selecting 5 accounts with offset 0 including all fields ??

How to fetch records more than 50000 (something around 70000) and then update it in "Update" DML statement.

SOQL can give you 50000 records and 1 DML can process 10000 records only.

Now how to overcome this situation ???

Please sugges.

 

Is this application still included in Summer 13 releases?

 

I've got a new Developer free edition but it's not there; I've also got a trial froce.com edition which has 3 sample apps, but sample recruiting (Universal Containers) app is not there. (And neither on AppExchange/)

# Are you salesforce smart?

pick list 

yes 

no 

 

or checkbox 

 

Please explain why?

  • June 26, 2013
  • Like
  • 0

Hi All,

 

I want to clear two picklist values & one textfield value on click event of command link.

 

I have used actionFunction to call controllers method to clear the fields.

 

But whenever i click clear link on VF page, values vanish for 1-2 sec & again previous values are set in picklists as well as textfield.

 

I want to implement it through Apex only.

 

Can anybody tell me possible reason for this??

 

Thanks

Sachin.

Hi All,

 

Anybody implemented the filter logic like equals to, not equals to ,contains, does not contains, starts with & ends with in apex code & Visualforce page??

 

Please share sample code & references ASAP.