Delete record from file

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
John
Posts: 24
Joined: Thu Aug 10, 2017 3:21 pm

Delete record from file

Post by John »

I'm writing a new maintenance function based on the tutorial - WAD260A – An Employee Maintenance Application
( http://docs.lansa.com/14/en/lansa097/in ... A%7C_____0 )

I understand how the server module is used to insert and update records but I'm confused with the delete. I can't see where it does a delete. I can see how the Data Model invokes the Remove method for the gEmployees collection:

Define_Com Class(#prim_acol<#jtmDataEmployee>) Name(#gEmployees)

Mthroutine Name(DeleteEmployee)
Define_Map For(*input) Class(#jtmDataEmployee) Name(#Employee) Pass(*By_reference)
#gEmployees.Remove( #Employee )
Signal Event(EmployeeDeleted) Employee(#Employee)
Endroutine

So my question is, how does the remove method on the collection actually do a delete of the record from the file?
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Delete record from file

Post by Stewart Marshall »

From what I can see, there is no specific code to actually perform the delete.

You'd need to add a Delete method to the data model which would execute a server routine to delete the record.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply