• Don Schueler 6
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
I have an old button in a VF Page that used a Hacked URL to create a new contact record. This VF Page is based just on a custom controller.
The old hack was /003/e etc.
The problem is that the URL was an issue in lightning communities if I just redirected to the shortened URL above.
I need to either correct the URL when in Communities OR be able to
call a Global Action or Object Action from the VF Page...

Any ideas on this out there? Thanks in advance...d
I have a VF Search Page and associated controller that searches for existing contacts. If the contact isn't found the user can create a new one. I can do this but it takes the default record type. I want this button on the VF page to first bring up the dialog for choosing record type as it does from the Lightning NEW buttons. I would like this to work in Classic and Lightning but if its Lightning only thats ok too. 
I have a VF Page that is used in the Partner Community to lookup a contact that they might not have access too and gain access.  This works fine in my Dev org....but I had to switch Contact to Private from Controlled by Parent to both save the code AND to run the test class successfull.

So far my code works since I do an Organization query to see if my Contact is 'ControlledbyParent', if it is I don't update the ContactShare object, I just Share the Account.  Note...as many might know, you can't even save your APEX with ContactShare cShare = new ContactShare(ContactId=cid, UserOrGroupId=UserInfo.getUserId(),ContactAccessLevel='Edit');   in it  if you have Controlled By Parent for Contact set as your default sharing. This is the only case I am aware of in SF where a configuration setting impacts the ability to save code or run a test or include in a package. Seems wrong to me...we should be able to handle this in code and have it be OK.

THE PROBLEM NOW IS: I can't include this in my managed package....I get: Dependent class is invalid and needs recompilation: Class ApexBaseClass : Field is not writeable: ContactShare.ContactId

So I am looking for either solutions to this from a packaging standpoint OR a better way to accomplish the functionality. Thinking aloud..I guess I coud do it in AJAX using API...not that I would love it there... Looking for other alternatives.....thanks in advance.
I have a for loop over a SOQL select using a date field with a date literal e.g. LAST_MONTH

I would like to make this more generic by providing the ability to pass in the datevalue dynamically as a variable into the SOQL Quert e.g. :monthFilter

Is there a good way to do this?
I have a VF Page that is used in the Partner Community to lookup a contact that they might not have access too and gain access.  This works fine in my Dev org....but I had to switch Contact to Private from Controlled by Parent to both save the code AND to run the test class successfull.

So far my code works since I do an Organization query to see if my Contact is 'ControlledbyParent', if it is I don't update the ContactShare object, I just Share the Account.  Note...as many might know, you can't even save your APEX with ContactShare cShare = new ContactShare(ContactId=cid, UserOrGroupId=UserInfo.getUserId(),ContactAccessLevel='Edit');   in it  if you have Controlled By Parent for Contact set as your default sharing. This is the only case I am aware of in SF where a configuration setting impacts the ability to save code or run a test or include in a package. Seems wrong to me...we should be able to handle this in code and have it be OK.

THE PROBLEM NOW IS: I can't include this in my managed package....I get: Dependent class is invalid and needs recompilation: Class ApexBaseClass : Field is not writeable: ContactShare.ContactId

So I am looking for either solutions to this from a packaging standpoint OR a better way to accomplish the functionality. Thinking aloud..I guess I coud do it in AJAX using API...not that I would love it there... Looking for other alternatives.....thanks in advance.
Hi,
we created a managed package where we also deliver picklist values to a global picklist which is included in the package.
After we deployed this package on a subscriber org and on the subscriber org, we added new picklist values and disabled some values which came with the package in the mentioned global picklist.
On upgrading the manage package, all changes made on the subscribe for this global picklist is gone.

If I understand this description correctly: https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_component_behavior.htm

Picklist Values
Subscribers can rename or delete picklist field values. Carefully consider this when explicitly referencing a picklist field value in Apex.
Picklist field values can be added or deleted in the developer’s org. Upon upgrade, no new values are installed. Values deleted by the developer are still available in the subscriber’s org until the subscriber deletes them.

So this should not happen, right ?
  • January 11, 2018
  • Like
  • 0
I have a for loop over a SOQL select using a date field with a date literal e.g. LAST_MONTH

I would like to make this more generic by providing the ability to pass in the datevalue dynamically as a variable into the SOQL Quert e.g. :monthFilter

Is there a good way to do this?

I am developing a trigger that will give access to certain contact records
that will meet some criteria. I need to update and insert a ContactShare
object for the same. However I am getting a compilation error

Error: Compile Error: Field is not writeable: ContactShare.ContactId at
line 8 column 9

trigger Share_Contact_For_Account on Contact (after insert, after update) {

    for (Contact c : Trigger.new) {


        ContactShare cs = new ContactShare();

        cs.ContactId = c.Id;
        cs.ContactAccessLevel = 'Edit';


    }
}


Any one got any ideas as to what I am doing wrong?

 

thanks,

-Rajiv

  • October 26, 2010
  • Like
  • 0