• CharlesDou
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 19
    Replies
Is there any way to monitor how long does a field stays for a value in opportunities? For exapmle, for the stage field in opportunities, if it stays for "needs to be quoted" for 2 days, then send an email to the customer. And if the field changes to "quote sent", after 2 days of the change(during the time this field does not change), send another email. Hoe can I do that in salesforce? Just need an idea.
Hi All,

I am a starter on visualforce development and I am having a problem setting focus using jQuery on visualforce page.

here is part of the code for the visualforce:

<apex:form id="dataform">
    <apex:pageBlock title="LABOR AND QUANTITY BOOKING" mode="edit" id="pageblock">
        <apex:pageBlockSection columns="1" id="section">
            <apex:inputText value="{!operator}" label="Operator" id="operator"/>
            <apex:inputText value="{!workOrderNumber}" label="Work Order" id="wo"/>
       </apex:pageBlockSection>
      <apex:pageBlockButtons id="buttons" location="bottom">
            <apex:commandButton value="Save" action="{!save}" id="save" />
            <apex:commandButton value="Cancel" action="{!cancel}"/>
       </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>

What I am trying to do is to set focus on the second field(work order)when page loads, and here is the jQuey
<apex:includeScript value="{!URLFOR($Resource.jquery)}"  />
<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("[id='{!$Component.dataform.pageblock.section.wo}']").focus();
    });
</script>

But the code is not working. the focus will always be on the first field. I tried to do an alert after the set focus statement, and it looks like the focus is set to the second field when it alerts, but for some reason, it is set back to the first field after the alert. Have any ideas?

Hi,

 

I was trying to run a report on Opportunity. If I login as admin, the report will return the records I need. However, other users or roles cannot see any record being returned. Any ideas why?

 

Thanks.

Hi Guys,

 

I am trying to develop a VF page that lists all the unread opportunities. Once the Opportunity is read, remove it from the list. Is there any way to do with that?

 

Thanks.

Hi everyone,

 

Our Company is using financial force accounting system, and I just wrote a trigger on the sales invoice object. Now when I wrote a test class for it, I use the code below:

 

c2g__CodaInvoice__c salesinvoice = new c2g__CodaInvoice__c();
//set values for the invoice
c2g__Opportunity__c = opp.id;
c2g__Account__c = acc.id;// opp and acc are already defined
...
... insert salesinvoice;

 But when I run the test, I always get an error message "no current company". Does anybody know what causes this error and how to get rid of it? Thanks a lot!!

Hi guys,

 

I have a public checkout site in salesforce. And sometimes I recieve feedbacks from our customer that they got ssl error while visiting this page. The error is an SSL certificate issued error and I don;t how to deal with it. Caould anybody give me some advices to get rid of it? Thanks.

Hi all,

 

I have custumized the "convert lead" process using a custome convert button. And now, I want to use this button also in the lead "find duplicates" page, which means replace the "convert lead" button in the "find duplicates" page with my own "convert " button. Is there any way to do that?

 

Thanks a lot!!

Hi all,

 

I am a beginner developing apex code in salesforce. Now I have a problem with deploying triggers.

 

I have a trigger that will prevent updating opportunity:

 

