• Pankaj_Ganwani
  • PRO
  • 3283 Points
  • Member since 2015
  • Senior Salesforce Developer
  • Indeed Inc.


  • Chatter
    Feed
  • 97
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 13
    Questions
  • 797
    Replies
I created a simple app to update a field on a custom obj from a google Apps script. It currently works fine with full access but I would like to tighten it up.

What is the minimum Oauth scope I can use to acomplish this using the availble scopes at  Manage Connected Apps --> API(enable Oauth Settings) --> Selected Oauth scopes ?
Hai all

I have an requirememnt to create field update action using workflow rule

For example i have two custom objects like Credit card and payment .both are having Master-Detail relationship means  here credit card object is parent and payment object is child

When i enter Amount in payment object ammount field it automatically update the limit filed in credit card object i have write the formula like this but it's throw errorCheck this Clip
Hello,

A user is given read access to a custom object. 
When the user clicks on the value of the owner, he is able to see the user record.
How is it possible to hide the "User" details from a particular "Profile".

Thank you for suggestion !
  • June 08, 2016
  • Like
  • 0
Hi All,
I have created a VF page for add employee with 12 fields and added to community. These fields are visible when i login as salesforce user. But when i login as community user 4 input fields do not show up only the label is visible. This 4 fields which are not visible are lookup fields where the controlling field being account. Is there any settings i need to enable?

Thanks!!
Hi ,

I have a custom profile which is cloned from system admin ,and i have a filed on the object  called "FLS field ", given as  "Readonly" for custom profile.But still the user who is assigned to custom profile can edit the field.Can anybody tell the reason why it is happening like that?



Regards,
Isha
Hi,

Could anyone please indicate if it is possible to retrieve field IDs in bulk or through API?

I only know one method that we can find them on the html pages, which are normally settled for standard fields or 15-character identifier for custom fields. Is there a way to capture them in whole or programmatically? 

Any idea on this would be great for us. Thank you very much!

Best regards,
Stellar
 
Hello,

Using Apex code, I want to add a task "send email" to a activity history for a custom object.
The fields i have in the email are 
To
Subject
Body
Attachment
Parent Id
With the above value how can i add them to the activity history ?
 
  • June 01, 2016
  • Like
  • 0
Hi guys,

I was told that I need to create a RecursionHandler so that a trigger will autopopulate a checkbox when it creates a new record. It was suggested to me to use the below code. Do I just add this ontop of the trigger or where do I add it? 


public class RecursionHandler
{
    public static Boolean isrun = true;
}
 
Hello,

