• Baguiar2
  • NEWBIE
  • 125 Points
  • Member since 2012

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 46
    Replies
Hi there,

not sure if this is the right group but wonder if there is a way from the excel connector using the "Sfemail" or the "soql_table" function , to retrieve the contact ID but only contacts that are part of Accounts with a certain field Value.

In other words, I wanted to get contacts that are ONLY part of Accounts with the "Status = Active" . I was tryong something like this but no success so far:

soql_table("Contact","Email = B1 and AccountID in soql_table("Account","Status = 'ACTIVE' ")  ")

Can we do a Soql within a Soql ?

Thanks for the help!!

Hi there,

 

I'm trying to use an Account standard field (Account Name (Local) API =  NameLocal) as a filter for a Dashboard. The field is available in all the reports that are part of the dashboard widgets. I understood that if the field is available on all the report types on the report sources for the Dashboard , it would available for use in the Dashboard Filter. Is this correct or I'm totally off here? :)

 

Thanks!

 

B

Hi guys,

 

having an issue with thew forecast tab. The user have the default currency set to USD. When the user opens his forecast, he sees the current Fiscal Year in USD, and the 2014 year and so on in British Pounds (his previous default currency setup). Once you change your default currency to USD, shouldn't your whole environment (including Forecast) be now in the currency you;ve set in your default currency on the user settings?

 

Thanks!

 

B

Hi there,

 

this one seems strange, but I want to check first before saying something that is out of my hands. :) I have this trigger that calculates the CMRR amounts and updates the parent account. The goal is to always have the Top parent account updated with the SUM of the CMRR fields (05 of them) from the child account records. 

 

So, whenever an account is updated, the trigger finds a parent  account (if any) and all other children related to the same parent and updates the Parent with the sum Of all children CMRR fields (05 diferent types of CMRR). Well, this works beautifully when I do update records manually. Tested them many many times and the results are perfectly using, child, grandchild records and so on. Tested in som amny diferent ways and always worked fine. What is happening is that (Ibeleive) we have data.com massively updating our accounts with the most current data as far as web addresses, phone numbers and such. After those updates, the CMRR numbers on the accounts go crazy. Things like from $0 to $2,550,356.00 CMRR. IMpossible as the parent and children have NO CMRR at all. they are at 0.    Here is the code:

 

trigger TotalsCMRR on Account (after update) {
  Set<Id> recordIds = new Set<Id>();
  Set<Id> parentIds = new Set<Id>();
  
  for(account t:Trigger.new)
   if(t.parentid <> null ){
      recordIds.add(t.id);
      ParentIds.add(t.parentid);
       
     List < account> acctparent = [select id, ChildOR__c, ChildNew__C, Healthy_CMRR_Child__c, Healthy_Upsell_CMRR_Child__c, Churned_CMRR_Child__c, New_Business_CMRR_Child__c, Retention_Risk_CMRR_Child__c from account where id in :ParentIds limit 1]; 

     
     LIST<AggregateResult> ChildCMRR = [select sum(Total_Healthy_CMRR__c)childsum, sum(Total_Churned_CMRR__c)childchurn, sum(Total_Healthy_Upsell_CMRR__c)childupsell, sum(Total_Open_New_Business_CMRR__c)childnew, sum(Total_Retention_Risk_CMRR__c)childret from Account where parentid in :ParentIds]; 
     System.debug('ChildCMRR: ' + ChildCMRR);
     
     Decimal D = (Decimal) ChildCMRR[0].get('childsum');
     acctparent[0].Healthy_CMRR_Child__c = D;
     Decimal D2 = (Decimal) ChildCMRR[0].get('childchurn');
     acctparent[0].Churned_CMRR_Child__c = D2;
     Decimal D3 = (Decimal) ChildCMRR[0].get('childupsell');
     acctparent[0].Healthy_Upsell_CMRR_Child__c = D3;
     Decimal D4 = (Decimal) ChildCMRR[0].get('childnew');
     acctparent[0].New_Business_CMRR_Child__c = D4;
     Decimal D5 = (Decimal) ChildCMRR[0].get('childret');
     acctparent[0].Retention_Risk_CMRR_Child__c = D5;
     update acctparent;
     
     IF (D > 0){
     acctparent[0].ChildOR__c = True;
    }
     IF (D == 0){
     acctparent[0].ChildOR__c = False;
     }
     IF (D4 > 0){
     acctparent[0].ChildNew__c = true;
    }
      IF (D4 == 0){
     acctparent[0].ChildNew__c = false;
    }
    update acctparent;
   }
}

 

