• Newbie10
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 16
    Replies

I have a requirement to download multiple files on a click of visual force button.

i know below will work if its a single file

   <a href="/servlet/servlet.FileDownload?file={!fileId}">

 

any clue about how to gain this for multiple files

We got a community which is being shared by a two different projects.

Landing page of community is different for two different projects

So as to make sure users land on correct pages,
custom urls on communities was suggested option (due to time restriction)

and when i try to create a custom url.i cannot publish it/test it..any idea what to do?

This is how i added custom url,
went to domain management--clicked add domain.gave a domain name

-Do i need to contact salesforce for enabling domain or something-

went to communities, selected force.com link ,next to a particular community
selected custom url->create new
selected domain specified in previous step [Only those domains created by above steps can be selected here]

I got a sharing rule which is criteria based sharing rule on custom object and it says if

Product Name equals ''

Share with All Partner users

Readonly

This rule works in terms of sharing the records.

But when i try to migrate it using change sets (Just this sharing rule) It gives me An unexpected error occurred. Please include this ErrorId if you contact support: 1748658427-9347 (1893024205)

 

Does anyone know why? Is it because i put '' ? and it takes it as empty value or something?

 am new to Apex and not very sure about how to display message. Here is my use case i need to check whether owner has been changed and a box is checked. and if condition is true should not allow the change. If condition is false should carry on processing.

It is NOT an 'ALL or NONE' case.

Its a before update trigger.

What i am doing below is changing the owner back to previous ,when my condition is true.and ideally i would like to show users list of records for which owner cannot be changed.Not sure whether that is even possible.Or is there a better way to do this?

I need to display this especially mainly when user tries to change ownership via  mass transfership  tool

 

public static void checkOwnerChange(map <ID,account>Triggeroldmap,list<account>Triggerlist){
List<account> toUpdate = new list<account> ();
for (Account accountrecord: Triggerlist){
Account oldaccount = TriggeroldMap.get(accountrecord.ID);
if ((accountrecord.checkbox == true) &&
(GEN_Utilities.recordType(accountrecord.recordTypeId) == 'check Account') &&
(oldaccount.OwnerID != accountrecord.OwnerID))
{
accountrecord.OwnerID = oldaccount.OwnerID ;
//some way to display a message saying this record cannot be changed
}
}
}

 

I have a multiselect picklist in my grandparent object.

I have a text field in my object.

Whenever user enters text into this text field ,and after saving i need to check whether my text contains the values defined in picklist


This is mainly for a profanity check .

what is the best way to do this?

Hi everyone,

I created a reference variable a.

and instantiated it .

how i thought what happens during instantiation is,

First instantiation->

Account1 got its heap area

Reference Variable 'a' point to 'Account1' memory location

 

Second instantiation->

Account2 got its heap area

reference variable 'a' now repoint to 'Account2'

 

Account 1 is ready for garbage collection.

 

But when i run below code.heap size remains same for second instantiation.how can this be true?where am i going wrong?

 

account a;
System.debug('Current Heap:::' + Limits.getHeapSize());
a = new account(name ='Account1');
System.debug('Current Heap:::' + Limits.getHeapSize());

system.debug(a);
a = new account(name = 'Account2');
System.debug('Current Heap:::' + Limits.getHeapSize());

system.debug(a);

Hi All,

 

Is there an easy way to update a field on Master record,as a result of approval process on detail object(both custom)

Must be something very silly.But i get an error like this

14:17:59:040 FATAL_ERROR System.QueryException: List has more than 1 row for assignment to SObject

 

for code below

 

List<Contact> mylist = new list<Contact> {[select id from Contact ]};

 

Anyone can spot anything?

Can anyone please explain what is the difference between two code below

 

1.

Account acc1 = new account(name = 'a');

 

2.

 

Account acc1 ;

 acc1 = new account(name = 'a');

 

 

 

In developer console i could see ,variable assignment of acc1 with a memory location ='0X352e62d6' at end of code 1

and at end of code 2,variable assignment of acc1 is null

 

 

Can somebody please explain what below code does

sobject s = new account();

Account a = (Account)s;
object obj = s;

a = (account)obj;

 

 

I am particularly interested in what happens at stack/heap when object obj = s happens.

 

i could see in developer console a [object Object] value for obj.But cannot figure what exactly happens internally or what is the purpose

 

 

Code source is Apex developer guide