I'm an noob and I'm trying to write a formula that compares a picklist value and a formula result and will enter a number (I need to do math in future formulas so can't use text). This is what I have:

IF(AND(ISPICKVAL( Size__c , "S"), Tier__c= "Tier 1"), 675,
IF(AND(ISPICKVAL( Size__c , "S"), Tier__c= "Tier 2"), 695,
IF(AND(ISPICKVAL( Size__c , "S"), Tier__c= "Tier 3"), 725,
Tier__c)))

Getting the following error:

Incorrect parameter type for function 'IF()'. Expected Number, received Text (Related field: Formula)

If I change the field type to Text and add quotes around the numbers it works but I really need it to be a number.

Any help would be greatly appreciated!!!!



Any help would be appreciated.
 

Hi,

I'm trying to create a validation rule that looks at a picklist field and return an error if the value has been changed after the record is approved.

The field contains 4 selections: 14, 30, 45 and 60.

What I'm trying to achieve is a validation rule that if a user (originally created the record with 14 as the selection) was to change it to 30, then they would get an error message "you can not change after approval".

When I try using the priorvalue, it says that this function can not be used in this type of formula.
I tried changing it to use TEXT values i.e.
(TEXT(Payment_Date__c) != TEXT(PRIORVALUE(Payment_Date__c)))

However this doesn't return the error message even I'm able to save the validation rule.

Does anyone know how to achieve using priorvalue for picklists? What is the best method for this?

Hi,

I have created a custom link on a home. it's a java on click. Unfortunately when a user with a non admin profile click on the link the batch is not launched whereas he has all the permission sets on his profile. I checked the debug log with the user and i have the following message  "18:14:00.6 (9927772)|FATAL_ERROR|System.SecurityException: Required permissions are not enabled.".  I don't see what is the problem since the user has all the apex and visual force permissions. and he has access to the objects concerned into the batch.
This user has a salesforce platform license. But i don't think it can be a matter.
Anyone has already face this type of issues?
I have a custom Target Customer object with two fields:
Representative - lookup to User object
Customer - lookup to Contacts object
In Contact is a custom field formula isTarget which should be an indicator that the contact and the user entry exists in the object Target Customer.
How to implement a formula in isTarget?
I am looking to re-size the width of my text area in my generated web-to-lead form. It currently shows 3 rows, which is fine, but the width is to small to type anything longer than a sentence in. This is my code. 
 
<h1><b>Contact</b> Us</h1>
<p><br /></p>
<style type="text/css">
label {
	line-height: 18px;
	font-weight: bold;
}
</style>

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="00D1a000000KWEu">
<input type=hidden name="retURL" value="BLOCKED">
<input type="hidden" name="lead_source" id="lead_source" value="Contact Us">

<div class="ccms_form_element cfdiv_text">
<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="title">Title</label><input  id="title" maxlength="40" name="title" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="phone">Phone</label><input  id="phone" maxlength="40" name="phone" size="20" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="city">City</label><input  id="city" maxlength="40" name="city" size="20" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<label for="state">State/Province</label><input  id="state" maxlength="20" name="state" size="50" type="text" /><br>
</div>

<div class="ccms_form_element cfdiv_text">
<p><br /></p>
<p>Comments:&nbsp<textarea  id="00N1a000008XVLh" name="00N1a000008XVLh"  rows="3" type="text" wrap="soft"></textarea><br></p>
</div>

<div class="ccms_form_element cfdiv_text">
<input type="submit" name="submit">
</div>

</form>
I am referring to the Comments text area. Does anyone know how to solve this? I have tried size="50" with no luck. 

Thanks
Hi All, 
We have a multi select html field where users can do CTRL + select multiple values, this should be stored in a multi select field. 

<div class="form-group">
                            <label class="control-label label-form" for="Attrib">Attrib<span class="mandatory"> *</span></label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <span class="glyphicon glyphicon-pencil" aria-hidden="true"/>
                                </div>
                                <select multiple="multiple" class="form-control">
                                    <option>Colour</option>
                                    <option>Shape</option>
                                    <option>Size</option>
                                    <option>Weight</option>
                                </select>
                            </div>
                        </div>

How can I store the above selected values in a multi select field? 

Thanks, 
Prasanna
 

I am stuck on this. I am getting the "You have uncommitted work pending. Please commit or rollback before calling out" CalloutException, even though I am doing the operations in the right order as I understand it.

The batch job has to select accounts that need updating, call a webservice to query some data, and update the accounts with this new information.

Below is a simplified version of my code. Basically:

- In the start() method I run a query on Account and return a QueryLocator
- In the execute() method I loop through the List<Account>,  do as many callouts as needed and set the relevant fields in the Account objects; at the end of the loop I do one update operation.

This should preserve the rule "no not do callouts after DML operations". But the second callout after I first set the fields is failing. It seems though setting field values on the object counts as DML, even though I am not performing the update operation yet.

Does that make sense? How can it be fixed? Or is it a whole different thing that I am doing wrong?

Thanks in advance.

 

global class AccountsUpdateWebService implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful {
    global Database.QueryLocator start(Database.BatchableContext bc){
        String query = 'Select Id, Name FROM Account ...';
        return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext bc, list<Account> accounts) {
        List<Account> toupdate = new List<Account>();
        for (Account account: accounts) {
            // Callout to web service that retrieves address info
            WSData wsdata = WebService.getData (account.Name);
            account.BillingStreet = wsdata.Street;
            account.BillingPostalCode = wsdata.PostalCode;

            toupdate.add (accounts);
        }
        update toupdate;
    }

    global void finish(Database.BatchableContext bc) {
    }
}
Hi All

Full disclosure: Novice at JS.

Im trying to make a button which will check the Region of the Owner and based on that change the Status of the Lead and Change the owner. 
Ive done simmilar things before an im trying to paste it all together but im stuck at the first step! Trying to check the region of the owner.

Is there a way that i can do this? I thoguht just Lead.OwnerId.Region__c would work but clearly not. 

As for the rest of the button im sure there are tons of errors but this is where i need to started i think. 
 
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}

