Insert Resources (Questions & answers) programatically

Insert Resources (Questions & answers) programatically

I'm trying to insert "Resources/Questions" in a service request template by an external routine using this steps:
 
- firstly, I use the API to insert the main entity (workorder table) and get the WorkorderID
- then, I insert one record in WO_Resources table, with the correct ResourceID and the WOID I got from the API
- finally, I insert 1 record for each question in that resource in the "ResourcesQAMapping" table, getting the questionid from the table called "questions" and the MAPPINGID from WO_Resources.UID.
 
But something must be wrong or I forget to insert some data/records, because when I edit the resources in the inserted service request, the system delete the records belonging to that resource and the data saved on them.



 
Is it possible to get a way/guidelines to insert properly this kind of information through an external routine?
thanks in advance
 
 
 
 
 
 

                  New to ADSelfService Plus?