trigger LockDownOpportunity on Opportunity (before update) {
    Opportunity[] opps = [select stageName from Opportunity where id in :Trigger.new];
    Profile f = [select name from Profile where id=:UserInfo.getProfileId()];
    
    for(Opportunity opp:opps){
        if((opp.stageName=='Invoicing Complete'&&f.name=='xxxxx')||(opp.stageName=='Order Complete and Closed'&&f.name=='xxxxx')){
             Opportunity actualRecord = Trigger.newMap.get(opp.Id);
             actualRecord.adderror('You do not have administrative rights to reopen this closed opportunity.');
        }
    }

 I wrote a test method for it and got a 100% code coverage. But it won't let me to deploy it and the error is: Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0067000000Str1qAAB; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You do not have administrative rights to reopen this closed opportunity.: []", Failure Stack Trace: "Class.testLockOpportunity.test: line 22, column 1"

 


It seems it stops me deploying it because of updating fail. But as I mentioned, I need the update to fail. How do I deploy the trigger? thank you all.

 

And here is my test code

@isTest

public class testLockOpportunity{
    static testMethod void test(){
        Profile p = [select id from Profile where name='xxxxxx'];
        User testUser = new User(alias = 'u1', email='u1@testorg.com',
                        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',
                        localesidkey='en_US', profileid = p.Id, country='United States',
                        timezonesidkey='America/Los_Angeles', username='u1@testorg.com');
 
       insert testUser;
       Opportunity opp = new Opportunity(stageName = 'Invoicing Complete',
                                         closeDate = Date.today()+30,
                                         Name = 'test',
                                         OwnerId = testUser.id);
        
        insert opp;
       
       System.runAs(testUser){
           opp.Client_Email_Address__c = 'test@test.com';
           Test.startTest();
           update opp;
           Test.stopTest();
       }
    }
}

 

 

Hi all,

 

How can I create a VF page which looks exactly the same with the Opportunity edit page? Because I need to do some customizing on that edit page. Any ideas will be welcome. Thank you.

Hi everyone:

 

I am trying to create a new opportunity with some information automaticly flowed from an Account. Which apex class should I modify? Or is there any other methods. Thanks a lot.

Hi everybody:

 

I am trying to write a visualforce and let the customer to upload an image. The code is:

 

VF code:

<label>Optional: Upload Image</label><apex:inputFile value="{!body}" fileName="{!fileName}" styleclass="apexinput"/>
<apex:CommandButton value="Save" action="{!Upload}"/>

 Apex Controller:

 

//definitions
    public Document doc{get;set;}
    public Blob body{get;set;}
    public String fileName{get;set;}

public pageReference Upload(){
//relative code
doc.body = body;
doc.Name = fileName;
insert doc;
}

 Why am I getting the  "Authorization Required " error everytime? Please Help. Thank you all.

 

Hi, 

 

I created a site which contains a form that needs to be filled out by customer. After the customer submit the form, the information will goes in to object Opportunity. And after the opportunity is updated, an email alert will be sent to somebody. 

 

Here comes my problem: the email sender's name is always " Site Guest User", but I need it to be the Opportunities' Owner (a field in Opportunity), how could I do that?

 

Thank you.

What changes in the Winter 15 release would cause the system to start throwing parse errors in an xml reader apex? It was working perfectly, and suddenly stopped working. The Debug Log message is SystemXMLException ParseError.
Hi All,

I am a starter on visualforce development and I am having a problem setting focus using jQuery on visualforce page.

here is part of the code for the visualforce:

<apex:form id="dataform">
    <apex:pageBlock title="LABOR AND QUANTITY BOOKING" mode="edit" id="pageblock">
        <apex:pageBlockSection columns="1" id="section">
            <apex:inputText value="{!operator}" label="Operator" id="operator"/>
            <apex:inputText value="{!workOrderNumber}" label="Work Order" id="wo"/>
       </apex:pageBlockSection>
      <apex:pageBlockButtons id="buttons" location="bottom">
            <apex:commandButton value="Save" action="{!save}" id="save" />
            <apex:commandButton value="Cancel" action="{!cancel}"/>
       </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>

What I am trying to do is to set focus on the second field(work order)when page loads, and here is the jQuey
<apex:includeScript value="{!URLFOR($Resource.jquery)}"  />
<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("[id='{!$Component.dataform.pageblock.section.wo}']").focus();
    });
</script>

But the code is not working. the focus will always be on the first field. I tried to do an alert after the set focus statement, and it looks like the focus is set to the second field when it alerts, but for some reason, it is set back to the first field after the alert. Have any ideas?

Hi Guys,

 

I am trying to develop a VF page that lists all the unread opportunities. Once the Opportunity is read, remove it from the list. Is there any way to do with that?

 

Thanks.

Hi

i write method for geting the distinct values from one filed ,

Am getting the values in debug log

now this values i have to show in vf page how can i show that.

i try with repeat tag but am not getting result can any one help me

 below is my code

 

 

public List<string> getinbound()
    {
                set<String> setValues = new set<String>();
                List<string> lstOptions = new List<string>();
            
                
                for(Samples_Mgmt__c  sm : [Select Inbound_Carrier__c from Samples_Mgmt__c where Digital_Factory__c=:Myid])
                {
                   setValues .add(sm .Inbound_Carrier__c );
                }
                     system.debug('inbound'+setValues );
            
                for(String str : setValues )
                {
                    if(str!=null)
                    {
                    lstOptions.add(str);
                    }
                }
                 system.debug('inboundmyidinbound'+lstOptions);
                 return lstOptions;
          
              
       }

 

 

and here my vf page what am tryibg

 

<apex:repeat value="{!inbound}" var="a">
    
    <tr>
<td><apex:outputText value="{!a.inbound_carrier__c}" /></td>
</tr>
    </apex:repeat></p>

 

 

can any one tel me how can i show values in my vf page

Hi everyone,

 

Our Company is using financial force accounting system, and I just wrote a trigger on the sales invoice object. Now when I wrote a test class for it, I use the code below:

 

c2g__CodaInvoice__c salesinvoice = new c2g__CodaInvoice__c();
//set values for the invoice
c2g__Opportunity__c = opp.id;
c2g__Account__c = acc.id;// opp and acc are already defined
...
... insert salesinvoice;

 But when I run the test, I always get an error message "no current company". Does anybody know what causes this error and how to get rid of it? Thanks a lot!!