//Define the object
var leadObj = new sforce.SObject("Lead");

//Define the IDs of things
leadObj.Id = '{!Lead.Id}';

// IF APAC
if(('{!Lead.OwnerId.Region__c}' == 'APAC')
	,leadObj.Status = 'Marketing Qualified';  
	leadObj.Owner = '00520000003YH58'; 
	,
	// IF EMEA
	if(('{!Lead.OwnerId.Region__c}' == 'EMEA')
		,leadObj.Status = 'Marketing Qualified';  
		leadObj.Owner = '00520000003YH58'; 
		,
		// IF Americas
		if(('{!Lead.OwnerId.Region__c}' == 'Americas')
			,leadObj.Status = 'Marketing Qualified';  
			leadObj.Owner = '00520000003YH58'; 
			,enter your else-expression here (only for the last one) - 3)))
as 

//update method takes an array of Leads; init to 1 element - 'leadObj'
var result = sforce.connection.update([handObj]);

if (result[0].success == 'false') {
alert(result[0].errors.message);
}

else {
location.reload(true); /* redisplay the detail page */
}

 
Hi guys,

I need you guys help here, I have string which contains [A], I need to call class only if that main string has that [A] format it should not call class if it finds just A in that main string. How can we achieve this in Apex code?

Thanks.
Hi
I have a requirement.When we update  Account record, the related Description field of contact object should get updated automatically.
 
I am able to achieve the requirement but I want to know whether we can use Map to optimize the code further.
Pls help me.
 
public class Account_ContactDescription
{
     public static void Update_Description(Set<Id> accountIds)
    {
                    
           list<Account> accountsWithContacts =[select Id,Name, (select Id,FirstName,LastName from Contacts) from Account  where Id IN : accountIds];
           
           list<Contact> contactsToUpdate=new list<Contact>();
           
           for(Account a:accountsWithContacts)   //loop through all queries 
          {
                 for(Contact convals:a.Contacts)
                {
                        convals.Description=convals.FirstName+' '+convals.LastName;
                         
                        contactsToUpdate.add(convals);
               }
           }
           
           update contactsToUpdate;
    }
}

trigger trg_Description on Account (before Update)
{
   
    Account_ContactDescription c=new Account_ContactDescription();
     
    Map<Id,Account> amap = new Map<Id,Account>([select Id from Account]);
     
    Set<Id> accountIds = amap.KeySet();
     
    c.Update_Description(accountIds);
          
}

Thanks
sonali

 
Hello,

Please, I've had trouble in PricebookEntry when I execute test below: 

@isTest 
(seeAllData = true)

private class TestOpportunityLineItem
{
static testMethod void TestProOportunidade()
{

Date closeDt = Date.Today();

date myDate = date.today();

Account a2 = new Account(Name ='Teste');
insert a2;

opportunity oppr = new opportunity(Name='Encomenda teste' ,  AccountId= a2.Id,StageName = 'Fechado', 
                                   CloseDate = closeDt);
insert oppr;

Id pricebookId = Test.getStandardPricebookId();

Product2 prod = new Product2(
     Name = 'Vidro',
     ProductCode = '1108',
     isActive = true
);
insert prod;

PricebookEntry pbEntry = new PricebookEntry(
     Pricebook2Id = pricebookId,
     Product2Id = prod.Id,
     UnitPrice = 200.00,
     //StandardPrice= 100.00,
     //UseStandardPrice = false,
     IsActive = true
);
insert pbEntry;

OpportunityLineItem oli = new OpportunityLineItem(
     OpportunityId = oppr.Id,
     Quantity = 5,
     PricebookEntryId = pbEntry.Id,
     TotalPrice = 1
);
insert oli;
 

}
}
HI,