Just as an example, on the same account (or any other account updated during the mass data.com updates) that I had the Total CMRR changed from 0 to $2,550,350.00 , if I just "touch" a child record (add a description or a phone number)for the same parent account and save it, the CMRR goes back to Normal on the parent. I beleive this tells me that the trigger works fine.??..

 

any thoughts? AS usual, thanks for the great help !

B

Hi there , I have a formula text field that reads another formula field but a number, and adds an image. My issue is that the number formula field is set with NO decimals. But, when i reference the # field in my new text formula field, all the decimals are showing. So, A1 is a formula number field with NO decimals and i'm trying this: TEXT(A1)&" - " Image(/img/green.jpg.... And so on. Is there a way to have the A1 value show as I set the field with no decimals ? Thanks! B

HI There,

 

I know it sounds weird, but is there a way to prevent users from using a certain email template or folder, when sending emails from a Oppty record as an example, depending on a certain criteria on the record? LEts say If a box is checked for "Oppty not ready", the user can't use a certain email template ?

 

Thinking of some ideas here but any help is appreciated!

Thanks!

 

B

HI there,

 

I have a report on opportunities that it is grouped by Stages. Each has its ou summarized ammount. What I'm trying to do is to have a formula that would divide the SUM of one specific Stage (ammount) by the total ammount for the report.

 

Lets say, The report is for all the opportunities and the Grand total is 100.000. My sub total for Opportunities on the "Closed Won" stage is 80.000. I want my formula to calculate 80.000 / 100.000 So I'd get the percentage of the Opportunities on that stage in regards to the total.

 

How can I do that in a formula  for reports ?

 

Thanks in advance,

 

Breno

HI there,

 

Any Ideas why the calendar gets chopped off when in a field within a  <table> ? It does not happen within a <apex:pageblocktable>, but that would not work for me as I'm using the table to align fields in 03 columns. :)

 

 

And this is pretty much how the table goes in the VF:

 

<apex:form id="f1" >
<table width="90%" columns="3" align="left">

<td align="right"><b>PM Owner: </b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Owner__c}" /></td>
<td align="right"><b>PM Start date:</b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Start_Date__c}"  /></td>

.. and so on...

 Any ideas?  Thanks!!

 

B

HI there,

 

I Have a very simple VF page that uses the standard controller "projects__C".  The only reason the page exists is to display certain fields of the custom object in a certain way. It has a save button, so it saves the values of the specific fields on the record. Regardless, the page works fine and I have a little Javascript that simply redirects the page after saving it. Well, That works fine in Google Chrome, as when you hit the SAVE, the record is saved and the page refreshes just fine. NOw in Firefox, the whole page for the preoject__C record reloads within the section where the VF page was supposed to be.

 

All I need it to have the save button just to SAVE the record and NOT load the main page into the VF page Section.

 

here is the code: 

 

<apex:page standardController="Projects__c"  showHeader="false" >

<apex:form id="f1" >
<table width="90%" columns="3" align="left">

<td align="right"><b>PM Owner: </b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Owner__c}" /></td>
<td align="right"><b>PM Start date:</b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Start_Date__c}"  /></td>
<td align="right"><b>PM Hours:</b></td><td align="left" width="70"><apex:inputField value="{!Projects__c.PM_Hours__c}"  /></td><tr/>


<td align="left"><apex:commandButton value="Save" action="{!save}" onclick="savemenow();"  oncomplete=""/></td>
</table>
<script>
function savemenow()
{
var url='/{!Projects__c.id}';
window.location.href= url;
navigateToUrl('/{!Projects__c.id}');
return true;
}
</script>
</apex:form>
</apex:page>

 Thanks!

B

HI guys,

 

very simple class but it is not capturing the Opportunity__C (which is a master detail field to the Opportunity) id, to macth the Opportunity Line Items I want.  I have the exact same class for another object and it captures the object Id just fine. Not sure whats the issue here..

 

 

