• Ispita
  • SMARTIE
  • 1029 Points
  • Member since 2007

  • Chatter
    Feed
  • 39
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 480
    Replies

I want tu SUM the MAX values from an Object

 

I want to do something like this:

SELECT sum(max(Exposici_n__c)) FROM  Cartera_de_Credito__c WHERE Fecha_al__c = 2013-06-30  Group BY Banda_2__c  ORDER BY Max(Banda__c)

 

 

Please help.

Bryan Sosa.

Hi,

 

We have two PROD instances.( you can treat as 2 diff orgs A and B) we would like to shut down A one completely and only use one PROD B.

 

We will no longer use any customizations from one PROD A. but we would like to save all the development work at some place. so we can refer to it if needed. we were able to export all the data and place it on different server. I am wondering if we can replicate the PROD A instance into PROD B sandbox.

 

Any information would be greatly helpful.

 

Thanks.

I'm not able to see the overall Test Coverage of one of my Classes in the lower right section of the Developer Console.

 

I can see the individual method's coverage but not the overall coverage.

 

please help me out here.

 

 

 

Hi, I am new to the developer world and am currently an SFDC admininstrator.  We need to create a custom object in salesforce however our current settings only allow us to have a maximum of two fields side by side.  The custom object we need requires 8+ fields side by side.  Would anyone have code or direction on how I could go about creating a custom object to allow 8+ columns appear in a custom object?  

 

 

Thank you! 

riggeri am testing a trigger.i am calling this method

  GMirrorUtil.createTimeLine(Trigger.new, contentMap);

My create timeline function is 

public static void createTimeLine(List<sObject> objList,Map<String,String> contentMap){ 
      Map<Id,User> userMap = new Map<Id,User>([Select id,Name From User where Authorize__c = true]);
      Map<Id,GlassUserApiSettings__c> userSettingsMap = new Map<Id,GlassUserApiSettings__c>();

       for(Id user_id : userMap.keySet()){
         GlassUserApiSettings__c userSettings = GlassUserApiSettings__c.getValues(user_id);
        if(userSettings == null)
         { User u =userMap.get(user_id);
            u.Authorize__c = false;
           update u;  
         }
          else userSettingsMap.put(user_id,userSettings); 

       }
       for(sObject obj : objList)
         for(Id userId: userSettingsMap.keySet() ){
           String type = '';
           if(contentMap.get('Object').equals('FeedItem'))
             type='Post';
           if(contentMap.get('Object').equals('FeedComment'))
             type= 'Comment';
           GlassUserApiSettings__c userSettings = userSettingsMap.get(userId);
           if(((String)obj.get(contentMap.get('Content'))).contains('@'+userMap.get(userId).Name)){
             Datetime tokenExpiredTime = userSettings.LastModifiedDate;
             tokenExpiredTime.addSeconds(Integer.valueOf(userSettings.ExpireDuration__c)); 
             String body='{"html":"<article><section><div class="text-auto-size">'+type+':'+
                         '<p class="yellow">"'+obj.getSObject('CreatedBy')+'&nbsp;'+obj.getSObject('CreatedBy')+'</p><p>'+obj.get(contentMap.get('Content'))+'</p>'+
                         '</div></section> </article>"}';
                         System.debug('Body is '+body);
             if(tokenExpiredTime >= System.now()){
               GMirror.TokenResponse res  =  GMirrorUtil.refreshToken(userSettings.RefreshToken__c);                 
               userSettings.RefreshToken__c = res.refresh_token;
               userSettings.AccessToken__c  = res.access_token;    
               userSettings.ExpireDuration__c = Integer.valueOf(res.expires_in) ;
               update userSettings;
             }
             String timelineRes = doApiCall(body,'POST','https://www.googleapis.com/mirror/v1/timeline',userSettings.AccessToken__c);
             GMirror.TimelineResponse createdTimeCard  = (GMirror.TimelineResponse) JSON.deserialize(timelineRes,GMirror.TimelineResponse.class);   
             if(createdTimeCard.id != null)
               System.debug('created timeline card :'+createdTimeCard);
             else { try{
                        throw new GMirror.TimelineException(null,timelineRes);
                       }
                    catch(Gmirror.TimelineException e){
                      System.debug(e.getMessage());
                    }
                  }
           }
         }          
    }

but when i initialize prepare String body='{"html":"'+type+':'+ '"'+obj.getSObject('CreatedBy')+' '+obj.getSObject('CreatedBy')+'

'+obj.get(contentMap.get('Content'))+'

'+ ' "}'; i check it in debug logs its giving me null for getSObject('CreatedBy'); i inserted it in my test class thats why trigger invoked and i am using afterinsert event in trigger . can any one please tell why its giving me null ??

 

 

Is it possible to merge a picklist field to a custom field? 

How do I create a custom Account Field that will show the date the last task (call from soft phone logged as a task) was completed for that account? Could I also customize to show the call result in addition to the date completed?

