Skip to Content
0
Former Member
Mar 19, 2006 at 05:45 PM

How to addRecord in Web Dynpro to Model node (Entity Service ref)

17 Views

Hi,

1) I create Entity Service in CAF and try to write web dynpro Table UI for it.

2) is it possible with using Model Node? or I MUST use Value Node - Table must have possibilities for Add, Edit and Delete records.

Now I can edit, and delete records, but I can't add records with AddRecord method

Code below

public void NewTS( )

{

//@@begin NewTS()

IServiceFacade serviceFacade;

// Add new Model object TS

ATS ts = TSServiceProxy.create();

ts.setDate( new Date(System.currentTimeMillis()));

ts.getAspect().sendChanges();

serviceFacade = CAFServiceFactory.getServiceFacade(tsDefinition.class);

// try to addRecord to Controller context

IWDNodeElement n = wdContext.nodeTS().createElement(ts);

wdContext.nodeTS().addElement(n);

}

The error is: com.sap.caf.rt.exception.CAFBaseRuntimeException:

Aspect row is invalid for aspect: <Aspect name="TS" >

Thx for any help