public class productsprojects
{
  private List<OpportunityLineItem> products;
  public List<OpportunityLineItem> getproducts()

    {
      products = [ SELECT product_name__c, Design__c, Development__c, Custom_Template_Category__c
                        FROM OpportunityLineItem 
                            WHERE OpportunityId = :System.currentPagereference().getParameters().get('Opportunity__c')  
            ];
            
      return products;
    }
}

 Thanks for the help!

B

 

Hi there,

 

I have this button I've created that is supposed to submit a child object from an opportunity for approval. The submisison works As I manually test by entering the IDs on the URL, but I'm having an issue in getting the var "record", which is my MSA_requst__C object ID into the URL. here is the code:

 

{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")} 

var t1= new sforce.SObject("MSA_Requests__c" ); 
t1.Opportunity__c = "{!Opportunity.Id}"; 
result = sforce.connection.create([t1]); 

var resultMSA = sforce.connection.query("Select Id From MSA_Requests__c where Opportunity__C = '{!Opportunity.Id}' ");
var records = resultMSA.getArray("records");

for (var i=0; i<records.length; i++) {
    var record = records[i].id;
navigateToUrl('/p/process/Submit?id=record&retURL=%2F{!Opportunity.Id}');
}
if (!result[0].getBoolean("success")) 
{ 
alert("Failed to create MSA Request: " + result[0]); 
}

 on the NavigatetoURL , the id=record should be  the id of the MSA_request__C created.

 

Thanks for the help!!

 

B

Hello!

 

I've noticed that if I enable "Development mode" on the user (myself) and create a VF page with a javascript that has a "navigatetoURL('http://www.google.com')" it works just fine. Now, If I disable "devfelopment mode" on the user, all the javascript works fine, EXCEPT for the navigatetoURL.

 

IS there a way to have tis working on any user ?

 

Thanks!

B

Guys,

 

Trying to have a field in a simple VF page that is hidden and once the VF page is loaded, it grabs the current date and time nad once SUBMITTED a field will be saved with that data. The field is the   Tour_given_date__c.

 

I ahve the Jscript working, but it does not set the value to the field. 

 

 

<apex:page standardController="Lead" id="p1" showHeader="false" sidebar="false" >
<apex:pageBlock title="" id="pb1">
<apex:form id="f1" >
<table width="60%" columns="2">

<td align="left"><p><b>First name: </b><br/><apex:inputField value="{!Lead.FirstName}" /></p></td>
<td align="left"><p><b>Last name:</b><apex:inputField value="{!Lead.LastName}" /></p></td><tr/>
<td align="left"><p><b>Email:</b> <br/><apex:inputField value="{!Lead.email}" /></p></td>
<td align="left"><p><b>Phone:</b> <br/><apex:inputField value="{!Lead.phone}" /></p></td><tr/>
<td align="left"><p><b>Zip Code:</b> <br/><apex:inputField value="{!Lead.Zip_Code__c}" /></p></td>


<td align="left"><div id="a" style="display:none;"><p><b>Tourgivendate</b> <br/><apex:inputField value="{!Lead.Tour_given_time__c}" id="dt"/></p></div></td>

</table>




<p><b>Who is giving you the tour? (Please ask the Front desk manager)</b><br/> <apex:inputField value="{!Lead.Tour_Given_by__c}" /></p><br/><br/>
<apex:commandButton value="Save" action="{!save}" onclick="AssignnDatevalu();" />
</apex:form>
<script>
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var dayOK = currentTime.getDate()
var year = currentTime.getFullYear()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
var dianoite = "AM"
if (hours >= 12){
dianoite = "PM"
}
if (minutes < 10){
minutes = "0" + minutes
}
if (hours > 12){
hours = (hours - 12)
}

function AssignnDatevalu()
{
document.getElementById('dt').value=month + "/" + dayOK + "/" + year + " " + hours + ":" + minutes + " " + dianoite;
return true;

}
</script>
</apex:pageBlock>

</apex:page>

Thanks for the hELP!

 

 

 

 

Hi there,

 

working on a simple VF page using the standard controller "Lead" and the VF page will be opened through a button on the lead page.

 

What I want to do is to pre populate a field "Tourgivendate__C" with the current date time  {!NOW()}. If this can be hidden, even better. SO when the user updated the info and hits the submit button , the Lead record will now have the "Tourgivendate__C" field populated with the time the person opened the form.

 

Also, on my Commandbutton, I have a     onclick"navigatetoURL('/secur/logout.jsp');"  that is not logging out after the button is clicked. It worls fine on the Sandbox, but in production is not logging me out whe I hit the button. It saves the record but no logou.  Here is the code:

 

<apex:page standardController="Lead" showHeader="false" sidebar="false" >
<img src="{!URLFOR($Resource.logo3w, 'logo3w.jpg')}"/>
  <apex:pageBlock title="">
  <apex:form >
  <table width="60%" columns="2">
  
    <td align="left"><p><b>First name:  </b><br/><apex:inputField value="{!Lead.FirstName}" /></p></td>
    <td align="left"><p><b>Last name:</b><apex:inputField value="{!Lead.LastName}" /></p></td><tr/>
    <td align="left"><p><b>Email:</b> <br/><apex:inputField value="{!Lead.email}" /></p></td>
    <td align="left"><p><b>Phone:</b> <br/><apex:inputField value="{!Lead.phone}" /></p></td><tr/>
    <td align="left"><p><b>Zip Code:</b> <br/><apex:inputField value="{!Lead.Zip_Code__c}" /></p></td>
    
 </table>
     
     
  <p><b>Primary area of interest:</b> <br/><apex:inputField value="
    
    <p><b>Who is giving you the tour? (Please ask the Front desk manager)</b><br/> <apex:inputField value="{!Lead.Tour_Given_by__c}" /></p><br/><br/>
 <apex:commandButton value="Save" action="{!Save}" onclick="navigateToUrl('/secur/logout.jsp');"/>
   </apex:form>
  </apex:pageBlock>                   
 
</apex:page>

 Thanks a lot!

 

B

HI,

 

is there a way I can do it in VF that the command button simply save the record and Logs the current user out ? Maybe through the apex:commandButton action ?

 

This is a simple VF page that would be handed out to a customer , no back buttons and no access to anything. The issue is that after saving the record through the VF page, SF goes directly to the lead record . IS there a way I can avoid that , logout and redirect to a diferent URL?  Or maybe better ideas ? :)

 