Hi -

I'm cleaning up some data and I need to delete a Picklist value.  But I get the message:

The picklist value you attempted to delete is the last value for the following record types. This picklist must contain at least one value. Either add another value to the picklist or to the following record type.

 

How do I fix this?


thank you -

Sara

Is there a way to filter lookup dialog results based on certain criteria?  

 

So for example: 

I have a lookup relationship field for Products on a custom object for a Contact Product Association custom object.  When I click to lookup a product, I am shown all of our products.  I am trying to find a way to restrict the lookup dialog to only show me products in a certain pricebook.  Does anyone know how I could do that?

 

Thanks!

I created the project and tried to pull choice 1 (apex/VF) from production org, got this error:

 

Factory exception occurred when marshalling package manifest into DOM document, please make sure package manifest is well-form and present in proper location.

 

Reason:

com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName can not case to com.sum.xml.internal.bind.v2.runtime.reflect.Accessor

 

Please let me know what i need to do to proceed. Thank you!

 

Hello - Could someone please assist with a APEX code solution. I am not too familiar with APEX codes and have an issue where when we convert a lead to a contact and account, the custom object "Marketing Activities" information that is related to the lead, does not carry over to the contact record and account record. Thank you in advance for any assistance.

 

Thanks,

Dave

Hi,

 I am trying to create a refreshable dashboard that needs to be refreshed every minute. So i start with desiging a report. 

 

Now, the report has the createddate (which has date and time) which is one of my filter. But i filter for data only after 3:00 am. Now my question is, 

 

- How to create a refreshable dashboard

- How to have the date change to current day automatically, but the time stays constant at 3:00 am. 

 

Ex: Today the data for the dashboard should be showing data after 9/25/2013 3:00 am

Tomorrow without any intervention, the dashboard should show data for  after 9/26/2013 3:00 am

 

Please advise.

 

Thanks.

Hi there we are going to pull our users details name, email etc from a portal site onto their contact record in SFDC to allow us to compare the values. We will also include an auto update trigger checkbox that allows the contact owner to accept the portal site as the source of truth and overwrite the contact fields. The code below does this but a new requirement has arisen that means the trigger should only fire if any of the Portal fields have changed.

 

In a formula id just use ischanged(c.strPortalTitle__c) but I doubt that'll work in apex triggers :-)

 

 

"trigger AutoUpdate on Contact (after delete, after insert, after undelete, 
after update, before delete, before insert, before update) {

    if (trigger.isBefore){
       if (trigger.isInsert || trigger.isUpdate){
        for (Contact c : trigger.new){
        
            if (c.intAutomaticallyUpdate__c){

      
    if (c.Salutation != c.strPortalTitle__c) c.Salutation = c.strPortalTitle__c; 
                
            //Multiselect picklist fields
        if (c.strMarketingOptOutPreference__c != c.strPortalMarketingOptOutPreference__c) c.strMarketingOptOutPreference__c = c.strPortalMarketingOptOutPreference__c;
        if (c.strCompanyPeerGroupFocus__c != c.strPortalCompanyPeerGroupFocus__c) c.strCompanyPeerGroupFocus__c = c.strPortalCompanyPeerGroupFocus__c;
        if (c.Commodity_Fuel_Focus__c != c.strPortalCommodityFuelFocus__c) c.Commodity_Fuel_Focus__c = c.strPortalCommodityFuelFocus__c;
        if (c.Regional_Focus__c != c.strPortalRegionalFocus__c) c.Regional_Focus__c = c.strPortalRegionalFocus__c;"

 

Thanks in advance for your help

 

Paul

 

I have contact/lead tracking data from another system that needs to tie back in with Salesforce.

 

What object should I use to report these actions that Contacts and or Lead has taken?

 

These actions are for example, links clicked, opens, visits to certain web page, etc.  Pretty basic.

 

I don't see a place in the Contact or Lead objects for this.

 

Thanks!

Hello

 

I am trying to find a way to hide a 'New' button on a related list based on the logged in user role and the status attribute of the current record.

 

For example, I have an object that, once it reaches a certain state and only for certain users, should not be editable or associated with other objects. I can easily hide the edit button on my VisualForce page, but I'm not sure how to hide the 'New' buttons on the related lists.

 

How can I accomplish this?

 

 

Thanks!

Hi,  I need to store documents temporarily in Salesforce so that I can then render then on a Force.com site as a PDF page.

I have 2 main choices I can see for this. To store the documents in Files or Documents.  The purpose of storing them is to have a temporary store of the file in SFDC and this file will be deleted after a period of time.  The files will not be more than 5 MB in size.

 

My question on this, is there any benefit to storing them in Files over storing them in Documents or vice versa?  The only purpose is that I can then render the file as a pdf in a force.com site?

 

Are there any performance benefits to retrieving storing the file in Fiels or Documents?

 

Thanks in advance for any help..