• Kamatchi Devi Sargunanathan
  • SMARTIE
  • 1017 Points
  • Member since 2013
  • Tech Lead
  • MST Solutions

  • Chatter
    Feed
  • 30
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 260
    Replies
Hi..

I'm having error like this.. so I'm not getting any code coverage..
Class.AssetParts.<init>: line 10, column 1
Class.AssetPartsTestClass.AssetPartsTestClass: line 26, column 1

Apex Class:

public with sharing class AssetParts {
  public Asset_Part__c astpart;
  public Physical_Asset__c asset{get;set;}
  public string assetname;
    public AssetParts(ApexPages.StandardController con)
    {
        astpart=(Asset_Part__c)con.getRecord();
        String astname = ApexPages.currentPage().getParameters().get('retURL');
        string[] strsplit = astname.split('/');
        assetname = strsplit[1];---------------> here class error
         asset= new Physical_Asset__c();
       
           
    }
    public String errmsg{get;set;}
    public PageReference Save()
    {
            astpart.Asset_Name__c =assetname;
            insert astpart;
                           
            PageReference ref= new PageReference('/'+assetname);
            ref.setredirect(true);
            return ref;
        }
    }  
   My test class is:

@isTest
public class AssetPartsTestClass
{
     static TestMethod void AssetPartsTestClass()
    {
      PageReference ref = Page.AssetParts;
      Test.setcurrentPage(ref);
     
     
      Account testAccount = new Account(Name='Test Company Name');
      insert testAccount;
    
      Physical_Asset__c phy = new Physical_Asset__c(Name='Physical Asset Name',Vendor_Account__c=testAccount.id);
      insert phy;
     
      Asset_Part__c testassetpart = new Asset_Part__c(Name='Test Assetpart Name',Vendor_Account__c=testAccount.id,Asset_Name__c =phy.id);
      insert testassetpart;
     
        
     
      ApexPages.currentPage().getParameters().put('assetname',phy.id);
      ApexPages.StandardController sc = new ApexPages.StandardController(testassetpart);     
    
      AssetParts  ap = new AssetParts(sc);---------->test class error
      ap.save();
          
    }
}


Please help me from this..

i can't edit profiles.
on my other salesforce account it's like this when i open the Profiles: https://www.dropbox.com/s/esjtc829gwm7kt8/Picture3.png
but on my other account it's like this: https://www.dropbox.com/s/1d2620w9bdv80h7/Picture4.png

both accounts are developer edition.

what is the problem here?
help!

  • December 14, 2013
  • Like
  • 0

Here is the error I am getting:

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: INACTIVE_OWNER_OR_USER, operation performed with inactive user: []", Failure Stack Trace: "Class.ChatterAnswers.createAccount: line 4, column 1 Class.ChatterAnswersCreateAccountTest.validateAccountCreation: line 10, column 1"

I am stumped.  I was able to validate and deploy from my dev sandbox to my UAT sandbox but now I get this error in production when I go to validate.   

I looked to see if I had any assignment rules that were trying to assign to an inactive user.  I also looked to make sure I didn't have any inactive users that are Chatter Answers users.  

Any ideas?

  • December 14, 2013
  • Like
  • 0

When should we use Trigger.new, Trigger.old,Trigger.newMap & Trigger.old.

Hi all,

 

validation atleast one checkbox to checked from list of checkboxes

 

advance thanks

Hi

I have 3 objects that are Loan,Candidate,Position,the Loan object have Candidate and Postion lookup relationship now how to display these three objects data by using pageblocktable .

 

Thanks

Ram

  • November 15, 2013
  • Like
  • 0

THis is a repeat post but I cannot find any way of getting this done:

 

I have a VF email template.

 

<messaging:emailTemplate subject="Account Training Review Required" recipientType="User" relatedToType="Case">
<messaging:HTMLEmailBody >
<html>

----