Thanks!

 

B

HI there,

 

working on a trigger too get the parent role of the opportunity Owner user, as I beleive I can;t do it using a formula in SF. If possible please let me know. But my issue is that the trigger bellow will not let me update the field "Manager_role__C" as the error says that  "Can't execute the After Update" as record is read only . Tried to change the trigger to "before update" and got another error as it says " execution of BeforeUpdate caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old: Trigger.AboveRole: line 20, column 1"

 

Pretty sure it is a simple thing in my code but driving me crazy as usual.. Not sure also if this is becasue I have other triggers in the Oppt object , all 'After update" but they will change values in other objects than the Oppt itself. Here is the code:

 

trigger AboveRole on Opportunity (before insert, before update) {
  Set<Id> recordIds = new Set<Id>();
  Set<Id> acctIds = new Set<Id>();
  Set<Id> userIds = new Set<Id>();
  Set<Id> roleIds = new Set<Id>();
 

  for(opportunity S:Trigger.new)
    if(S.type == 'Renewal'){
     recordIds.add(S.id);
      acctIds.add(S.accountid);
    userIds.add(S.ownerid);
 
        
    List<User> RoleUSer = [Select userroleID from USER where id in :userids];
    roleIds.add(RoleUser[0].userroleID);
    List<Userrole> roleparent =[Select parentroleid from userrole where id in:roleIds];
       IF (roleparent.size() > 0){
       S.manager_role__C = roleparent[0].parentroleid;
       update s;      
       }
    }

}

 


I've been looking aroud to check if is possible to send an email to the Opportunity Owner Manager, according to the ROle Hierarchi. I've setup the rule already to send the email to the Oppt owner. So I need to add the people on the imediate role above the Oppt owner on the emal.

 

Is is possible ?

 

Thanks!

B

Hi,

 

I have pretty much the trigger working, but when the lead is converted and it creates the contact, I need the Contact created to have the same account ID that is on the "acctmatch" list on the trigger. What is happening now is that the conversion is creating a new account and NOT assigning the created Contact to the acctmatch[0].id  that i want.

 

