• gshuflin
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies

I'm creating a ZKSobject in my iOS app by querying salesforce for records with a mix of read-only and read-write fields (the read-only ones are mostly formulas, so I can't make them not read-only by changing permissions). In the app, I change a few of those field values on the ZKSobject, and then I want to just upload that same ZKSobject to save the changed data to salesforce with

 

    [[ZKServerSwitchboard switchboard] update:[NSArray arrayWithObject:myZKSObject] target:self selector:@selector(handleUpload:error:context:) context:nil];

 

 

However, because of those read-only fields that I wanted to get in the original query, the updated ZKSobject gives me a INVALID_FIELD_FOR_INSERT_UPDATE error when I try to upload it, even though the only fields I'm touching on the ZKSobject are read-write ones. Setting those fields to null on the object still gets me that error. What I want to do is get those particular read-only fields out of the ZKSobject entirely, as if I had never queried them to begin with, so that I can save the object with the rest of the fields that *are* writable and that I *do* want to save. I can't seem to find a mechanism to do this though.

I'm making use of the Salesforce iOS toolkit for a custom app for my organization. I'm basically using the ZKSObjects that that framework provides to store the state of my organization's records on the iPad, and then, when the user hits an update button, runs:

 

 

[[ZKServerSwitchboardswitchboard] update:[NSArrayarrayWithObject:checklistZKSObject] target:selfselector:@selector(handleUserSave:error:context:) context:nil];

 

where checklistZKSObject is a reference to that ZKSObject. The selector is called on self, and that selector doesn't see any NSError in the update. Nonetheless, the changes I make to the ZKSObject aren't getting reflected in salesforce. Since there's no error getting returned by the selector, I'm not sure what I should be checking next to see where the problem is.

I'm using the salesforce iOS toolkit (http://wiki.developerforce.com/index.php/Force.com_Toolkit_for_iOS) in writing a custom iPad app, using oAuth authentication. This is working fine for making SOQL queries, but I need to be able to access certain salesforce pages that require authentication in a browser. I want to use the standard cocoa URL tools (ex. NSString initWithContentsOfURL) to request the source code of the salesforce pages I need, but every time I try salesforce responds to the request with the login page, and I end up with the HTML for the login page rather than the HTML for the page I'm trying to access. How do I make a web request to salesforce using the authentication information I have from the iOS toolkit's oAuth implementation?

I'm developing an iPad app (using the salesforce iOS toolkit) that needs to obtain a list of custom objects according to various, frequently-changing criteria. It would be easy to write an soql query that retrieves the data we need once, but we change the criteria we need to query by often enough that writing one set soql query into the code of the app would not suffice. The people in my organization who decide on these criteria currently can generate a report that outputs the list of custom objects we need, and ideally I would be able to query this report from the iOS app, somehow use it to generate an equivalent SOQL statement, then run that SOQL statement to get the custom objects we need available to the app.

 

I've been doing some googling and it seems like, at least a few years ago, this was not possible to do, but possibly later versions of the salesforce api make this possible to do. Assuming that doesn't work, is there another way that I'm not seeing to be able to programatically get user-defined report filter criteria and generate a soql query off of that?

I'm using the ios toolkit as per http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Toolkit_for_iOS. I need to programatically get the user id of the user who is currently logged in so I can query for various objects that that user owns. How would I go about doing this?

I have this section of code as the bulk of a before insert/update apex trigger on my organization's Inspection_Checklist object:

 

