function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VDaveVDave 

Create SObject with Callback

I am developing a CTI app. For the standard (non console app) it is located in the sidebar. When the user elects to crate a new object (Lead, Contact, Case, Opportunity, Account) I scren pop the new object page.

i.e. sforce.interaction.screenPop(path, true);  where path is one of (/500/e, /006/e, /003/e, /001/e, /00Q/e)

I want to know if there is a way to get a callback once the object has been creatd? I want to get an updated with the object id once they have hit save. How can this be done without polling the database for new objects of that type?

More Info:
I am using the Streaming API but the screen refresh on 'Save' prevents me from receving the message. It does work will in the Console where the screen is not refreshed once the new object is saved.

My Issue:
  1) User elects to create a new object from my sidebar app and clicks create
  2) User is take to the new object page
  3) User fills in the required information and hits save
  4) Screen is reloaded and the object is saved. (Note: My Sidebar app is also reloaded and I have to resubscribe to the streaming api channels)
  Issue) Because the screen is refreshed the streaming api doesn't get me the information. Becase the datastore takes a long time to index I can't find the data with a search.


How can I get the id of newly created records? I have thought of a two work arounds but I am not a fan of either.
1) Poll the database after the user this create.
2) Create the object in my APEX, prefil the required fields, save the object and take the user to that page.

Is there a better way?



Ashish_SFDCAshish_SFDC
Hi , 


Try adding a pop up window where the control is redirected till you hit ok. 

See the detailed explanation and code in the link below, 

apex:commandButton : Confirm pop-up box before proceeding

https://developer.salesforce.com/forums/ForumsMain?id=906F000000099TBIAY


Regards,
Ashish