I'm attempting to create my first Visual Force page displaying results from an Apex class.
Could someone help me please with the code on how to retrieve all the opportunities from child accounts where the parent account is the one being viewed.

Apex Code:
public with sharing class ChildOpportunities {
    Public id Parent_Acc_Id;
          public ChildOpportunities(ApexPages.StandardController controller) {
    Parent_Acc_Id = ApexPages.currentPage().getparameters().get('id');
    }
         public List<Opportunity> getRelatedOpportunities(){
        List <opportunity> childOpps = New List<Opportunity>();
        for(Opportunity opp:[select Name, Total_Opportunity_Amount__c  
                             from opportunity where account.parent.id=: Parent_Acc_Id]){
                        childOpps.add(opp);    
        }
        return childOpps;
    }
}

VF Page code

<apex:page sidebar="false" showHeader="false" standardController="Account" extensions="ChildOpportunities">
    <apex:pageBlock title="Child Opportunities">
        <apex:pageBlockSection title =" {! Opportunity.Account.Name}" columns="5">
            Opp Name: <apex:outputField  value="{! Opportunity.Name}"/>  
            Opp Value: <apex:outputField  value="{! Opportunity.Total_Opportunity_Amount__c}"/> 
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

I'll apologise in advance, as I say this is my first attempt so I'm sure there are a hundred things wrong.....
I currently have the two following errors, but I'm not sure the principal is even correctUser-added image

Thanks
Hi All,
Can anyone guide me through the process of testing Mulesoft Composer in Developer org? I went through couple of articles and could not find relevant information about this. 
Thanks!
Hello Everyone,

Please let me know if someone ever tried to integrate Salesforce directly with MySQL database. I know we can do this by using some kind of middleware or using JAVA API. But, just wanted to understand if it is possible to have Point to Point integration between both the systems?
Hi Experts,

Can you please provide us the correct answer of the below mentioned question?

1. The marketing team at universal containers wants to send an email to each lead received from its website. The country of the incoming lead should determine the language of the email that will be sent to the lead. How can the system administrator automate this process?
a.     Create an email template for each language and an assignment rule to send appropriate template
b.     Create an email template for each language and an auto response rule to send appropriate template
c.      Create an email template for each language and a workflow alert to send appropriate template
d.    Create a single email template and use the translation workbench to translate and send the appropriate template

Thanks,
Pankaj
 
Hello experts,

How to add omni-channel utility in lightning experience? As per below mentioned link, we can add this utility in lightning experience using app manager, but we are able to find this in the list of available components in sidebar.
https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_omnichannel_lex.htm?edition=&impact=

Any help would be appreciated.

Thanks,
Pankaj
Hello Techies,

I created a quick action named as 'Create Opp' on Account to create an Opportunity and launched this in lightning experience from Account detail page. I am able to create the Opportunity record successfully. My requirement is to redirect to the created Opportunity page which is not happening now. Is there any workaround to achieve this?

Any help will be appreciated.

Thanks,
Pankaj
Hi All,