Pretty much, do NOT create a new account and assign the created contact from the conversion, to the Account from the acctmatch SOQL.  here is the code:

 

trigger LeadConvert on Lead (after insert,after update) {

Set<Id> recordIds = new Set<Id>();
List<String> LeadNames = new List<String>{};
List<String> Leaddomain = new List<String>{};
Set<id> acctId = new Set<id>{};

for(Lead myLead: Trigger.new){
 if((myLead.isconverted==false) && (myLead.convertme__c == True) && (myLead.status <> 'Unqualified') && (mylead.email <> Null) && (mylead.autodomain__c <> null) ) {
 
     recordIds.add(myLead.id);
     Leaddomain.add(myLead.autodomain__c);
    
    Account[] acctmatch = [Select id, name, domain__c from account where domain__c in :Leaddomain];
    IF (acctmatch.size() > 0){
      acctId.add(acctmatch[0].id);

Database.LeadConvert lc = new database.LeadConvert();

        lc.setLeadId(myLead.Id);
        lc.convertedStatus = 'Qualified';
        //Database.ConvertLead(lc,true);
        lc.setDoNotCreateOpportunity(true);
        Database.LeadConvertResult lcr = Database.convertLead(lc);
        System.assert(lcr.isSuccess()); 
        
        
        if (myLead.IsConverted) {
            // Assign the value from the Lead to Contact
            Contact con = [SELECT Id FROM Contact WHERE Contact.Id = :mylead.ConvertedContactId];
            con.Accountid = acctmatch[0].id;
            update con;         
        }
        
    }
   }
  }
}

 Thanks! almost there.. ;)

Hello!

 

Looked around to chekc how would I go for a formula to simply add 01 hour to a Date/time field. The scenario is a field name "Mystartdatetime__C" which is a date/time field and another field "Myenddatetime__C", this one beiing a formula field, Date/time result, that the result should be 01 hour plus from the "Mystartdatetime__C" 

 

i.e.  Mystartdatetime__C =  01/05/2011 10:00 AM

        Myenddatetime__C( Formula field) =  01/05/2011 11:00 AM

 

Thanks!


Hi there,

 

I working on have a field in the parent account, that pretty much should be a SUM of all the Children's field named "Healthy_CMRR__C". I know it should be a standard functionality in SF to be able to do roll-up summary on child accounts, but as we know it is noet and I'm trying a work around . What I did was to create a field in the account called Healthy_CMRR_Child__c . Another field called Total_Healthy_CMRR__c is a formula field taht adds  Healthy_CMRR__C and Healthy_CMRR_Child__c. Healthy_CMRR_Child__c is a currency field that my trigger will update, based on the opportunities with a criteria. Here is the code:

 

trigger HealthyRenewalCMRR on Account (after update) {
  Set<Id> recordIds = new Set<Id>();
  Set<Id> parentIds = new Set<Id>();
  Set<Id> acctownerIds = new Set<Id>();
  map<Id,decimal> healthc = new Map<Id,decimal>();
  
for(account t:Trigger.new)
   if(t.parentid <> null ){
      recordIds.add(t.id);
      ParentIds.add(t.parentid);
       healthc.put(t.id,t.Healthy_CMRR__c);
     
  List < account> acctparent = [select id, Healthy_CMRR_Child__c, limit 1];
  
      IF(acctparent.size() > 0){
      
           If ( acctparent[0].Healthy_CMRR_Child__c != null){
               acctparent[0].Healthy_CMRR_Child__c = acctparent[0].Healthy_CMRR_Child__c + healthc.put(t.id,t.Healthy_CMRR__c);
               update acctparent;
           } ELSE IF (acctparent[0].Healthy_CMRR_Child__c == null){
                acctparent[0].Healthy_CMRR_Child__c =  healthc.put(t.id,t.Healthy_CMRR__c);
                 update acctparent;
                 }
}
}

 The issue is that anytime the acct is updated, it keeps adding over and over the healthy__CMRR__C value, although the value didn;t change. I know it is doing exaclty what the trigger is saying, but wonder if someone would ahve a better idea on how can I sum the values of a field of a Child record in SF.

 

Thanks a lot!

B

 


Hi guys,

 

having an issue with thew forecast tab. The user have the default currency set to USD. When the user opens his forecast, he sees the current Fiscal Year in USD, and the 2014 year and so on in British Pounds (his previous default currency setup). Once you change your default currency to USD, shouldn't your whole environment (including Forecast) be now in the currency you;ve set in your default currency on the user settings?

 

Thanks!

 

B

Hi there,

 

this one seems strange, but I want to check first before saying something that is out of my hands. :) I have this trigger that calculates the CMRR amounts and updates the parent account. The goal is to always have the Top parent account updated with the SUM of the CMRR fields (05 of them) from the child account records. 

 