{!if(relatedTo.Education_checkbox__c = true, " as identified by the Product Support case owner.", " as indicated by a relatively high percentage of support calls having been resolved as 'how to' questions.")}

 The above is what I want... But try that and you get this error:

	Error: EL Expression Unbalanced: ... #{if(relatedTo.Education_checkbox__c = true, " as identified by the Product Support case owner.", " as indicated by a relatively high percentage of support calls having been resolved as 'how to' questions.")} This client’s particular profile#{if(relatedTo.Account.Business_Size__c = "BB", ", an account classified as Big Business,", if(relatedTo.Account.Business_Size__c = "SMB", ", an account classified as Small Business,", if(relatedTo.Account.Business_Size__c = "MB", ", an account classified as Mid-Size Business, ", "")))} has submitted #{if(text(floor(relatedTo.Account.AccountCases__c)) != "", text(FLOOR(relatedTo.Account.AccountCases__c)) & " how to cases in the last 90 days ", "no other cases categorised as how-to")} #{if(text(relatedTo.Account.Account_Cases_last_90_days__c) != "", " out of a total of " & TEXT(relatedTo.Account.Account_Cases_last_90_days__c) & " Product Support calls", "")}, which puts it in the #{relatedTo.AccountTrainingStatusCode__c} zone according to calculated metrics #{if(relatedTo.Account.MinCaseThreshold__c="Red", if(relatedTo.AccountTrainingStatusCode__c = "Red", " and " & relatedTo.Account.MinCaseThreshold__c & " when measured against the number of how to cases that we allow.", " but " & relatedTo.Account.MinCaseThreshold__c & " when measured against the number of how to cases that we allow."),".")}

 

If you try this: \'how to\' then you can save but the same thing is displayed in the email:

\'how to\'

 

Surround the text in the condition with htmlencode() and you see this in the email:

\&#39;how to\&#39;

 

Use jsencode() and you see this:

\\\'how to\\\'

 

Clearly the system wants me to escape the character but it then doesn't do anything about it.

 

Please can someone help?

How i pass corresponding row id in to popup window?

 

