4

Static Resources are not subscriber-editable, i.e., cannot be changed in subscriber orgs when installed as part of a managed package. Static Resources are meant to be just that - static. They are not for dynamic file storage. If your managed package needs to store writeable document blobs you should store them somewhere else, most likely a ContentDocument.


2

Use a try-catch block: public PageReference saveType() { try { insert listRecType; } catch(DmlException e) { ApexPages.addMessages(e); return null; } PageReference contRecord = new PageReference('/'+contId); contRecord.setRedirect(true); return contRecord; }


2

JPEG images have an "orientation" tag that can be set by the camera or image editor. For example, an image can be stored upside down in the file, but the tag states the image is stored upside down, and the browser will flip it right side up so it looks right. However, not all image rendering systems understand this tag, including presumably the pdf ...


2

It's just __c. No need to go through the relationship: rec = new recipient__c(School__c=sch.School__c); If you actually needed a value from the related object, you'd use __r instead: rec = new recipient__c(Name=sch.School__r.Name);


2

Yes, you can catch those errors: try { insert record; } catch(Exception e) { ApexPages.addMessages(e); } Or you can manually process them: Database.SaveResult[] results = Database.insert(new sObject[] { record }, false); if(!results[0].isSuccess()) { ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.ERROR, results[0].getErrors()[0]....


1

You should be able to pass the Account Id and Contact Id in the PageReference on the first VF page by setting them as parameters: PageReference RetPage = new PageReference('/apex/NewEngage'); RetPage.setRedirect(true); RetPage.getParameters().put('accountId', contacts.AccountId); RetPage.getParameters().put('contactId', contacts.Id); return RetPage; Then, ...


1

Your list in Apex doesn't contain the literal variable a. It contains the contains the same Account that is stored in a. Just like in Apex, when you have a list, you need to loop over the elements one at a time. In Apex, you'd use a for or while loop. With Visualforce, you use <apex:repeat> (or some other component that can handle multiple items, like &...


1

It looks like you need to call Test.setCurrentPage(pageRef); with an applicable page reference that has a rec query string parameter in your unit test. Right now there isn't a "current page" to access in your class. Without setting the page, it's not possible to get the parameters for it as you're attempting to do here: rec = Integer.valueOf(...


1

You can only pass index (Integer value) in list.remove method, but you are passing Rec_Type__c type in your apex class: listRecType.remove(rec); Please try following code for your test class: @isTest private class Test_NewRecController { static testMethod void testMethod1() { Account testAccount = test_CreateRecords....


1

You can't use Apex methods in Visualforce. You need to use the formula syntax. rerender="{!IF(item.name='ee','tstpopup2','tstpopup')}"


1

By Default, You can override the lightning Interface button with Vf Page and Lightning Component. If you have flow and want to override the button with a flow:- You can create a lightning component where you do call your flow on load. You can create a new custom button on contact record using flow. Or you can create a url button that launches flow


1

You are resetting your rec variable after insert, which destroys the reference you need to the inserted object's Id: insert rec; rec = new recipient__c(); rec.Id is now null, because you erased the sObject that was in that variable. insert sch; sch = new scholarship_award__c(Recipient__c=rec.Id); So you can't connect up the ...


Only top voted, non community-wiki answers of a minimum length are eligible