So, whenever an account is updated, the trigger finds a parent  account (if any) and all other children related to the same parent and updates the Parent with the sum Of all children CMRR fields (05 diferent types of CMRR). Well, this works beautifully when I do update records manually. Tested them many many times and the results are perfectly using, child, grandchild records and so on. Tested in som amny diferent ways and always worked fine. What is happening is that (Ibeleive) we have data.com massively updating our accounts with the most current data as far as web addresses, phone numbers and such. After those updates, the CMRR numbers on the accounts go crazy. Things like from $0 to $2,550,356.00 CMRR. IMpossible as the parent and children have NO CMRR at all. they are at 0.    Here is the code:

 

trigger TotalsCMRR on Account (after update) {
  Set<Id> recordIds = new Set<Id>();
  Set<Id> parentIds = new Set<Id>();
  
  for(account t:Trigger.new)
   if(t.parentid <> null ){
      recordIds.add(t.id);
      ParentIds.add(t.parentid);
       
     List < account> acctparent = [select id, ChildOR__c, ChildNew__C, Healthy_CMRR_Child__c, Healthy_Upsell_CMRR_Child__c, Churned_CMRR_Child__c, New_Business_CMRR_Child__c, Retention_Risk_CMRR_Child__c from account where id in :ParentIds limit 1]; 

     
     LIST<AggregateResult> ChildCMRR = [select sum(Total_Healthy_CMRR__c)childsum, sum(Total_Churned_CMRR__c)childchurn, sum(Total_Healthy_Upsell_CMRR__c)childupsell, sum(Total_Open_New_Business_CMRR__c)childnew, sum(Total_Retention_Risk_CMRR__c)childret from Account where parentid in :ParentIds]; 
     System.debug('ChildCMRR: ' + ChildCMRR);
     
     Decimal D = (Decimal) ChildCMRR[0].get('childsum');
     acctparent[0].Healthy_CMRR_Child__c = D;
     Decimal D2 = (Decimal) ChildCMRR[0].get('childchurn');
     acctparent[0].Churned_CMRR_Child__c = D2;
     Decimal D3 = (Decimal) ChildCMRR[0].get('childupsell');
     acctparent[0].Healthy_Upsell_CMRR_Child__c = D3;
     Decimal D4 = (Decimal) ChildCMRR[0].get('childnew');
     acctparent[0].New_Business_CMRR_Child__c = D4;
     Decimal D5 = (Decimal) ChildCMRR[0].get('childret');
     acctparent[0].Retention_Risk_CMRR_Child__c = D5;
     update acctparent;
     
     IF (D > 0){
     acctparent[0].ChildOR__c = True;
    }
     IF (D == 0){
     acctparent[0].ChildOR__c = False;
     }
     IF (D4 > 0){
     acctparent[0].ChildNew__c = true;
    }
      IF (D4 == 0){
     acctparent[0].ChildNew__c = false;
    }
    update acctparent;
   }
}

 

Just as an example, on the same account (or any other account updated during the mass data.com updates) that I had the Total CMRR changed from 0 to $2,550,350.00 , if I just "touch" a child record (add a description or a phone number)for the same parent account and save it, the CMRR goes back to Normal on the parent. I beleive this tells me that the trigger works fine.??..

 

any thoughts? AS usual, thanks for the great help !

B

Hi there , I have a formula text field that reads another formula field but a number, and adds an image. My issue is that the number formula field is set with NO decimals. But, when i reference the # field in my new text formula field, all the decimals are showing. So, A1 is a formula number field with NO decimals and i'm trying this: TEXT(A1)&" - " Image(/img/green.jpg.... And so on. Is there a way to have the A1 value show as I set the field with no decimals ? Thanks! B

HI There,

 

