cancel
Showing results for 
Search instead for 
Did you mean: 

How to use TextCollection and display as multiple-line UI

SAPjedi
Contributor
0 Kudos

I have a requirement to add a few notes fields - as a xBO.  It seems I will have to define them as TextCollection datatypes.

These notes fields have to be displayed as multiple-line control in a facet (Accounts).

1. Any pointers on using associated TextCollection datatypes ?

2. How to add to a new facet and display as multi-line control field ?

Thanks ahead for your help !

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Thanks Alessandro,

I have completed 4 steps as you showed and 5th not required since I just need it on Overview Tab only and not on Details tab.

But I can see Notes Title 'Sales Call Objective' but TEXT area to enter/type is not visible OR available. Please help.

Former Member
0 Kudos

Your EC that is binded with the bo where you added the appointment ID and the textcollection, needs to have an instance of the underlying BO. Can you upload a screenshot of your EC?

Former Member
0 Kudos

Ok Alessandro. Here are screenshots.

Former Member
0 Kudos

Point 4: bind the custom EC  with the public outport, and import the ID and UUID parameters

next step 1: in the beforesave event of the appointment xbo, if not existing, create an instance of the BO Pall_AppointmentNotes.

next step 2: use these parameters to load an existing instance of your BO Pall_AppointmentNotes, in the Embedded component initialize event (that is binded with the inport)

Former Member
0 Kudos

Hi Alessandro,

I did Bind with Custom EC with public outport and import the ID. Cannot link UUID for some reason

I have completed step 2 as well.

Step 1: Do not know exactly how the coding will be. pls help. I am very near.

Text Note area is now available for edition but cannot save data.