Hi guys,

 

I have a public checkout site in salesforce. And sometimes I recieve feedbacks from our customer that they got ssl error while visiting this page. The error is an SSL certificate issued error and I don;t how to deal with it. Caould anybody give me some advices to get rid of it? Thanks.

Hi all,

 

I have custumized the "convert lead" process using a custome convert button. And now, I want to use this button also in the lead "find duplicates" page, which means replace the "convert lead" button in the "find duplicates" page with my own "convert " button. Is there any way to do that?

 

Thanks a lot!!

Hi all,

 

I am a beginner developing apex code in salesforce. Now I have a problem with deploying triggers.

 

I have a trigger that will prevent updating opportunity:

 

trigger LockDownOpportunity on Opportunity (before update) {
    Opportunity[] opps = [select stageName from Opportunity where id in :Trigger.new];
    Profile f = [select name from Profile where id=:UserInfo.getProfileId()];
    
    for(Opportunity opp:opps){
        if((opp.stageName=='Invoicing Complete'&&f.name=='xxxxx')||(opp.stageName=='Order Complete and Closed'&&f.name=='xxxxx')){
             Opportunity actualRecord = Trigger.newMap.get(opp.Id);
             actualRecord.adderror('You do not have administrative rights to reopen this closed opportunity.');
        }
    }

 I wrote a test method for it and got a 100% code coverage. But it won't let me to deploy it and the error is: Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0067000000Str1qAAB; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You do not have administrative rights to reopen this closed opportunity.: []", Failure Stack Trace: "Class.testLockOpportunity.test: line 22, column 1"

 


It seems it stops me deploying it because of updating fail. But as I mentioned, I need the update to fail. How do I deploy the trigger? thank you all.

 

And here is my test code

@isTest

public class testLockOpportunity{
    static testMethod void test(){
        Profile p = [select id from Profile where name='xxxxxx'];
        User testUser = new User(alias = 'u1', email='u1@testorg.com',
                        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',
                        localesidkey='en_US', profileid = p.Id, country='United States',
                        timezonesidkey='America/Los_Angeles', username='u1@testorg.com');
 
       insert testUser;
       Opportunity opp = new Opportunity(stageName = 'Invoicing Complete',
                                         closeDate = Date.today()+30,
                                         Name = 'test',
                                         OwnerId = testUser.id);
        
        insert opp;
       
       System.runAs(testUser){
           opp.Client_Email_Address__c = 'test@test.com';
           Test.startTest();
           update opp;
           Test.stopTest();
       }
    }
}

 

 

Hi everyone:

 

I am trying to create a new opportunity with some information automaticly flowed from an Account. Which apex class should I modify? Or is there any other methods. Thanks a lot.

Hi everybody:

 

I am trying to write a visualforce and let the customer to upload an image. The code is:

 

VF code:

<label>Optional: Upload Image</label><apex:inputFile value="{!body}" fileName="{!fileName}" styleclass="apexinput"/>
<apex:CommandButton value="Save" action="{!Upload}"/>

 Apex Controller:

 

//definitions
    public Document doc{get;set;}
    public Blob body{get;set;}
    public String fileName{get;set;}

public pageReference Upload(){
//relative code
doc.body = body;
doc.Name = fileName;
insert doc;
}

 Why am I getting the  "Authorization Required " error everytime? Please Help. Thank you all.

 

Hi, 

 

I created a site which contains a form that needs to be filled out by customer. After the customer submit the form, the information will goes in to object Opportunity. And after the opportunity is updated, an email alert will be sent to somebody. 

 

Here comes my problem: the email sender's name is always " Site Guest User", but I need it to be the Opportunities' Owner (a field in Opportunity), how could I do that?

 

Thank you.

Hi, I am trying to setup the secure web address so I can provide it to a banking service, they require this link to have https at the begining, however when I access my secure web address it crosses a line on the https indicating that there is unsecure content:

 

https://app-facturacion-incompany.force.com/colormelocoton

 

https wrong

 

I have verified that there is no unsecure content and tried with several VF pages and the problem persists, also verified that the option "force https" is checked, still nothing.

 

Any ideas how make this look something like this:

 

Https good

 

I would appreciate some help. Thanks!

 

-D

Is it possible to hide the 'Task' section altogether on LeadConvert.jsp page? I guess building a VisualForce page is the answer, but I would really appreciate if somebody could point me to sample code that does something similar. I want to retain most of the functionality on that page and just customize the layout a bit.

 

Thanks much! 

  • January 10, 2012
  • Like
  • 0
What changes in the Winter 15 release would cause the system to start throwing parse errors in an xml reader apex? It was working perfectly, and suddenly stopped working. The Debug Log message is SystemXMLException ParseError.