I know it sounds weird, but is there a way to prevent users from using a certain email template or folder, when sending emails from a Oppty record as an example, depending on a certain criteria on the record? LEts say If a box is checked for "Oppty not ready", the user can't use a certain email template ?

 

Thinking of some ideas here but any help is appreciated!

Thanks!

 

B

HI there,

 

I Have a very simple VF page that uses the standard controller "projects__C".  The only reason the page exists is to display certain fields of the custom object in a certain way. It has a save button, so it saves the values of the specific fields on the record. Regardless, the page works fine and I have a little Javascript that simply redirects the page after saving it. Well, That works fine in Google Chrome, as when you hit the SAVE, the record is saved and the page refreshes just fine. NOw in Firefox, the whole page for the preoject__C record reloads within the section where the VF page was supposed to be.

 

All I need it to have the save button just to SAVE the record and NOT load the main page into the VF page Section.

 

here is the code: 

 

<apex:page standardController="Projects__c"  showHeader="false" >

<apex:form id="f1" >
<table width="90%" columns="3" align="left">

<td align="right"><b>PM Owner: </b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Owner__c}" /></td>
<td align="right"><b>PM Start date:</b></td><td align="left"><apex:inputField value="{!Projects__c.PM_Start_Date__c}"  /></td>
<td align="right"><b>PM Hours:</b></td><td align="left" width="70"><apex:inputField value="{!Projects__c.PM_Hours__c}"  /></td><tr/>


<td align="left"><apex:commandButton value="Save" action="{!save}" onclick="savemenow();"  oncomplete=""/></td>
</table>
<script>
function savemenow()
{
var url='/{!Projects__c.id}';
window.location.href= url;
navigateToUrl('/{!Projects__c.id}');
return true;
}
</script>
</apex:form>
</apex:page>

 Thanks!

B

HI guys,

 

very simple class but it is not capturing the Opportunity__C (which is a master detail field to the Opportunity) id, to macth the Opportunity Line Items I want.  I have the exact same class for another object and it captures the object Id just fine. Not sure whats the issue here..

 

 

public class productsprojects
{
  private List<OpportunityLineItem> products;
  public List<OpportunityLineItem> getproducts()

    {
      products = [ SELECT product_name__c, Design__c, Development__c, Custom_Template_Category__c
                        FROM OpportunityLineItem 
                            WHERE OpportunityId = :System.currentPagereference().getParameters().get('Opportunity__c')  
            ];
            
      return products;
    }
}

 Thanks for the help!

B

 

Hi there,

 

I have this button I've created that is supposed to submit a child object from an opportunity for approval. The submisison works As I manually test by entering the IDs on the URL, but I'm having an issue in getting the var "record", which is my MSA_requst__C object ID into the URL. here is the code:

 