public ID rowId {get;set;}
public Item_Assets__c objForPage2{get;set;}
public Pagereference goToPage2(){
 
for(incident_Item_Assets__c obj : IncConfigsItemAsset){
            if(obj.id==rowId){
                objForPage2= obj;
      
            }
        }
     return page.vfactivitypopup;

 

<script>
        var myWindow;
        function pop() {
            myWindow = window.open('/apex/vfactivitypopup','','width=550,height=450');
        }
       
    </script>

<apex:column >
<apex:commandLink action="{!goToPage2}"  value="popup"  onclick="pop();"   >
  <apex:param name="rowId" assignTo="{!rowId}" value="{!com1.id}"  />
</apex:commandLink>
</apex:column> 
  • October 30, 2013
  • Like
  • 0

Hi All,

 

I am new to apex coding but took a shot at writing an opportunity trigger to create a case based off of certain criteria.  The issue I am running into is that a requirement of the trigger is to create a task instead of a case if a field on the associated account called "Closed"(checkbox) is not checked.  I am not sure how to code that logic, currently I have the trigger creating a case if the field "Closed" is checked but not sure how to do it the other way around.  The trigger I have written is below and any help would be greatly appreciated.

 

trigger ImplementationCaseforIntegrationProducts on Opportunity (after insert, after update) {
string recordtype = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Implementation').getRecordTypeId();
/* List<Task> tasks = new List<Task>();*/
List<Case> cases = new List<Case>();
for (Opportunity opp: Trigger.New)
{ case newcase= new case();
if((trigger.isInsert && (opp.StageName.toLowerCase().equals('closed won'))&&((opp.Type.toLowerCase().equals('adjustment'))|| (opp.Type.toLowerCase().equals('additional sales')))&& opp.Integration_Product_Attached__c == True)||
(trigger.isUpdate && (opp.StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName.toLowerCase().equals('closed won'))&&((opp.Type.toLowerCase().equals('additional sales'))||(opp.Type.toLowerCase().equals('adjustment'))) && opp.Integration_Product_Attached__c == True))
{
list<Account> acc = [select id, Closed__c from Account where ID=:opp.AccountId];
if (acc[0].Closed__c == TRUE)
{
system.debug('----------opp.AccountId---->'+opp.AccountId);
newcase.AccountId=opp.AccountId;
newcase.Opportunity__c=opp.Id;
newcase.Subject='New Implementation case for '+opp.Account_Name__c;
newcase.Status='New';
newcase.Origin='Sign Up Form';
newcase.Priority='Medium';
newcase.RecordTypeId=recordtype;
newcase.Billing_Email__c = opp.Billing_Email__c;
cases.add(newcase);
}

}
else
{
}
}

if(cases.size()!=0 && cases.size()!=null)
{
system.debug('----------cases.size()---->'+cases.size());
insert cases;
}

 

Thanks in advance!

I have a Visualforce template designed to pull a list of leads belonging to the recipient of the email. I'm using a component inside of the VF template to display the leads.

 

It seems the user Id is being lost somewhere in the transition from the VF page to the controller. Consequently I'm getting no records back for display by the component.

 

Email template:

<messaging:emailTemplate subject="Reminder: Inactive Opportunity Reminder for: {!Relatedto.Name}" recipientType="User"
relatedToType="User">
    
    <messaging:htmlEmailBody >
        <p>The following leads have not yet been updated:</p>
        <c:Digilant_InactiveLeads ToID="{!RelatedTo.ID}" />
        
        <p>To update these leads, click on the "Lead Status" field located in the upper right on the lead page layout.</p>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>

 Component:

<apex:component controller="Digilant_findInactiveLeads" access="global">
    <apex:attribute name="ToID" type="ID" description="the lead owner ID" assignTo="{!salesRepID}"/>
    
    <apex:dataTable value="{!InactiveLeads}" var="i_lead">
        <apex:column >
            <apex:facet name="header">Name</apex:facet>
            {!i_lead.Name}
        </apex:column>
        
        <apex:column >
            <apex:facet name="header">Source</apex:facet>
            {!i_lead.LeadSource}
        </apex:column>
        
         <apex:column >
            <apex:facet name="header">Created Date</apex:facet>
            {!i_lead.CreatedDate}
        </apex:column>
    </apex:dataTable>

</apex:component>

 Controller:

public class Digilant_findInactiveLeads {
    public List<Lead> leads {get; set;}
    public ID salesRepID {get; set;}

    public Digilant_findInactiveLeads() {
       leads = [select Name, LeadSource, CreatedDate from Lead from Lead where status = 'Open' AND ownerId =: salesRepID];
    }

    public List<Lead> getInactiveLeads() {
        return leads;
    }
}

 

I'm trying to get phone value from VF page contact picklist if contact name is selected then phone field of that record need to be display in <apex:inputText title="Phone" />vf page how to do that 

page code:

<apex:page controller="PickList_cls11">
  <apex:form >
      <apex:actionFunction name="change" action="{!dochange}"/>
      <apex:pageBlock >
          <apex:pageBlockSection >
              <apex:selectList label="Account Names" size="1" onchange="change()" value="{!Aname}" >
                  <apex:selectOptions value="{!options}" >
                  </apex:selectOptions>
              </apex:selectList>
              <apex:selectList label="Contact Names" size="1" value="{!Cname}">
                  <apex:selectOptions value="{!conNames}" >&nbsp;
                  <apex:commandButton value="Show Contact" action="{!Showcon}"/>
                  </apex:selectOptions>
              </apex:selectList>
              <apex:outputText label="Phone">
                  <apex:inputText title="Phone" value="{!cphone}"/>
              </apex:outputText>
          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

 class;

 

public with sharing class PickList_cls {

    public Contact objb {get; set;}
    public string Cname {get; set;}
    public string Aname {get; set;} 
    public list<SelectOption> options{get; set;}
    public list<selectoption> conNames {get; set;}
    public PickList_cls (){
    objb = new contact();
    options = new List<Selectoption>();
    options.add(new selectoption('--None--','--None--'));
    //for(Account a: [Select id, name, (select id,name from Contacts) from Account order by name]){
    for(Account a: [Select id, name from Account order by name]){
      options.add(new selectOption(a.Id,a.name));
      }
      conNames = new list<selectoption>();
  } 
  public void dochange(){
      conNames.clear();
      conNames.add(new selectoption('Select','Select'));
      for(Contact c:[select id,name from Contact where AccountId=:Aname order by name ])
          conNames.add(new selectoption(c.id,c.name));
      }
    public pagereference Showcon(){
        
        return null;    
    }
    
}

 

  • October 22, 2013
  • Like
  • 0

Scenario: I have Standard Task Object and want to add a Field like Formula or which ever suits to need.

 

Needed Result: The Field must tell if the Task was created in Account or Opportunity or any other object under the Account.

 

Example: 

Task 1

Object Label(Field) : Account(Object Label)

 

Task 2

Object Label(Field) : Opportunity(Object Label)

 

Please advice if there is an alternate work around or if there is something I am missing..?

 

  • October 21, 2013
  • Like
  • 0

what  is cross object ?

what is use of it ?

where we use  ?

can i use this in workflow  ?

can use in trigger ?

 

 

   ple tell me , i am new to sfdc .           thank u

Hi,

 

Can we edit custom object permission in "Standard platform user"  profile, if yes how?

 

Note: I have logged in as admin.

 

Thanks,

Manish.

hiee dis is vijay

 

                          i want to knw why we use <pageblocksectionitem> and any small expample for it..thanks in advance :)

Hi,

I want to implement the standard export and Printable view functionality of reports in a visualforce page.

Can anyone let me know if this is possible.

 

Thanks in advance.

Hi Friends,

 

I have a query as follows.

 

[SELECT id,Name,Body_of_topic__c,Subject_Line__c FROM Topics__c Order By Sort_Order__c]

 


where  Sort_Order__c field is a number field. So please tell me the result of this query and the importance of the Order By clause. What happens if Sort_Order__c is 1,2,3  etc.

 

Thanks,

 

Vijay

hello

 dis is vijay

 

 

im trying to  use a formula in my field(father annual income) in a candidate object.my criteria is default value should be 50000$ per annum when a field is empty.im using NULLVALUE(null,50000) but its not getting..waitng for solution.im new to sfdc,need help.thanks in advance..

 

How Can I get the API name (to call the related list) of the Object History?

 

Example:


I created a "Test" custom object and I enabled the "Track Field History" which in return will have a related list of "Test History" related list.

 

In my vf page, I set this code:

 

<apex:detail relatedList="false"/> <!-- Will disabled all Related Lists -->

 

How can I show the "Test History" related list only, I was not able to get the API name of this Related list.

 

 <apex:relatedList list="Question: What should be the API Name for Test History?"/>

 

 

Is it possible to call the API Name of the Test History? If so, how can I get the API name?

 

 

My current workaround is as follows:

<apex:detail relatedList="true"/>

 

In page layout remove all the related list except for Test History related list.

I am writing a code for contacts Custom search. i am able to do search for contacts sucessfully. but i am an issue with render on pageblock .

 

I have 3 issues.

 

1. i would like to disable "results " section until search is happened.

2. in below column " Name " is displaying as a column before search. i want to display only after search.

3. any suggestions test code.

 

appriciated folks your help.

 

----------
public with sharing class ContactSearch {

    public List<Contact> contactResults { get; set; }
    public string pageUrl {get; set;}
    public boolean newContact { get; set; }
  
    
    public ContactSearch (){
    	newContact = false;
    	  	
    }
      
    
    public PageReference newcontact() {
    /*PageReference pageUrl = new  PageReference('/003/e?retURL=%2F003%2Fo&RecordType=012i000000079tC&ent=Contact');
    pageUrl.setRedirect(true);
    return pageUrl;*/
    newContact = true;
    pageUrl = URL.getSalesforceBaseUrl().toExternalForm()+'/003/e?retURL=%2F003%2Fo&RecordType=012i000000079tC&ent=Contact';
    return null;
     }
  
    public PageReference Back() {
    	        
    	        PageReference FCPage = new PageReference('/apex/Contact_FindStudent');
            	FCPage.setRedirect(true);
                return FCPage;
        
    }


    public String Back { get; set; }

    public PageReference Clear() {
        return null;
    }
     
  
    public String ClearText { get; set; }

    public String results { get; set; }

    public String searchText { get; set; }
    
    
    public String Name { get; set; }
     
    

    Public PageReference Search() {
    	
       //  List<List<Sobject>> results = [FIND :searchText IN ALL FIELDS RETURNING Contact(Id, Name,Phone,Email)]; 
    	 try { 
    	 contactResults = ContactsService.findContactInSalesforce(searchText);
    	
    	 }
    	 catch (Exception e){} 
    	 return null;
    	 
    	//PageReference pageRef = new PageReference('/_ui/search/ui/UnifiedSearchResults?searchType=2&str='+searchtext);
        //return pageRef ;
        
    }

}

 

<apex:page Controller="ContactSearch" sidebar="false" id="page">
<p>No peopleSoft Contact found.Please Search Salesforce below Using Name,Phone,email or Other identifying information.</p>
  <apex:includeScript value="/support/console/22.0/integration.js"/>
     <script type="text/javascript">
        function testOpenPrimaryTab() {
          
        
            //Open a new primary tab with the salesforce.com home page in it
            sforce.console.openPrimaryTab(null,'{!pageUrl}', true, 
                'newContact', openSuccess, 'newContact');
        }
        
        var openSuccess = function openSuccess(result){
            //Report whether opening the new tab was successful
            if (result.success == true) {
               // alert('Primary tab can be opened');
            } else {
                //alert('Primary tab cannot be opened');
            }
        };
        
     </script>
 <apex:form id="frm">
             <!--  <apex:image url="{!$Resource.Contactshome}" width="50" height="50"/>-->
            
     <apex:pageBlock mode="edit" id="block">
 
         <apex:pageBlockSection id="pbSectn">
            <apex:pageBlockSectionItem id="pbSitem" >
               <apex:outputLabel for="searchText">Search Salesforce Contacts</apex:outputLabel> 
               <apex:panelGroup >
                  <apex:inputText id="searchText" value="{!searchText}"/> <br/><br/>
                  <apex:commandButton value="Search" action="{!search}" />
                   <apex:commandButton value="Clear" action="{!Clear}" onclick="clearValue()"/>
                   <apex:commandButton value="Back" action="{!Back}"/>
                                      
                                         
               </apex:panelGroup>
         </apex:pageBlockSectionItem>
        </apex:pageBlockSection>  
         <apex:pageBlockSection Title="Results" id="results" columns="1"  > 
          <apex:outputPanel style="text-align:center" layout="block" >
         <apex:commandbutton value="New Contact" action="{!newcontact}" style="float: centre;"  rendered="true" onclick="testOpenPrimaryTab():return false;"/>
          <script>
            testOpenPrimaryTab();
            return false
           </script>
         </apex:outputPanel>
          <apex:pageBlockTable value="{!contactResults}" var="c">
                  <apex:column headerValue="Name" > 
                       <apex:outputLink value="/{!c.Id} " >{!c.name}</apex:outputLink>
                  </apex:column>
                  <apex:column value="{!c.emplid__c}"> </apex:column> 
                  <apex:column value="{!c.Phone}" ></apex:column> 
                  <apex:column value="{!c.Email}" ></apex:column> 
                       
       </apex:pageBlockTable>
   </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<script type = "text/javascript">
   function clearValue()
    {
    document.getElementById('{!$Component.page:frm:block:pbSectn:pbSitem:searchText}').value = '';   
   
    return false;
   
 }
   </script>

</apex:page>

 

Hi,

I have a requirement to display a table with list of records of an sObject. Have any one tried that before? Is there a possibility to do that in salesforce with Signnow template using salesforce annotations?

Thanks,
Kamatchi Devi Sargunanathan
Hi All, 

I am facing one issue as mentioned below, 
  • Custom Object is queried with fields in it along with some parent fields and also sub query. But when I am returning the result in the debug log I could see only fields related to the custom object only returned in the results.
  • Due to this, if I add the same list in to any wrapper or passing it to a map it was showing only those values displayed when I try printing it in a VF page.
Appreciate your help!

Thanks, 
Kamatchi Devi Sargunanathan
Hi All, 

I have a requirement to send email when an opportunity team member is added to the opportunity. It was working fine for the opportunity team members added newly and when am adding the default opportunity teams it is not working. 

If anyone has any idea please help to resolve.

Thanks,
Kamatchi Devi Sargunanathan
Hi All, 

I have the following error showing in the apex jobs that I was runnig in to the batch process. But the status shows as completed. I need to know what might be the issues was. I do not use any substring in this batch class and I have only the list collection and updating the lists.
 

2/28/2018 1:00 AM
Batch ApexCompletedFirst error: Ending position out of bounds: -11,5111,5110Persson, Philip2/28/2018 2:21 AMAccountUpdateWithStuCollecBatch_AC
 
Any help would be greatly appreciated!
 
Hi All, 

I would like to know if there is a possibility to deploy the process builder with active status in any way of deployment?. Currently I am facing the issue like is it was deployed through Ant migration tool with inactive status. So, I have to manually activate it after deployment.

Thanks in Advance!
Hi All, 

I was searching for an option to open a local folder from salesforce either in one of the following ways,
  • Button
  • Link
  • VF page with output link
But none of this is working and it ends in some script error that was blocking the URL from opening it in browser. Refer the screenshot below,
 Error I faced blocking my folder not to open

VF page code,
<apex:page >
    <html>
        <!--These are the folder path copied from my local system-->
        <a href="file:///C:/Users/MSTEMP194/Desktop/Project/Case/Files">Link 1</a>  
        <a href="file:///C://Users">Link 1</a>
    </html>     
</apex:page>
 
I tried searching for many solutions in blogs and found that file:/// should be used when refer the path from a local system. If I copy this folder path and paste over the browser, its opening. But, I have to open a folder path to my local system from salesforce. Can anyone help me out in solving the issue?. Its Urgent!

Thanks in Advance!
Hi All,

I have a requirement to avoid overlapping the two number field values with in an object records creation/updation. Following are my Scenarios for preventing overlapping between records,

User-added image

From the above table the two values indicate the minimum and maximum ranges. There we can add a new record with MinRange__c = 101 and MaxRange__c = 200, because didn't overlap any of the other record's min and max value. 

But we should not allow the values MinRange__c = 10 & MaxRange__c = 70 or MinRange__c = 201 & MaxRange__c = 250 and so on, because it will fall under already created records min and max value(Overlaps).

If you see the last row, this has the -1 value as maxrange__c because this is used to indicate the infinity. It this is found in a record, we shouldn't allow another record should be created with MinRange__c > 500

Please anybody help me with a solution for this logic.

Thanks in Advance,
Kamatchi Devi R

Hi All,

I have a requirement that, I need to assign a custom list view to the users whenever they login and check the Lead Object.

Is it possible? Anyone has any idea about this means please help.

Thanks in Advance.
Hi All,

I have a requirement  to share the contents that I have in my library should be automatically shared to the newly created Parner Community user.
Instead of manually sharing the contents with library permission, i need to give permission while the user has created.

If any one have worked on this please help.

Thanks in Advance.
Hi All,

Im in need of modifying the standard salesforce provided email template that is for Communities: New Member Welcome Email, to have some company logo and url for login.

But the problem is this email template is created as Text type template by default in salesforce. So, is there a way to modify the template to have the image in the top.

If anyone have some idea about this please guide me.

Thanks in advance.


Regards,
Kamatchi Devi R
Hi All,

I have a scenario like, I need to check the owner.division as a condition in my SOQL for a cusotm object query.  But for a custom object you cannot use the owner.division field in querying the value.

But, by using map, I can retreive all the user records and check the condition from there while looping the list of custom object records as follows, 

Map<id,User> ulist = new Map<id,User>([Select id,name,division from user]);

List<CustomObject__c> customList = [Select id,name, ownerid from CustomObject__c Where <my condition here>];

for(CustomObject__c c : customList)
{
       if(ulist.get(c.ownerid).division == 'xxxx')    //This is possible
       {
              //my logic goes here
        }
}

But, I want to check the condition of this division in the query itself. Becuase would like to filter out the records in the query. Is this possible?
Please help.

Thanks in advance!
 

Hi All,

 

I have a requirement to do the javascript in the Onkeyup event on RichTextArea in VF page. But the script am trying to load is working properly in the normal inputtextarea, if i gave richtext="true" then it is not working. Please help me to do this.

 

See the following code,

 

VF page

<apex:page >
<apex:includeScript value="{!$Resource.jquery}"/>

<script type="text/javascript">

function check(f){
alert("f");
}
function check1(f){
alert("f");
}
</script>

<apex:form id="frm1">
<apex:inputtext id="one" onkeyup="return check(this);"/>  //This is not working
<apex:inputtextarea richtext="true" id="e" onkeyup="return check1(this);"/> //This is working
<apex:commandbutton id="n" value="save" disabled="true"/>
</apex:form>

</apex:page>

 

Waiting for the solution.

 

Thanks  in Advance.

 

 

 

 

Hi all,

 

I have two text fields WorkStartTime__c and WorkEndTime__c. And need to create a formula field that returns a the difference between these two times as a decimal number to specify how many hours a person worked.

 

For Eg,

 

  • WorkStartTime__c can be like 9:00 AM (or) 09:00 AM (or) 09:30 AM and so on
  • WorkEndTime__c  can be like 5:00 PM (or) 05:00 PM (or) 05:30 PM and so on
  • Difference should be like 8.00 all the above scenarios.

Please help me how to write a formula to split a string and calculate the time difference

 

 

Thanks in Advance.

Hi,

 

Am in need of test class coverage for the date function. Am getting struggled at the point of tostartofweek() function. Now am getting 66% code coverage only.

 

Am copying my class here. Please find help me to cover this more than 75%.

 

Public class BusinessDay{
    public date getStartWeekData(date thisdate ){
            date startDate = thisdate.toStartofWeek();
            startDate = startDate+ 1;
            return startDate;
    }

    public string getMonthStart(date thisdate ){
       String month;
            Integer dt =  thisdate.day();
            Integer dtMonth = thisdate.month();            
            if(dtMonth == 1){
              month = 'Jan'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 2){
              month = 'Feb'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 3){
              month = 'Mar'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 4){
              month = 'Apr'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 5){
              month = 'May'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 6){
              month = 'Jun'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 7){
              month = 'Jul'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 8){
              month = 'Aug'+' '+ string.ValueOf(dt);
            }
            if(dtMonth == 9){
              month = 'Sep'+' '+ string.ValueOf(dt);
            }
       ........ and so on.
        return month;
    }
    }

 

 

Thanks in advance.

Hi All,

 

I'm in need of splitting the Date field value into Date, Month and Year through trigger.

 

My one part of requirment is to update a text field value as 'Oct 7', If you the date field value is given as '10/7/2013'. Please hepls me in finding a solution for this.

 

Thanks in Advance...!

Hi,

 

I have a VF page that has validation for the field in the form when i include the script in the Static Resource.

Please help me regarding this issue.

 

VF page that is not working is below,

<apex:page controller="Sample">

<!-- Javascript -->
       <apex:includeScript value="{!URLFOR($Resource.scriptValidation, 'jsFolder/jj.js')}"/> 

<!-- Javascript -->

<apex:form > 

     <apex:outputLabel value="Account Name"/>
     <apex:inputText value="{!nam}" id="nam"/>
     <apex:commandButton value="Insert" onclick=" return validate();"/>
</apex:form>

</apex:page> 

 

VF page that was working fine when have a script inside the page instead of static resource is given below.

<apex:page controller="Sample">

<!-- Javascript -->
<apex:includeScript value="{!URLFOR($Resource.scriptValidation, 'jsFolder/jj.js')}"/>
<script type="text/javascript">

function validate()
{
var a = document.getElementById('{!

$Component.nam}').value;
if(a == '' || a == NULL )
{
alert("Account name is mandatory");
return false;
}
}
</script>
<!-- Javascript -->

<apex:form >

 

     <apex:outputLabel value="Account Name"/>
     <apex:inputText value="{!nam}" id="nam"/>
     <apex:commandButton value="Insert" onclick=" return validate();"/>
</apex:form>

</apex:page>

 

Please help me regarding this issue.

 

Hi All,

 

I have a requirement to do the javascript in the Onkeyup event on RichTextArea in VF page. But the script am trying to load is working properly in the normal inputtextarea, if i gave richtext="true" then it is not working. Please help me to do this.

 

See the following code,

 

VF page

<apex:page >
<apex:includeScript value="{!$Resource.jquery}"/>

<script type="text/javascript">

function check(f){
alert("f");
}
function check1(f){
alert("f");
}
</script>

<apex:form id="frm1">
<apex:inputtext id="one" onkeyup="return check(this);"/>  //This is not working
<apex:inputtextarea richtext="true" id="e" onkeyup="return check1(this);"/> //This is working
<apex:commandbutton id="n" value="save" disabled="true"/>
</apex:form>

</apex:page>

 

Waiting for the solution.

 

Thanks  in Advance.

 

 

 

 

Hi All, 

I am facing one issue as mentioned below, 
  • Custom Object is queried with fields in it along with some parent fields and also sub query. But when I am returning the result in the debug log I could see only fields related to the custom object only returned in the results.
  • Due to this, if I add the same list in to any wrapper or passing it to a map it was showing only those values displayed when I try printing it in a VF page.
Appreciate your help!

Thanks, 
Kamatchi Devi Sargunanathan
Hi All, 

I have the following error showing in the apex jobs that I was runnig in to the batch process. But the status shows as completed. I need to know what might be the issues was. I do not use any substring in this batch class and I have only the list collection and updating the lists.
 

2/28/2018 1:00 AM
Batch ApexCompletedFirst error: Ending position out of bounds: -11,5111,5110Persson, Philip2/28/2018 2:21 AMAccountUpdateWithStuCollecBatch_AC
 
Any help would be greatly appreciated!
 
Hi All, 

I would like to know if there is a possibility to deploy the process builder with active status in any way of deployment?. Currently I am facing the issue like is it was deployed through Ant migration tool with inactive status. So, I have to manually activate it after deployment.

Thanks in Advance!
Hi Can some one explain me how to use two components with Lightning Data Service, i tried the following code for accDisplay and accEdit.
This worked as i expected but i got the following error!

I am missing some thing, can some one explain me how LDS works with multiple componets!
 
Challenge Not yet complete... here's what's wrong: 
The 'accDisplay' Lightning Component does not appear to be displaying the 'Name' using 'ui:outputText' and the value 'v.accountRecord.Name
 
<!--accDisplay component-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
 <aura:attribute name="accountRecord" type="Object" />
<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="VIEW"
    />
   



    <!-- Display a header with details about the record -->
    <div class="slds-form--stacked">
        <div class="slds-form-element">
            <label class="slds-form-element__label" for="recordName">Name: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordName"
                value="{!v.simpleNewAccount.Name}" />
            </div>
            <label class="slds-form-element__label" for="recordIndustry">Industry: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordIndustry"
                value="{!v.simpleNewAccount.Industry}" />
            </div>
             <label class="slds-form-element__label" for="recordDescription">Description: </label>
            <div class="slds-form-element__control">
              <ui:outputTextArea class="slds-input" aura:id="recordDescription"
                value="{!v.simpleNewAccount.Description}" />
            </div>
             <label class="slds-form-element__label" for="recordPhone">Phone: </label>
            <div class="slds-form-element__control">
              <ui:outputPhone class="slds-input" aura:id="recordPhone"
                value="{!v.simpleNewAccount.Phone}" />
            </div>
        </div>
    </div>

   

   
</aura:component>
<!--accEdit-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">

<aura:attribute name="accountRecord" type="Object"/>
<aura:attribute name="simpleNewAccount" type="Object"/>
<aura:attribute name="newContactError" type="String"/>

<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="EDIT"
    />
   
    <ui:outputText class="slds-output" 
                value="Edit Account" />
     <lightning:input aura:id="recordName" name="accountRecord" label="Name"
                  value="{!v.simpleNewAccount.Name}" />

     <lightning:button label="Save Account" onclick="{!c.handleSaveRecord}"
               variant="brand" class="slds-m-top--medium"/>
</aura:component>

 
Hi All, 

I was searching for an option to open a local folder from salesforce either in one of the following ways,
  • Button
  • Link
  • VF page with output link
But none of this is working and it ends in some script error that was blocking the URL from opening it in browser. Refer the screenshot below,
 Error I faced blocking my folder not to open

VF page code,
<apex:page >
    <html>
        <!--These are the folder path copied from my local system-->
        <a href="file:///C:/Users/MSTEMP194/Desktop/Project/Case/Files">Link 1</a>  
        <a href="file:///C://Users">Link 1</a>
    </html>     
</apex:page>
 
I tried searching for many solutions in blogs and found that file:/// should be used when refer the path from a local system. If I copy this folder path and paste over the browser, its opening. But, I have to open a folder path to my local system from salesforce. Can anyone help me out in solving the issue?. Its Urgent!

Thanks in Advance!
I want to upload the multiple files in the vf page & inserted in the document object. Please help me out buddies.
  • September 24, 2015
  • Like
  • 0
Hi All,

I have a requirement to avoid overlapping the two number field values with in an object records creation/updation. Following are my Scenarios for preventing overlapping between records,

User-added image

From the above table the two values indicate the minimum and maximum ranges. There we can add a new record with MinRange__c = 101 and MaxRange__c = 200, because didn't overlap any of the other record's min and max value. 

But we should not allow the values MinRange__c = 10 & MaxRange__c = 70 or MinRange__c = 201 & MaxRange__c = 250 and so on, because it will fall under already created records min and max value(Overlaps).

If you see the last row, this has the -1 value as maxrange__c because this is used to indicate the infinity. It this is found in a record, we shouldn't allow another record should be created with MinRange__c > 500

Please anybody help me with a solution for this logic.

Thanks in Advance,
Kamatchi Devi R

Hi,

Iam creating a vf page in that vf page i have a checkbox field when i check the checkbox automatically another vf page should be display as popup in my vf page.
Please help me guys,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Hi All,

I have a requirement that, I need to assign a custom list view to the users whenever they login and check the Lead Object.

Is it possible? Anyone has any idea about this means please help.

Thanks in Advance.
Hi All,

I have a requirement  to share the contents that I have in my library should be automatically shared to the newly created Parner Community user.
Instead of manually sharing the contents with library permission, i need to give permission while the user has created.

If any one have worked on this please help.

Thanks in Advance.
Hi All,

Im in need of modifying the standard salesforce provided email template that is for Communities: New Member Welcome Email, to have some company logo and url for login.

But the problem is this email template is created as Text type template by default in salesforce. So, is there a way to modify the template to have the image in the top.

If anyone have some idea about this please guide me.

Thanks in advance.


Regards,
Kamatchi Devi R

Hi All,

 

I have a requirement to do the javascript in the Onkeyup event on RichTextArea in VF page. But the script am trying to load is working properly in the normal inputtextarea, if i gave richtext="true" then it is not working. Please help me to do this.

 

See the following code,

 

VF page

<apex:page >
<apex:includeScript value="{!$Resource.jquery}"/>

<script type="text/javascript">

function check(f){
alert("f");
}
function check1(f){
alert("f");
}
</script>

<apex:form id="frm1">
<apex:inputtext id="one" onkeyup="return check(this);"/>  //This is not working
<apex:inputtextarea richtext="true" id="e" onkeyup="return check1(this);"/> //This is working
<apex:commandbutton id="n" value="save" disabled="true"/>
</apex:form>

</apex:page>

 

Waiting for the solution.

 

Thanks  in Advance.