You need to sign in to do that
Don't have an account?

Custom settings and apex
Hey guys ,
I trying to produce a pdf based on info from a object call document , i have a field call signature_c and if the use field is filed that text will appear in the documento , if not the info will be based on a custom seeting.
My doubt is about the custom setting in the pdf , the custom seeting is called assinatura and will only have one field.
How do i call the custom seeting in the controller and compare with the field in the custom object dociment.
Thank in advance
I trying to produce a pdf based on info from a object call document , i have a field call signature_c and if the use field is filed that text will appear in the documento , if not the info will be based on a custom seeting.
My doubt is about the custom setting in the pdf , the custom seeting is called assinatura and will only have one field.
How do i call the custom seeting in the controller and compare with the field in the custom object dociment.
Thank in advance
Do you only have one record for the Signature cutom setting? If so, you can use it like this:
Document__c d = [select Id, Signature__c where Id = :docId];
List<Signature__c> lstSgs = Signature__c.getall().values();
if (d.Signature__c == null) d.Signature__c = lstSgs[0].name; (I assumed that the only one field in the Signature custom setting is called 'Name')
Best,
then put map values into list and simply refer its fields like you do with objects..