You need to sign in to do that
Don't have an account?
Kimberley Lockwood
Cloning Custom Objects - clear Text Rich Fields
Hi Everyone,
Hoping you can help with something I am stuck on.
I have created a button to clone a custom object however I don't want the rich text boxes to clone over and want them to clear and be blank when I have cloned the object.
I have tried using the formula to leave the field blank..... 00N7E000000IJvf =
However this doesnt seem to blank out text fields - it is only working on my date/number fields
Any help would be amazing - thanks all!!
Hoping you can help with something I am stuck on.
I have created a button to clone a custom object however I don't want the rich text boxes to clone over and want them to clear and be blank when I have cloned the object.
I have tried using the formula to leave the field blank..... 00N7E000000IJvf =
However this doesnt seem to blank out text fields - it is only working on my date/number fields
Any help would be amazing - thanks all!!
Can you please share me the code you have written in Clone button?
cheers,
Dhriti
https://cci.my.salesforce.com/{!Field_Accompaniment_Form__c.Id}
/e?clone=1&retURL=/{!Field_Accompaniment_Form__c.Id}
&00Nb000000A49xE=
&00Nb000000A49xF={!Field_Accompaniment_Form__c.Date__c}
This works and updates the date field but when I try the same kind of set up for blanking out text it doesn't work
Any suggestions would be great!
Thanks
Kim
In Controller,inside constructor,query the fields you need make necessary fields as null,then clone it either using deep clone or shallow clone.
Follow this code snippets:
Object o = [Select Id,field2 from object where Id =:ObjectId LIMIT 1];
o.Field2 = ' ';(make your text field as null)
inside you save method:
object o1 = new object(); //replace with your object name
o1 = o.clone(false,true,false,false);
let me know if you have any doubt.
Cheers,
Dhriti