Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
New Member
Posts: 12
Registered: ‎01-20-2012

Inserting a new record using sData.

I know that I need to call the template to get the object graph .. 

 

/slx/dynamic/-/accounts/$template

I know that you are supposed to then modify the field s and then send it back through a post, my question is, what exactly is the expected payload?  Everything between the <sdataSmiley Tongueayload> tags?

 

Highlighted
Nickel Contributor
Posts: 92
Registered: ‎03-30-2009

Re: Inserting a new record using sData.

Good question. 

 

I started out this way too. I would download the template, edit all the fields, and then send it back.

 

I have switched to just building the payload myself for the most part now though.

The template will contain all the required fields of the entity with defaults as well as any common fields for that entity. There is a hierarchy of some sort that determines this. That is useful, but you want to clear out any fields you do not want to update/insert anyway.

 

You can check out some code here of inserting a ticket if you like:

 

https://github.com/jasonhuber/JavaScriptSData-Sample-Bootcamp/blob/master/default.htm

 

about line 207

 

But really you should come to class:

http://www.sageu.com/saleslogix/vc.html?inter.viewcentral.com/Events/cust/search_results.aspx?cid=sa...

 

Smiley Happy

Highlighted
New Member
Posts: 12
Registered: ‎01-20-2012

Re: Inserting a new record using sData.

Yeah, I had been discussing taking some of the training courses. Thanks for the sample, I'll look into it.
Highlighted
Nickel Elite Contributor
Posts: 107
Registered: ‎03-09-2011

Re: Inserting a new record using sData.

Just remember if you craft your own payload, that if the entity changes, you will need to modify your code.

Highlighted
New Member
Posts: 12
Registered: ‎01-20-2012

Re: Inserting a new record using sData.

Yeah, I ended up finding a better way to store and display the information. And Jason Huber's sample code got everything working just great.