trigger NewCapEx on Inspection_Checklist__c (before insert, before update) {

    Inspection_Checklist__c[] checklists = Trigger.new;
    
    
    //for the purpose of making this bulk-safe, get the prop evals in bulk now
    
    //the next step is to refactor the two or so methods downstairs to take as an argument the prop eval, and since we have that propeval
    //here, we just call it with it and blam we're good
    Set<id> propEvalIDs = new Set<id>();
    for (Inspection_Checklist__c checklist : checklists) {
      propEvalIDs.add(checklist.Property_Evaluation__c);
    }
    
    Map<id,Property_Evaluation__c> assocPropEvals = 
        new Map<id,Property_Evaluation__c>([select id, Name, Inspector__c, Inspection_Date__c,
           Inspection_Completed__c, Occupied_Status__c, Inspection_Est_Construction_Cost__c, 
           Active__c, PropChannelProxy__c from Property_Evaluation__c where id in :propEvalIDs]);
    
    system.debug('Prop Eval map: ' + assocPropEvals);
    
    Set<Property_Evaluation__c> toBeUpdated = new Set<Property_Evaluation__c>();
    
    
    for (Inspection_Checklist__c checklist : checklists) {    
        

        
        
           decimal capex = CapExEstimate.GetCapExEstimate(checklist);      
       
          checklist.CapExNewEstimate__c = capex; 
        
 
          
          Property_Evaluation__c updated = CapExEstimate.UpdatePropertyEvals(checklist, assocPropEvals);
          toBeUpdated.add(updated);
          
          
           checklist = CapExEstimate.AdditionalChecklistChecks(checklist);           
           checklist = CapExEstimate.setPurchaseChannel(checklist, assocPropEvals);

    
    }
    
    
    //once out of the for loop update the set
    //except you can't update a set for some reason so first convert it to a list
    List<Property_Evaluation__c> updateanda = new List<Property_Evaluation__c>();


    updateanda.addAll(toBeUpdated);    
system.debug('What\'s in the list: ' + updateanda);  

 update updateanda;

}




 

When I run this trigger, on many but not all updates, I'm getting a ListException error on that last line, the "update updateanda;", saying that I have duplicate IDs in the list. However, I just created that list two lines up, and I populate it by calling addAll() on a Set - and a set, by definition, cannot have duplicates. So I have no idea how there could possibly be duplicate records in that list! Nonetheless I added in the call to system.debug, and lo and behold it was showing duplicate entries in that list, which explains why the code fails on the update line right below it. Does anyone have any insight on how I might go about solving this?

I want to set it up such that when a user clones an Opportunity, salesforce automatically sets a custom field of the original Opportunity object that the new one was cloned from to a particular value. My thinking is that I could write a trigger that runs when an Opportunity is created, but I'm not sure how to get a reference to the original object using the standard Trigger functionality. Maybe there's another way to go about doing this.

I'm creating a ZKSobject in my iOS app by querying salesforce for records with a mix of read-only and read-write fields (the read-only ones are mostly formulas, so I can't make them not read-only by changing permissions). In the app, I change a few of those field values on the ZKSobject, and then I want to just upload that same ZKSobject to save the changed data to salesforce with

 

    [[ZKServerSwitchboard switchboard] update:[NSArray arrayWithObject:myZKSObject] target:self selector:@selector(handleUpload:error:context:) context:nil];

 

 

However, because of those read-only fields that I wanted to get in the original query, the updated ZKSobject gives me a INVALID_FIELD_FOR_INSERT_UPDATE error when I try to upload it, even though the only fields I'm touching on the ZKSobject are read-write ones. Setting those fields to null on the object still gets me that error. What I want to do is get those particular read-only fields out of the ZKSobject entirely, as if I had never queried them to begin with, so that I can save the object with the rest of the fields that *are* writable and that I *do* want to save. I can't seem to find a mechanism to do this though.

I'm using the salesforce iOS toolkit (http://wiki.developerforce.com/index.php/Force.com_Toolkit_for_iOS) in writing a custom iPad app, using oAuth authentication. This is working fine for making SOQL queries, but I need to be able to access certain salesforce pages that require authentication in a browser. I want to use the standard cocoa URL tools (ex. NSString initWithContentsOfURL) to request the source code of the salesforce pages I need, but every time I try salesforce responds to the request with the login page, and I end up with the HTML for the login page rather than the HTML for the page I'm trying to access. How do I make a web request to salesforce using the authentication information I have from the iOS toolkit's oAuth implementation?

I'm developing an iPad app (using the salesforce iOS toolkit) that needs to obtain a list of custom objects according to various, frequently-changing criteria. It would be easy to write an soql query that retrieves the data we need once, but we change the criteria we need to query by often enough that writing one set soql query into the code of the app would not suffice. The people in my organization who decide on these criteria currently can generate a report that outputs the list of custom objects we need, and ideally I would be able to query this report from the iOS app, somehow use it to generate an equivalent SOQL statement, then run that SOQL statement to get the custom objects we need available to the app.

 

I've been doing some googling and it seems like, at least a few years ago, this was not possible to do, but possibly later versions of the salesforce api make this possible to do. Assuming that doesn't work, is there another way that I'm not seeing to be able to programatically get user-defined report filter criteria and generate a soql query off of that?

I'm using the ios toolkit as per http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Toolkit_for_iOS. I need to programatically get the user id of the user who is currently logged in so I can query for various objects that that user owns. How would I go about doing this?