• Mahmood Butt
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies
I am currently working on survey to display a random questions, For that i need to update random numbers to a sobject. But System.NullPointerException: occurred in my code.

Apex:
public class update_random_question 
{
public   List<Question__c> scope{get;set;}
public update_random_question()
{
    for(Question__c a : scope)
    {
        a.orderby__c = randomizer.getRandomNumber(100);            
    }
update scope;
} }

VF:​
<apex:page controller="update_random_question">
    <apex:form>
        <apex:commandButton Value="Begin" action="{!update_random_question}"/>
    </apex:form>
</apex:page>

Notes: randomizer.getRandomNumber
Hi All,
I am creating a task using batch apex. Through batch apex I am inserting 50% data into Task (From Custom object1).
Remaining data I have in Custom Object2.
I want to get that data by using Trigger
I want to compare Account Id of Task with Custom Object 2(I have Lookup to Account in Custom Object2).
Can I do this by using Trigger?
Now, on which object I have to trigger and how syntax should be?

Thanks in Advance
I have migrated Notes to Enhanced Notes (ContentNote) using SF data loader. Most of the records are migrated successfully, only in few of the records I am receiving following error:

Invalid sharing type "I"
I tried changing the ShareType to 'C' (Collaborator) but same error. Does it have something to do with security settings of the Parent (LinkedEntityId) record?

P.S. All the error records have ParentIds in Quote ('0Q0') or Email Template ('00X') objects.
One of our clients has a requirement to migrate attachments to Salesforce Files. Salesforce Files (ContentDocument) object doesn't support insert().
They have also enabled this option from Winter '16 to allow file uploads to goto salesforce files instead of attachments.
User-added image

I have confirmed from Salesforce docs and data loader pertaining ContentDocument's supported calls. Now, is there a way I can still pull this task off of migrating attachments to salesforce files?
Here is soql i want get ids of attachments as follows and how can i retrieve ids from the list
 
list<Account> accs = [select (select id from attachments where createddate < last_N_days:10) from account where is_read__c = true]

Now i want ids of attachments into a seperate list how it is possible..

Thanks in advance
Hi,

I have scenario that update a custom field(Amount__C) of parent(Account) with sum of all child records (Total_Price) from Child Object(Invoice Line Item).

I have to wirte a trigger for above scenario, if any one have sample code please share it.

Thanks in advance,
Shaik