+ Start a Discussion
hari.phari.p 

Site guest user not able to access one specific field

Hi, We have a VF page hosted in public sites, where the site guest user will enter the details. Once he save the data, we are running a trigger in the backend to send this data to Zuora. Using Zuora managed package utility classes. 

If System Admin or any other user logged in and execute this page, we are able to send the data successfully. When site guest user do the same, we are getting below error.
Error: SObject row was retrieved via SOQL without querying the requested field: zqu__Quote__c.zqu__Is_Parent_Quote__c

Steps:

1) Site Guest User clicks Save button in public VF page.
2) Trigger executed in the backend.
  
trigger Zuora_Quote_Trigger on zqu__Quote__c (after Update) {    
    if(Trigger.isUpdate){
        system.debug('In Quote  Trigger - after update '+trigger.new);
        set<Id> setQuoteIds = new set<Id>();
        map<String,String> mapQuoteAccountIds = new map<String,String>();
        for(zqu__Quote__c zq : Trigger.new){
            if(zq.zqu__ZuoraSubscriptionID__c == null && zq.zqu__ZuoraPaymentID__c != trigger.oldMap.get(zq.Id).zqu__ZuoraPaymentID__c ){
                mapQuoteAccountIds.put(zq.Id,zq.zqu__Account__c);
            }
        }
     if(mapQuoteAccountIds.keyset().size()>0) SendQuoteToZuora.sendQuote(mapQuoteAccountIds);
    }    
}

3) This trigger will call the SendQuoteToZuora class 
@future(callout=true)
    public static void sendQuote(map<string,string> Map_QuoteAccountID){
        List<zqu.zQuoteUtil.ZBillingQuoteCollection> quotes = new List<zqu.zQuoteUtil.ZBillingQuoteCollection>();
        
        for(string s: Map_QuoteAccountID.keyset()){
            system.debug('Map_QuoteAccountID......Key:'+s+'..value: '+Map_QuoteAccountID.get(s));
            zqu.zQuoteUtil.ZBillingQuoteCollection quote = new zqu.zQuoteUtil.ZBillingQuoteCollection();
            quote.sfdcAccountId = Map_QuoteAccountID.get(s);
            quote.zAccountId = 'new';
            quote.quoteRequests = new List<zqu.zQuoteUtil.ZBillingQuoteRequest>();
            zqu.zQuoteUtil.ZBillingQuoteRequest req = new zqu.zQuoteUtil.ZBillingQuoteRequest();
            req.sfdcQuoteId = s;
            quote.quoteRequests.add(req);            
            quotes.add(quote);
            
        }        
                    
        List<zqu.zQuoteUtil.zBillingResult> results = zqu.zQuoteUtil.sendToZBilling(quotes); // invoing managed package class
        for ( zqu.zQuoteUtil.zBillingResult result : results ) {
            System.debug('Result: QuoteId = ' + result.sfdcQuoteId + ', Success = ' + result.success + ', message = ' + result.message );
        }
    }

Any help is greatly appreciated. 

Balayesu ChilakalapudiBalayesu Chilakalapudi
Try making zqu__Is_Parent_Quote__c as visible in Public access settings of your site profile.
hari.phari.p
Given all the field level access, but still getting the error
Balayesu ChilakalapudiBalayesu Chilakalapudi
In addition to the field level access, to allow guest users to view or submit data to a standard or custom Salesforce object, you must modify the object’s permission in the site’s guest user profile.
  1. To edit the site’s guest user profile:
  2. On the Overview tab, click Site Configuration.
  3. Click the link next to Guest User Profile.
  4. Click Edit.
  5. Scroll down to the Custom Object Permissions.
  6. On the zqu__Quote__c object select the Read column for the field zqu__Is_Parent_Quote__c 
  7. Click Save.
AthiSachiAthiSachi
Hello,

I have similar issue and Event Guest site do have Create and view access on contact object. Contact records are created fine but there is a Primary campaign source field(Lookup field) and it is not writing that field alone. Primary campaign source field has View/Create permission and it's standard field.
Wonder Whether I have to give permission for lookup object too?  Though It doesn't make any sense, as other lookup fields are written fine.
Appreciate any help.
thanks
Athi
RyanSchierholzRyanSchierholz
Yup, same issue here. When a user submits my form, one lookup field does not get wrriten to the DB, but the others do. It worked for a moment, but I am unsure what changed from when it worked to when it didn't. I re-wrote the component to get more clarity on the issue, and the error I get is 
[{"fieldErrors":{"Closing_ID__c":[{"message":"No access to field Closing_ID__c. Either the field was removed from the entity or access to this field was removed.","fieldApiName":"Closing_ID__c"}]},"pageErrors":[]}]

However, the field does exist, and it's permissions look just fine. I even added a new field, from scratch and attempted to write to that, but ran into the same issue.