When we are creating csv file using apex code, I am getting html number corresponding to the special symbol(',','''). I have mentioned my code below:
PANG__Child_Object__c obj = [SELECT Id, PANG__test_rich__c from PANG__Child_Object__c where Id =: 'a0K28000006bqaA'];
        string recordString = '"'+obj.id+'","'+obj.PANG__test_rich__c.replaceAll('\\<[^\\>]*\\>','  ')+'"';
        //recordString = recordString.escapeEcmaScript();
        Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
        blob csvBlob = Blob.valueOf(recordString);
        string csvname= 'Account.csv';
        csvAttc.setFileName(csvname);
        csvAttc.setBody(csvBlob);
        csvAttc.setContentType('text/csv');
        
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(new List<String>{'email'});
        mail.setSubject('test');
        mail.setcharset('UTF-8');
        mail.setHtmlBody('find attachment');
        mail.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});

        Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{mail});

I am getting '&#39;'(html number of single quote) instead of single quote in received file. Please let me know how to fix this.

Thanks,
Pankaj
Hi Experts,

We have a apex job in which we are fetching some records(SOQL) in execute method based on the record values retured by start method. But, there are more than 50000 records corresponding to one particular value in an object. My requirement is to send an email alert from batch apex if records returned by SOQL are more than 50K. We know that limit exceptions cannot be handled through try/catch blocks in apex.

Is there any workaround to accomplish this? Please find below mentioned code:
 
global class BatchUpdateOptOutPermissions implements Database.Batchable<sObject>
{
   
   /* Start - Variables */
   /* End - Variables */
   
   /* Start - Constructor */
   global BatchUpdateOptOutPermissions()
   {
        //Do Nothing
   }
   /* End - Constructor */

   global Database.QueryLocator start(Database.BatchableContext BC)
   {
      DateTime dtLast24Hours = System.now().addHours(-24);
      return Database.getQueryLocator('SELECT Id, Channel_Value__c FROM Brand_Permission__c WHERE Permission_Value__c = \'OUT\' AND LastModifiedDate >: dtLast24Hours');
   }

   global void execute(Database.BatchableContext BC, List<sObject> scope)
   {
        List<Brand_Permission__c> lstBP = (List<Brand_Permission__c>)scope;// Casting the scope to list of Brand_Permission__c.
        List<Brand_Permission__c> lstBPToUpdate = new List<Brand_Permission__c>();// List to hold the existing channel permission records which needs to updated.
        Set<String> setPermissionValues = new Set<String>();// Set to hold the channel permission values corresponding to those permissions that are passed from the batch.
        
        //Iterating to hold the channel values
        for(Brand_Permission__c objBP : lstBP)
        {
            if(String.isNotEmpty(objBP.Channel_Value__c))
                setPermissionValues.add(objBP.Channel_Value__c);
        }
        
        if(!setPermissionValues.isEmpty())
        {
            //Fetching the existing permissions which are not opted out in last 24 hours.
            for(Brand_Permission__c objBP : [SELECT ID FROM Brand_Permission__c WHERE Permission_Value__c != 'OUT' AND Channel_Value__c IN : setPermissionValues])
            {
                lstBPToUpdate.add(new Brand_Permission__c(Id = objBP.Id, Source_Time_Stamp__c = System.now(), Effective_Date__c = System.now(), Permission_Value__c = 'OUT', Source_Application__c = 'SharedOptOutSource'));
            }
        }
        
       Database.update(lstBPToUpdate,false);
   }

   global void finish(Database.BatchableContext BC)
   {
        //Do Nothing
   }
}

Thanks,
Pankaj
Hi All,

Is there any appexchange tool or package available which can track user's activities such as how many times a user visited a particular vf page, how many times user visited a particular record, how many times user changed a particular field and so on?

Any help would be appreciated.

Thanks,
Pankaj
Hi Experts,

How can we achieve the cloning functionality of record by leveraging the Flows instead of apex code on click of Detail page button?

Thanks,
Pankaj
Hello experts,

Can anyone have idea How to open local(windows explorer) text file on click of detail page button?

Any help would be appreciated.

Thanks,
Pankaj
Hello Experts,

Can someone have any idea or insight how to change labels of home page components and custom tabs using translation workbench? Any help would be appreciated.

Thanks,
Pankaj
Hi Experts,

I have a problem with email service in apex. When I reply to the salesforce generated email address, then in my email service handler the body contains all the previous replies and main email body(when the email was sent first time) along with the current reply.

Like:

    Test Notessssss......
    
    On Mon, May 4, 2015 at 11:58 AM, Pankaj <pankaj@gmail.com> wrote:
    Testjfdsfjdklsflkdsjflksdfjklsdfjlkdsfjsdklfj
    fjdslkfjsdklfjsdlkfjlsdkfjsdklfjdklsj

My reply body is Test Notesssssss..... only. But in email service handler I am getting the previous one as well.

Can someone suggest me how we can avoid the previous thread bodies?

Thanks in advance!
When I click on the command link present on inline vf page, my action function is called which in turn calls the controller method. In onComplete attribute, I am reloading the parent using window.parent.location.href = '/'+{!opportunityId}+'#divName'.

Here divName denotes the section in inline vf page where I want to bring focus(autoscrolling) after page reload, but it does not working.

Any suggestions? Thanks in advance
Hi All,
Can anyone guide me through the process of testing Mulesoft Composer in Developer org? I went through couple of articles and could not find relevant information about this. 
Thanks!
I created a simple app to update a field on a custom obj from a google Apps script. It currently works fine with full access but I would like to tighten it up.

What is the minimum Oauth scope I can use to acomplish this using the availble scopes at  Manage Connected Apps --> API(enable Oauth Settings) --> Selected Oauth scopes ?
Hi,
I got strucked in this example.I want to show the SOQL query result in table format in visualforce.
Apex Code:
public class AccountClass1
{
public list<Account> acc{get;set;}
public List<Contact> ccc{get;set;}
public  List<Account> AccountClass2()
{
 List<Account> acc = [select Name,Phone,Type from Account where Name='capital first'];
 return acc;
}
public  List<Contact>  AccountClass3()
{
  List<Contact> ccc = [SELECT AccountId,Name FROM Contact where AccountId IN(select Id  from Account where Name='capital first')];
  return ccc;
}
}
VIsualForce Code:
<apex:page controller="AccountClass1" sidebar="True" showHeader="true">
  <apex:form >
  <apex:commandButton action="{!AccountClass2}" value="Accountquery" id="ss"/>
  <apex:pageBlock>
  <apex:pageblockTable value="{!acc}" var="a" id="ss">
  <apex:column value="{!a.Name}"/>
  <apex:column value="{!a.Phone}"/>
  <apex:column value="{!a.Type}"/>
  </apex:pageblockTable>
  </apex:pageBlock>
  <apex:commandButton action="{!AccountClass3}" value="Contactquery" id="ds" />
  <apex:pageBlock>
  <apex:pageblockTable value="{!ccc}" var="c" id="ds">
  <apex:column value="{!c.AccountId}"/>
  <apex:column value="{!c.Name}"/>
  </apex:pageblockTable>
  </apex:pageBlock>
  <script>
  </script>
  </apex:form>
</apex:page>

output 
User-added image

After clicking on AccountQuery or ContactQuery I am getting the following output
User-added image

 
I have created an object to enter data and I have created a Data Capturer User and limited to profile to only capture on that object but it has hidden 3 crucial fields but i have made them visible and editable to the data capturer User and profile. No matter what settings I look into nothing changes this to show those fields. Am i possibly missing a setting i may not be aware of yet as i am still a beginner. 
I need to display Calls and Opportunities based on the selection of Contact.
Do I need to write wrapper class?
Please help me.
Hi All

I have one requirment to add two number.I have created three text field ,two is for number and one is for mathematical operator.when i am entering number and and enter add symbole,the it will be display result.how it is possible

User-added image
I have a piece of code that show above error on

d.FolderId = UserInfo.getUserId();
         d.Name = 'Data2'; 
         String myContent = this.name+ '\n ' +this.pass+ '\n ' + this.age+ '\n ' +this.mail; 
         d.body += Blob.valueof(mycontent);
         d.ContentType = 'text/plain';
         d.Type = 'txt';
         upsert d;
         return null;
}

d.body += Blob.valueof(mycontent);(Show error in this line)
HI,
I have requirments need to create new custom VF page with only controller no standaradController.

problem is i have to display data picker for start date and end date fields.

so i have used <apex:input type="date"   it is not working in IE, Mozilla browers
if use <apex:inputText value="{!caseStartDate}" size="10" id="caseStartDate" label="Start Date" onchange="caseDateValidates()" onclick="DatePicker.pickDate(false, this , false);" />    
 here onchange not working...


any other way to get date picker on VF page and pass the date values to controller based on onchange event ....

Thanks

 
  • July 14, 2016
  • Like
  • 0
<apex:input type="date" value="{!x_date}"/>  not working for IE, Mozilla browsers, any other way to get data picker on VF page ?
  • July 14, 2016
  • Like
  • 0
New to triggers, and i've finally got my trigger working as needed in the sandbox. 
here it is .. 
 
trigger ClosedOpportunityTrigger on Opportunity (before insert, before update) {
    for(Opportunity opp : Trigger.New) {
        Id closedBy; 
        
        Date closedOn = opp.CreatedDate.date(); 
        
        if (opp.IsClosed) {
          
            closedBy = opp.LastModifiedById;
            closedOn = opp.LastModifiedDate.date();
            
  
            if (Trigger.isUpdate) {
                Opportunity old = Trigger.OldMap.get(opp.Id);
                if (old.IsClosed == opp.IsClosed) {
                    closedBy = old.Closed_By__c;
                    closedOn = old.CloseDate;
                }
            }   
        } 
        opp.Closed_By__c = closedBy;
        opp.CloseDate = closedOn;
    }
}
My test class isn't working, i'm getting "Your ClassID property is missing or null" error from Force IDE
here is my class
@isTest

public class OppCloseDateTest {

    static testMethod void TestChangeOpportunityClosedby() {
       
      Opportunity opp = new Opportunity();
       
      opp.Name= 'Opportunity';
      opp.StageName='Closed Grant';
      opp.CloseDate=System.today();
                                       
        Update opp;
        
        
        

    
    }
    
}

Please let me know if there is something i'm missing, i'm still learning 

 
Hi All,

I am getting the error in test class as System.StringException: Unrecognized base64 character: *. I am not getting how to resolve the issue. Could anyone help on this issue.
 
@isTest
private class TestUpdateCourseCompletionStatusService 
{
    public static testmethod void testupdate() {
     LMS__c lmsc = new LMS__c ();
    lmsc.Prod_CryptoKey__c = 'prod crypto';
    lmsc.Test_CryptoKey__c = 'test crypto';
    lmsc.Prod_IV__c = 'prod iv';
    lmsc.Test_IV__c = 'test iv';
    insert lmsc;
    
    Registration__c coursereg = new Registration__c();
    coursereg.Name__c = 'testcourse';
    coursereg.ID_Number__c = '1234';
    coursereg.LMS_Status__c ='Completed';
    insert coursereg;
    
     System.RestContext.request = new RestRequest();
     RestContext.request.requestURI = '/UpdateCourseCompletionStatus/*';
     RestContext.request.addHeader('decodedB64 ', '12345');
     
    UpdateCourseCompletionStatusService.updateCourseRegistration();
  
}
}

Thanks in Advance.


 
My scnario was when iam inserting account record automatically associated contact also should  insert:
But iam getting error like ;Variable does not exist: name' but i have field Name on account
trigger account_trigger on Account (after insert,after update)
{
  if(Trigger.isInsert)
  {

    List<Contact> ct = new List <Contact>();

    for(Account acc : trigger.new)
    {

        Contact c = new Contact(LastName=acc.name,AccountId=acc.id,MailingStreet=acc.BillingStree,
                    Phone=acc.Phone);

        ct.add(c);
    }
    insert ct;
  }
}
This is the VF code Snippet we are using in our org. The user user rich text area to enter te data and this component is used in a standard page. but we are querying this value in anothe Custom VF page. The problem is the output text value renders the output along with HTML tags. If i remove the HTMLENCODE it works fine. FYI  HTMLENCODE  is required for submitting the app for app exchange. So we cannnot remove that.

<td><apex:outputText value="{!HTMLENCODE(r.questions)}" escape="false"/></td>

Any alternative solutions is appreciated.
I am going through salesforce fundamentals & about to start profile creation .
So tried this ==> Logged in to "login.salesforoce" >> Setup >> Manage  USer >> Profile

Profile is not visble, how to go ahead with it ? :(
  • April 19, 2015
  • Like
  • 1
I am new to Salesforce and recently joined SalesForce.com community. I have just started learning it. I don't see Profile under user management and Field Accessibility link in Admin Setup. Can anyone help me in this......
Under my profile, Delelopment Checkbox is already selected.