cancel
Showing results for 
Search instead for 
Did you mean: 

copyCorresponding to model node

Former Member
0 Kudos

Hi,

i have following problem:

I have a context node with cardinality 1:1. This node should be copy to a model node as input for the rfc function. the model node has the cardinality 0:1

I try copy with:

WDCopyService.copyCorresponding(wdContext.nodeContextNode().currentContextNodeElement(),

wdContext.nodeModelNode().currentModelNodeElement());

But wdContext.nodeModelNode().currentModelNodeElement() is NULL after this statement.

I think because of the cardinality 0:1, there is no current...... Element..!?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Christopher,

You can make the cardinality of your context node as 1:1.

If thats not possible... try setting the LeadSelection of your model node to 1.

wdContext.nodeModelNode().setLeadSelection(1);

Then use the CopyService command as u said.

Regards,

Sayan Ghosh

Former Member
0 Kudos

Hi Sayan,

i can't set the leadselection to "1" if i don't have elements in my node. I would get indexoutofbound exception.

Former Member
0 Kudos

Hi Christopher,

If thats the case, then make the cardinality of your context node as 0:1...

what is your requirement exactly..? i mean why cant you make the cardinality of your context node 0..1. ?

Regards,

Sayan Ghosh

Former Member
0 Kudos

I think i can't change the cardinality, because it's given by the rfc model.

Former Member
0 Kudos

Hi..

I am not asking you to change the cardinality of model node. Surely u cant do that. I am asking you to change the cardinality of the context value node where you are copying the values from your model node.

Make the cardinality of your context value node same as that of the model node.

Regards,

Sayan Ghosh

Former Member
0 Kudos

Hi Christopher,

Before the code:

WDCopyService.copyCorresponding(wdContext.nodeContextNode().currentContextNodeElement(),

wdContext.nodeModelNode().currentModelNodeElement());

add following code:

wdContext.nodeModelNode().createModelNodeElement();

Regards,

Gopal

Answers (1)

Answers (1)

Former Member
0 Kudos

yeah, because when cardinality is 0:1 you dont have a element to hold the values,

Thanks

Gopal