{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")} 

var t1= new sforce.SObject("MSA_Requests__c" ); 
t1.Opportunity__c = "{!Opportunity.Id}"; 
result = sforce.connection.create([t1]); 

var resultMSA = sforce.connection.query("Select Id From MSA_Requests__c where Opportunity__C = '{!Opportunity.Id}' ");
var records = resultMSA.getArray("records");

for (var i=0; i<records.length; i++) {
    var record = records[i].id;
navigateToUrl('/p/process/Submit?id=record&retURL=%2F{!Opportunity.Id}');
}
if (!result[0].getBoolean("success")) 
{ 
alert("Failed to create MSA Request: " + result[0]); 
}

 on the NavigatetoURL , the id=record should be  the id of the MSA_request__C created.

 

Thanks for the help!!

 

B

Hello!

 

I've noticed that if I enable "Development mode" on the user (myself) and create a VF page with a javascript that has a "navigatetoURL('http://www.google.com')" it works just fine. Now, If I disable "devfelopment mode" on the user, all the javascript works fine, EXCEPT for the navigatetoURL.

 

IS there a way to have tis working on any user ?

 

Thanks!

B

Guys,

 

Trying to have a field in a simple VF page that is hidden and once the VF page is loaded, it grabs the current date and time nad once SUBMITTED a field will be saved with that data. The field is the   Tour_given_date__c.

 

I ahve the Jscript working, but it does not set the value to the field. 

 

 

<apex:page standardController="Lead" id="p1" showHeader="false" sidebar="false" >
<apex:pageBlock title="" id="pb1">
<apex:form id="f1" >
<table width="60%" columns="2">

<td align="left"><p><b>First name: </b><br/><apex:inputField value="{!Lead.FirstName}" /></p></td>
<td align="left"><p><b>Last name:</b><apex:inputField value="{!Lead.LastName}" /></p></td><tr/>
<td align="left"><p><b>Email:</b> <br/><apex:inputField value="{!Lead.email}" /></p></td>
<td align="left"><p><b>Phone:</b> <br/><apex:inputField value="{!Lead.phone}" /></p></td><tr/>
<td align="left"><p><b>Zip Code:</b> <br/><apex:inputField value="{!Lead.Zip_Code__c}" /></p></td>


<td align="left"><div id="a" style="display:none;"><p><b>Tourgivendate</b> <br/><apex:inputField value="{!Lead.Tour_given_time__c}" id="dt"/></p></div></td>

</table>




<p><b>Who is giving you the tour? (Please ask the Front desk manager)</b><br/> <apex:inputField value="{!Lead.Tour_Given_by__c}" /></p><br/><br/>
<apex:commandButton value="Save" action="{!save}" onclick="AssignnDatevalu();" />
</apex:form>
<script>
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var dayOK = currentTime.getDate()
var year = currentTime.getFullYear()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
var dianoite = "AM"
if (hours >= 12){
dianoite = "PM"
}
if (minutes < 10){
minutes = "0" + minutes
}
if (hours > 12){
hours = (hours - 12)
}

function AssignnDatevalu()
{
document.getElementById('dt').value=month + "/" + dayOK + "/" + year + " " + hours + ":" + minutes + " " + dianoite;
return true;

}
</script>
</apex:pageBlock>

</apex:page>

Thanks for the hELP!

 

 

 

 

Hi there,

 

working on a simple VF page using the standard controller "Lead" and the VF page will be opened through a button on the lead page.

 

What I want to do is to pre populate a field "Tourgivendate__C" with the current date time  {!NOW()}. If this can be hidden, even better. SO when the user updated the info and hits the submit button , the Lead record will now have the "Tourgivendate__C" field populated with the time the person opened the form.

 

Also, on my Commandbutton, I have a     onclick"navigatetoURL('/secur/logout.jsp');"  that is not logging out after the button is clicked. It worls fine on the Sandbox, but in production is not logging me out whe I hit the button. It saves the record but no logou.  Here is the code:

 

<apex:page standardController="Lead" showHeader="false" sidebar="false" >
<img src="{!URLFOR($Resource.logo3w, 'logo3w.jpg')}"/>
  <apex:pageBlock title="">
  <apex:form >
  <table width="60%" columns="2">
  
    <td align="left"><p><b>First name:  </b><br/><apex:inputField value="{!Lead.FirstName}" /></p></td>
    <td align="left"><p><b>Last name:</b><apex:inputField value="{!Lead.LastName}" /></p></td><tr/>
    <td align="left"><p><b>Email:</b> <br/><apex:inputField value="{!Lead.email}" /></p></td>
    <td align="left"><p><b>Phone:</b> <br/><apex:inputField value="{!Lead.phone}" /></p></td><tr/>
    <td align="left"><p><b>Zip Code:</b> <br/><apex:inputField value="{!Lead.Zip_Code__c}" /></p></td>
    
 </table>
     
     
  <p><b>Primary area of interest:</b> <br/><apex:inputField value="
    
    <p><b>Who is giving you the tour? (Please ask the Front desk manager)</b><br/> <apex:inputField value="{!Lead.Tour_Given_by__c}" /></p><br/><br/>
 <apex:commandButton value="Save" action="{!Save}" onclick="navigateToUrl('/secur/logout.jsp');"/>
   </apex:form>
  </apex:pageBlock>                   
 
</apex:page>

 Thanks a lot!

 

B

HI,

 

is there a way I can do it in VF that the command button simply save the record and Logs the current user out ? Maybe through the apex:commandButton action ?

 

This is a simple VF page that would be handed out to a customer , no back buttons and no access to anything. The issue is that after saving the record through the VF page, SF goes directly to the lead record . IS there a way I can avoid that , logout and redirect to a diferent URL?  Or maybe better ideas ? :)

 

Thanks!

 

B