Note: I have followed video from Stefan Krauth. (http://scn.sap.com/community/business-bydesign/studio/blog/2014/04/02/sap-application-studio-1402-ad...)

Alim

Former Member
0 Kudos

//Get old quote data

qryQuote_QueryByElements = CustomerQuote.QueryByElements;

selParamsQuote_QueryByElements = qryQuote_QueryByElements.CreateSelectionParams();

selParamsQuote_QueryByElements.Add(qryQuote_QueryByElements.ID.content, "I","EQ", this.ID.content);

qryQuote_Result = qryQuote_QueryByElements.Execute(selParamsQuote_QueryByElements);

var cont = qryQuote_Result.Count();

if (cont == 0) { //creation phase -> create custom bo instance

  var vQuoteParty = QuoteParty.Retrieve(this.ID);

  if(!vQuoteParty.IsSet())

  {

                vQuoteParty = QuoteParty.Create();

                vQuoteParty.quoteID = this.ID;

                vQuoteParty.load_parties();

  }

  return;

}

Former Member
0 Kudos

Hi Alessandro,

Sorry, I am still new to SDK and not familiar with SDK Coding yet. Given query is for Customer Quote info. Can you please give me simple code which should instantiate Custom BO in my Appointment XBO.

Alim

Former Member
0 Kudos

qryApp_QueryByElements = Activity.QueryByElements;

selParamsApp_QueryByElements = qryApp_QueryByElements.CreateSelectionParams();

selParamsApp_QueryByElements.Add(qryApp_QueryByElements.ID, "I","EQ", this.ID.content);

selParamsApp_QueryByElements.Add(qryApp_QueryByElements.TypeCode, "I","EQ", "12");

qryApp_Result = qryApp_QueryByElements.Execute(selParamsApp_QueryByElements);

var cont = qryApp_Result.Count();

Former Member
0 Kudos

NB: try, but I know that with the activity the query creates some problems to the current instance. If you have some problems come back here.

Former Member
0 Kudos

Hi Alessandro,

You have been great help so far. I finally understood what you meant in your ealier replies and I found that I made silly mistake in binding i.e. in Inport I should give Bind Parameter same as AppointmentID. Finally Text Note can be saved now.

Now, when I am trying add one more dependent Object with same type for second Note, it is not allowing me. Please advice how can I add one more Text Note.

[AlternativeKey] element ZappID: BusinessTransactionDocumentID;

[DependentObject(TextCollection)] node TextCollectionSingleText;

[DependentObject(TextCollection)] node TextCollectionSingleText;

I just found in doc that MULTITEXT key word will help to get more than one TEXT Notes areas.


Alim

Former Member
0 Kudos

Mmmmmm yes maybe you have to use a multi text collection and the related reuse component, but I don't know how to help on this point I am sorry

Former Member
0 Kudos

Hi Alessandro,

One quick query, I have added 3 Notes to Appointment and it looks good.

I have used Text Type Code 10006 / 10008 / 10009 resp in SDK. But facing following message.

Does that mean I need to add Text Type Code 10008 & 10009 to config?

Alim

Former Member
0 Kudos

Hi Alim,

I circumvented the problem with multiple entries by having multiple references to TextCollection and binding the Embedded Component to the subnodes:


node Notice1[1,1] {

    element ID : ID;

    [DependentObject(TextCollection)] node FinalNoticeContent;

}

node Notice2 [1,1] {

    element ID : ID;

    [DependentObject(TextCollection)] node NotesContent;

}

Former Member
0 Kudos

Thanks Ludger,

This has helped me. Initially without TextTypeCode, Cloud UI gave me error to maintain that. After maintaining there is no error now while saving anything.

I can get Notes similar to earlier ones but they are not editable. I cannot enter any data here.

Please advice.

Alim

Former Member
0 Kudos

This could be caused by not having the subnotes initially created.

You could try to add some code like the following in your Root-Event-AfterModify:


if (!this.Notice1.IsSet()) {

     this.Notice1.Create();

}

if (!this.Notice2.IsSet()) {

     this.Notice2.Create();

}

Former Member
0 Kudos

Hi Ludger,

Still no success. Notes are still in display mode.

I will explain you here how it is developed so far.

1. Custom BO with Notice definition what you gave.

2. Custom EC with singletextedit ui and binded to Notice - Text.

3. Data Model Bindings

4. In Custom BO - Root - After Modify Event, code as you mentioned.

I have followed video for binding https://www.youtube.com/watch?v=kGxEjTWAEsM

Alim

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alim, Tim, et al.,

The Business Configuration mention the Text Type 1006 for the schema PDI_002.

The errors listed above are only shown for 1008 and 1009.

May you give it another try?

Bye,

  Horst

Former Member
0 Kudos

Hi Horst,

Can you advice where Configuration Profile PDI_002 area can be seen.

I tried with different codes but all gets erros except 10006.

Is it something on CRM On Premise or Cloud UI and not SDK because I checked many areas in SDK

Alim

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Alim,

I've checked in the backend.

Sorry,

   Horst

Former Member
0 Kudos

Hi Horst / Alessandro,

Many Thanks for all your help and inputs.

I removed code for main TEXTCOLLECTION and defined multiple TEXTCOLLECTIONs in Nodes.

On UI, I used ToolBox - TextEdit and binded it with my node text in DataModel tab.

Hence, everything is working good now.

Alim

0 Kudos

Hello Alim,

could you explain how have you binded TextEdit with the node text?

I've created a Stucture, binded it to the node "Text" of the TextCollectionSingleText and used it as a Value for the TextEdit element.

When I'm doing this, i'm getting a message in the text field, and this field is not editable

Regards,

Leonid.

Former Member
0 Kudos

Hi Gerhard/Leonid

Did you set the associaton filters for the text collection?

If not, here is what you need to do:

In UI-Designer, DataModel-View:

  1. Right-Click on the Bound Text Feld
  2. Select "Filtered Associations"
  3. Modal Dialog opens
  4. On the left side of the dialog, select "TextTypeCode"
  5. On the right side of the dialog, set the filter parameter of the text type code to "10006"
  6. On the left side of the dialog, select "LanguageCode"
  7. On the right side of the dialog, set the filter parameter of the language code to "E" (for english)
    • use a different SAP language code if applicable for your case
Former Member
0 Kudos

Hi Gerhard / Ludger,

Actually when you use code 10006, then you can only have one Text Node per Custom BO.

I used same earlier but it was not working because I required 3 similar Text Note fields.

If you drag drop Text edit field, then no need of any code and all.

You can follow video for ID binding to save Text data. Cloud Application Studio: Add Facet (Embedded Component) based on BO Extensions - YouTube

Let me explain you steps I followed.

1. Declare Text Collection Type element inside Node, this will enable to have multiple Text fields within one BO.

  node Note1[1,1]

  {

  element ID:ID;

  [DependentObject(TextCollection)] node FIELD1;

  }

  node Note2[1,1]

  {

  element ID:ID;

  [DependentObject(TextCollection)] node FIELD2;

  }

2. On UI Screen of Embedded Component of Custom BO, drag and drop TextEdit box from Toolbox to the screen - Pane Container.

3. In Data Model view, bind left side text field TEXTEDIT1 (just dragged dropped earlier) to BO declaration right side field NOTE1 - FIELD1 - TEXT - TEXTCONTENT - TEXT.

Hope this helps.

Alim

Former Member
0 Kudos

Hi Gerhard / Ludger,

Actually when you use code 10006, then you can only have one Text Node per Custom BO.

I used same earlier but it was not working because I required 3 similar Text Note fields.

If you drag drop Text edit field, then no need of any code and all.

You can follow video for ID binding to save Text data. Cloud Application Studio: Add Facet (Embedded Component) based on BO Extensions - YouTube

Let me explain you steps I followed.

1. Declare Text Collection Type element inside Node, this will enable to have multiple Text fields within one BO.

  node Note1[1,1]

  {

  element ID:ID;

  [DependentObject(TextCollection)] node FIELD1;

  }

  node Note2[1,1]

  {

  element ID:ID;

  [DependentObject(TextCollection)] node FIELD2;

  }

2. On UI Screen of Embedded Component of Custom BO, drag and drop TextEdit box from Toolbox to the screen - Pane Container.

3. In Data Model view, bind left side text field TEXTEDIT1 (just dragged dropped earlier) to BO declaration right side field NOTE1 - FIELD1 - TEXT - TEXTCONTENT - TEXT.

Hope this helps.

Alim

Former Member
0 Kudos

Hi Alim.

If you model this directly in UI-Designer instead of using the SAP-provided Embedded Component:

Did you try to set the Filtered associations as I described above?

Best regards,

Ludger

Former Member
0 Kudos

Hi Ludger,

Yes, I had tried that and it works with filter i.e. 10006 code. Here, no need to declare as multiple nodes in Custom BO and also no need to use Text Edit from toolbox.

But you need to drag drop Single Text Edit from Configuration Explorer - SAP_BYD_APPLICATION_UI - REUSE - NOTES - SINGLETEXTEDIT.

Then do binding there itself.

Alim

0 Kudos

Hi Ludger,

what do you mean by "Right-Click on the Bound Text Feld"?

Whatever field I click on (on the top of the textcollection, or on the text,  or whatever on every hierachy level) I get the message  "The BO Association to which this data model is associated do not have any filter parameters specified":

In the BO I use the following definition:

node Comment {

     DependentObject(TextCollection) node TextCollectionComment;

....

0 Kudos

Hi Alim,

yes, that helped, thank you!

I would of course prefer the SAP-Embedded UI (SAP_BYD_APPLICATION_UI - REUSE - NOTES - SINGLETEXTEDIT), as it is specially designed for this case.

As a workaround TextEdit works.

Regards,

Leonid

Former Member
0 Kudos

Hello Tim,

Could you please let me know on steps you followed to add Notes field as type TEXT. I have similar requirement to add 2 TEXT areas similar to Notes in Overview section of Appointment on C4C.

Alim

Former Member
0 Kudos

Hi Alim,

I've similar requirement for my project. Can you share the approach that you took for this?


Regards,

Sandeep