cancel
Showing results for 
Search instead for 
Did you mean: 

Save the record adds from AdvancedList

sinaei
Contributor
0 Kudos

Dear All,

I have a requirement, in Account_QC I have created an embedded component that contain AdvancedListPane.

When I click on the Add Row, I can chose RelationShip Type and UUID value.

My requirement is when I want to save this account, these values should be saved and these have to be sent to RelationShip tab of Customer_TI

How can I handle this? in Customer.xbo, before save, I have to write something.. but I do not know how and what

Can any one give me any suggetsion?

Regards

Sin

Accepted Solutions (0)

Answers (2)

Answers (2)

sinaei
Contributor
0 Kudos

Hi,

My problem has been solved, actually it was the problem of Binding my embedded component to my QC view,

Thanks a lot for your response guys.

Sin

Former Member
0 Kudos

Hello Sin,

In Customer there is the association Customer.Relationship.

Each association has the associated businessParterUUID and a roleCode (BusinessPartnerRelationshipRoleCode).

Try to create this relationship by code in beforeSave. Your code will be executed in every save, so be careful to not duplicate registers and cause any errors.

Regards,

Alexandre.

sinaei
Contributor
0 Kudos

Hi Alexandre,

Thanks for your reply. Can you please let me know how can I create this Node?

For example I can do this:

this.Relationship.Create();

But I try it, and againg in Account_TI is not saving!

Do you mean this?

Regards

Sin

sinaei
Contributor
0 Kudos

Hi again Alexandre,

I have done like this:

First I created a node that is elementsof Relationship.:

var CustomerNode : elementsof Customer.Relationship;

CustomerNode.RoleCode = this.Relationship.GetFirst().RoleCode;

CustomerNode.RelationshipBusinessPartnerUUID= this.Relationship.GetFirst().RelationshipBusinessPartnerUUID;

this.Relationship.Create(CustomerNode);

But when I want to debug it, this.Relationship is empty, has no value inside it,

Do you have any idea?

Thanks

Former Member
0 Kudos

Hello Sin,

Sorry, I don't have an enviroment to test the code but you may be in the right way. Try to create a hardcoded relationship for test purpose. Something like this:


var CustomerNode : elementsof Customer.Relationship;

CustomerNode.RoleCode = 1234; // (put some valid role code)

CustomerNode.RelationshipBusinessPartnerUUID= 1i2u3i12u3i1u23i1u32; // (put a valid bp uuid)

this.Relationship.Create(CustomerNode);

Regards,

Alexandre.

former_member186648
Active Contributor
0 Kudos

Hi Sin,

If this.Relationship is empty, you cannot use it to create new Relationship instance.

You will have to create Relationship with RoleCode and RelationshipBusinessPartnerUUID derived from elsewhere

Thanks, Pradeep.

sinaei
Contributor
0 Kudos

Hello Pradeep,

Thanks a lot for your response,

But if I want to drive it from somewhere else, It should be from ACCOUNT_TI.that now in standard we have Relationship in ACCOUNT_TI, but in QC view, when the account is not created yet, I can not drive it from somewhere else.

What do you think?

Regards

Sin

sinaei
Contributor
0 Kudos

Hi Alexandre,

Thanks for you reply, when I want to assign it a value, it works, but it can not read it from UI and my Embedded component... I did not find any soloution

Regards

Sin

Former Member
0 Kudos

Hi,

Are you saying that you can save the relationship but you can't show it on the screen?

Could you share your screens/configurations/bindings etc?

Regards,

Alexandre.

former_member186648
Active Contributor
0 Kudos

Hi Sin,

You could try to edit existing Account, it might return you data.
Since new Account might not have Relationship data.

Thanks, Pradeep.

sinaei
Contributor
0 Kudos

Hello Pradeep,

Actually if I want to edit an existing Account, it works, but if I want to assign the value to the Account that is going to be created (inside QC view), I do not have access to that.

It means that I can add relationship just after the Account has created! I can not assign the Relationship at the same time I create the Account.

Do you know if I can achieve it?

Regards

Sin

sinaei
Contributor
0 Kudos

Hi Alexandre,

Yes, I can save it, if I force it to write(from code), but it will write directly in Account_TI. but I can not insert it manually throgh QC view. because I can not read it...

Thanks

Sin

former_member186648
Active Contributor
0 Kudos

Hi Sin,

You could read Relationship from other existing Account and assign it to the new Account.

Thanks, Pradeep.

sinaei
Contributor
0 Kudos

Hi Pradeep,

But I want to assign a relationship to new Account manually, I do not want to give it a constant value.

If I read it from other existing account,I can Assign the value of that Account, not whatever I want

I want like this:

Regards

former_member186648
Active Contributor
0 Kudos

Hi Sin,

In the existing scenario once new Account is created does the end user maintain Relationship manually? If yes, then you cannot assign Relationship to the new Account.

If it is determined automatically, then you need to know the logic of defaulting.

Thanks, Pradeep.

sinaei
Contributor
0 Kudos

Hi Pradeep,

Thanks for you response,

Yes in the existing scenario after creating new account, in TI view, we can assign Relationship manually.

But the requirement is to assign it when the Account is going to be created ..

former_member186648
Active Contributor
0 Kudos

Hi Sin,

Here comes the problem, when it is entered manually in the standard UI,

You should come up with a logic to automate it, like if it is a dropdown, then you could pick one of them.

Retrieve will definitely fail, since it doesn't exists.

Thanks, Pradeep.