Dematerialize?

28 views
Skip to first unread message

silent (e)

unread,
Oct 20, 2011, 6:34:45 PM10/20/11
to activesa...@googlegroups.com
<while visions of Star Trek danced in his head> How do we go about regenerating a materialized sobject?  I've been able to dematerialize one by using the line below.  "Salesforce" is my namespace.

Salesforce.send(:remove_const, 'SalesOrderItem__c')

since remove_const is private I have to send to it.  I see you're also using this technique in the tests, though just for teardown (client_spec line 350).

Removing a field results in a Databasedotcom::SalesForceError.  No such column '[fieldname]' on entity '[sobject name]'.  I suppose I can capture those.  Adding a field doesn't do anything because it won't be available to our code until we rematerialize the sobject.

How have people done this in the past when objects change?  I certainly haven't been very clever about it, programmatically.  I tell my SF admins to tell me when a field is removed and I just restart the site. :(  This was also using ASF.

Granted this is probably not a huge issue since field removals should be a rare occurrence.  But thoughts on how to best do this without restarting the site are appreciated.

matte

raygao-gmail

unread,
Oct 20, 2011, 7:33:15 PM10/20/11
to activesa...@googlegroups.com
Hello Scotty,

I see a method in the SOboject. It is called reload(). That might be the one does the teleporting. Is there a way to announce changes made to the data model from the server (SF side)?

It is quite interesting to follow this thread and seeing how rapidly bugs were caught and new features added, power of the community.

Aye, captain, beaming you up.  :-P

-ray



--
You received this message because you are subscribed to the Google Groups "ActiveSalesforce" group.
To view this discussion on the web visit https://groups.google.com/d/msg/activesalesforce/-/I47DAjhZTw8J.
To post to this group, send email to activesa...@googlegroups.com.
To unsubscribe from this group, send email to activesalesfor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activesalesforce?hl=en.

silent (e)

unread,
Jun 22, 2012, 4:34:10 PM6/22/12
to activesa...@googlegroups.com
Hey folks.  I'm re-opening my line of inquiry about this.  We're readying a new site and I've started to see this error rear its ugly head again.

Anyone who's using this gem in production, are you experiencing "INVALID FIELD" errors?  How are you handling them?

I'm going to look into the reload() method that Ray mentioned but I'm hoping someone else has seen this and has worked out a solution.

matte



On Thursday, October 20, 2011 4:33:15 PM UTC-7, raygao wrote:
Hello Scotty,

I see a method in the SOboject. It is called reload(). That might be the one does the teleporting. Is there a way to announce changes made to the data model from the server (SF side)?

It is quite interesting to follow this thread and seeing how rapidly bugs were caught and new features added, power of the community.

Aye, captain, beaming you up.  :-P

-ray


On Oct 20, 2011, at 5:34 PM, silent (e) wrote:

<while visions of Star Trek danced in his head> How do we go about regenerating a materialized sobject?  I've been able to dematerialize one by using the line below.  "Salesforce" is my namespace.

Salesforce.send(:remove_const, 'SalesOrderItem__c')

since remove_const is private I have to send to it.  I see you're also using this technique in the tests, though just for teardown (client_spec line 350).

Removing a field results in a Databasedotcom::SalesForceError.  No such column '[fieldname]' on entity '[sobject name]'.  I suppose I can capture those.  Adding a field doesn't do anything because it won't be available to our code until we rematerialize the sobject.

How have people done this in the past when objects change?  I certainly haven't been very clever about it, programmatically.  I tell my SF admins to tell me when a field is removed and I just restart the site. :(  This was also using ASF.

Granted this is probably not a huge issue since field removals should be a rare occurrence.  But thoughts on how to best do this without restarting the site are appreciated.

matte

--
You received this message because you are subscribed to the Google Groups "ActiveSalesforce" group.
To view this discussion on the web visit https://groups.google.com/d/msg/activesalesforce/-/I47DAjhZTw8J.
To post to this group, send email to activesalesforce@googlegroups.com.
To unsubscribe from this group, send email to activesalesforce+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages