Ok, here is the complete class

Class pkgAddressBook.cTlphones Extends %Persistent [ ClassType = persistent,
ProcedureBlock, SqlTableName = Tlphones ]
{

Property Person As cPerson;

Property Tlphone As %String;

Property TlphoneType As cTlphoneTypes;

Index TlphoneIndex On Tlphone [ Unique ];

Query qPrsonTlphnes(PrsonID As %Integer = 0) As %SQLQuery(CONTAINID = 1)
{
SELECT
%ID,Person->Category->Category,Person->Category->ID,Person->Category->ID,Per
son->FirstNme,Person->ID,Person->LastNme,Tlphone,TlphoneType->ID,TlphoneType
->TlphoneType FROM Tlphones
 WHERE (Person = :PrsonID)
 ORDER BY Tlphone
}

ClassMethod DeleteTlphone(TlphoneID As %Integer)
{
 Set objTlphone = ##class(pkgAddressBook.cTlphones).%OpenId(TlphoneID)
 Do objTlphone.%Delete()
 //Do ##class(pkgAddressBook.cTlphones).%DeleteId(TlphoneID)
 //set sc=$zobjclassmethod(pkgAddressBook.cTlphones,"%DeleteId",TlphoneID)
}

}


I then call it from ShowTlphones csp

<SCRIPT Language=JavaScript>
<!--

function RmoveTlphone(intID)
{
 #server(..DeleteTlphone(intID))#;
}
// -->
</SCRIPT>

And get the following error.

csp.showtlphones.1(0) : OBJ5376 :  Method or Property '%DeleteData' does not
exist in this class.
 TEXT:  Set sc=..%DeleteData(id,concurrency)

Errors detected during compile.

Before adding the delete method, everything was working fine. Can you
explain how to get rid of the error and the proper way to add delete
functionality from a csp page?

"RJH" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I added a method to delete a record here is the code:
>
> ClassMethod DeleteRecord(intID As %Integer)
> {
>  //Set obj = ##class(ClassNamePackage.Class).%OpenId(intID)
>  //Do obj.%Delete()
>  //Do ##class(ClassNamePackage.Class).%DeleteId(intID)
>  set sc=$zobjclassmethod(ClassNamePackage.Class,"%DeleteId",intID)
>
> }
>
> As you can see I tried 3 different versions. But I get the following error
>
> Method or property %DeleteData does not exists.
>
> I removed the method, but can not re-compile. I get the same error. Can
> anyone help and explain what is going on?
>
>



Reply via email to