• Shashikant Sharma
  • ALL STAR
  • 11033 Points
  • Member since 2011
  • ForceSchool ( forceschool.blogspot.in )


  • Chatter
    Feed
  • 405
    Best Answers
  • 0
    Likes Received
  • 7
    Likes Given
  • 1
    Questions
  • 2506
    Replies
I'm trying to read Unit of Measure on Product2. But getting compile time error as below.
 
No such column 'QuantityUnitOfMeasure' on entity 'Product2'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

But in Product entity field seems there.

Product standard fields

Not sure if I am using a wrong field name. In docs I couldn't find this field though. Can someone help me with reading unit of measure in product using SOQL?

Appreciate any help. Thanks.

 
I want to  get the id for a record in an object called patient__C and render the patient detail page in a VF page without having to specify each detail field.  I have created the standard controller Patient to get the record id and get the error This gives error: Illegal Assignment List to List:

public with sharing class Patient {
    
        public String patientId{get;set;}
         

         public Patient(){
             String pat = apexpages.currentPage().getParameters().get('Id');
            List<patient> patID  = [Select id from Patient__c where id = :pat Limit 10];
 }
}

Here is the visualforce page code:
<apex:page standardController="Patient">
    
    <apex:detail />
    
</apex:page>

Can anyone tell me what I am doing wrong?
 
Hi everyone, is it possible through Apex or visualforce for the following scenario?

User attaches an excel doc to a case record.  The values in the excel doc will populate specific case fields.  (The column headers will match the case fields).  Salesforce Classic, not lightning.

Thanks for any advice on best way to handle!
I have my UI on salesforce. I want a piece of code to execute on some server. How this can be  achieved?
Hello, good morning everyone.

Could you help? I created a field related to the account object and I want to fill in autometico when creating a record by Dataloader, the CSV file only contains the customer number, but not the account name (Account)

I have tried to populate that field by Process Builder, but I do not start as, the other option is to do a trigger, which as soon as the CSV is loaded, it will be triggered and compare "Customer Number" of my custom object against "Client Number" (Accounts) and if it is the same, fill in the field Master-detail, in my custom object. Do you have any idea how to do this trigger?

Look out for comments.User-added image
I have created a validation rule on a field on a custom object that is part of a managed package. The validation rule simply prohibits the text length in the field from exceeding 30 characters. The actual text field the rule is on is a 255 character text field, but for our uses we need to limit the length to 30 characters. Since that field is part of a managed packaged I cannot change the field length. It works perfectly for standard inputs.

The issue arises when a record in the object is created from another custom object in the managed package. We are using Process Builder to populate the field that the validation rule is on with the text from a custom field in the originating object. It worked flawlessly until I created the validation rule. The text field in the originating  object is only 30 characters long so it cannot exceed the rule limits. With the validation rule activated every time the originating object inserts a record the validation rule causes an error and prevents the insertion. And the Validation Rule fires before the Process Builder does so it cannot be the text length in the originating field causing the error.

Any ideas??
I am trying to add fields in the Edit Opporunity page, however it seems like I can't override.  How do I add Address, phone number and email onto the edit page? 

User-added image
 

Hi, I have the following schedulable class below and i wanted to be able to schedule it to run at 12am through the UI by navigating to schedule apex and then setting it to run every day at 12am. However, after this job has ran, i want it to schedule a subsequent job (same class) to run in the next hour. Is this possible?

The goal is to only schedule it through the UI to run at 12 Am and then it will automatically schedule the remaining jobs 1 hour later.
 

global class SampleClass implements Schedulable{
    global void execute(SchedulableContext alistContext) {
        Database.executeBatch('myBatchClass', 100);

       //when database executebatch is done, I want to schedule the same job 1 hour later
       String cron_exp = '0 0 1 * * ?';
       String jobName = 'somename';
       System.Schedule(jobName, cron_exp, new SampleClass())
    }
}
Hi i used below code but its not working fine
1. Only one account record is displaying in first page
2.Popup window is not closing after record update or cancel.

Below is my code:
Page1:
<apex:page standardController="Account" recordSetVar="accs">
<script>
  function OpenVfpage(pid){
      var newwindow = window.open('/apex/Accsmallpopup?id='+pid, 'name=_blank','height=500,width=500,left=250,top=100'); 
  newwindow.focus();
 }
</script>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!accs}" var="a" >
                <apex:column value="{!a.Id}"/>
                <apex:column value="{!a.name}"/>
                <apex:column value="{!a.Phone}"/>
                <apex:column value="{!a.Industry}"/>
                <apex:column id="two">
                    <apex:commandButton value="Click" onclick="OpenVfpage('{!a.id}')" reRender="two"/>
               </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Page2:
<apex:page controller="Accpopup2" showHeader="false" sidebar="false" id="the">
   <apex:form id="page">
    <apex:pageblock id="close">
    <apex:pageBlockSection >
        <apex:inputfield value="{!a.Name}"/>
         <apex:inputfield value="{!a.Phone}"/>
     </apex:pageBlockSection>
        <apex:pageblockbuttons >
        <apex:commandButton value="save" action="{!save}"/>
        <apex:commandButton value="cancel" action="{!cancel}"/>
            </apex:pageblockbuttons>
            <apex:inputHidden id="pass" value="{!status}"/>
             </apex:pageblock>
        
            <script language="JavaScript" type="text/javascript">
            if(document.getElementById('the:page:close:pass').getAttribute('value') == 'true')
                {
                    window.top.close();
                }
            </script>   
             </apex:form>
</apex:page>

Controller: 
public class Accpopup2 
{
    public Account a {get;set;}
    public string status {get;set;}
    public Accpopup2()
    {
      a = new account();  
    }
    public pagereference save()
    {
    ID caseID = apexpages.currentPage().getParameters().get('id');
    if(caseid!=null)
    {
        account acc = [select Name,Phone from account where ID =: caseID];
        acc.Name = a.Name;
        acc.Phone = a.Phone;
        update acc;
    }
       
        return null;
    }
    
    public pagereference cancel()
    {
        status = 'true';
          return null;    
    }
}
Does anyone know if it is possible to get the selected stage values using SOQL ... see screen shot below:

User-added image

My thoughts were that this information would be stored in a Picklist, but I have only been able to get to the various Sales Process values:

Find the FieldDefinitionId
SELECT EntityDefinitionId, QualifiedAPIName, FieldDefinitionId FROM EntityParticle WHERE EntityDefinition.QualifiedApiName LIKE '%Business%' AND DataType = 'picklist'

Get the Picklist values based on the EntityParticleId which will equal the FieldDefinitionId​
SELECT DurableId,EntityParticleId,Id,IsActive,IsDefaultValue,Label,ValidFor,Value FROM PicklistValueInfo WHERE EntityParticleId = 'BusinessProcess.TableEnumOrId' ORDER BY label

How do you get those Selected Values ... if it can be done on the Sales Process page you would think you'd be able to use SOQL to get that information.

Thank you in advance for your time and input.
Hi,I am new to salesforce. Wanted to know that, is there any functionality in SOQL that can work similar to "NVL" functionality in SQl?