Skip to Content

Creating elementsof a TextCollection node.

Hi All,

We have a requirement in which on save we have to transfer the data of one TextCollection node in a custom BO to another TextCollection node in another custom BO. I tried using "elementsof" TextCollection node but it is not populating with the .create option. So I am not able to copy data to the target TextCollection.

ex. var a : elementsof ZCostSheet.TextColl.Particular.Text.TextContent

a.FormattedText.content = "Demo text";

now when I try to create ZCostSheet.TextColl.Particular.Text.TextContent.Create(a);

the .create option does not populate after TextContent.

Thanks

Jayant

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 22, 2017 at 05:02 AM

    Hi Jayant,

    You may need to check the deployment unit of your Solution as when i try to copy the OPPORTUNITY to my Custom BO Text node I am able to pass the data.

    Please find below the example for same:

    BO Definition:

    import AP.Common.GDT as apCommonGDT;
    [DeploymentUnit(CustomerRelationshipManagement)] businessobject ZCustom {
    [AlternativeKey] element ID : ID;
    element description : Description;
    element Number : DecimalValue;
    [DependentObject(TextCollection)] [LanguageIndependent] node TextCollection;
    }
    

    ABSL Code in OnSave Event:

    import ABSL;
    import AP.CRM.Global;
    var q = Opportunity.QueryByElements;
    var p = q.CreateSelectionParams();
    p.Add( q.ID.content,"I","EQ","46248");
    var t = q.Execute(p).GetFirst().TextCollection.Text.GetFirst().TextContent.Text.content;
    if (!this.TextCollection.IsSet())
    {
    	var n = this.TextCollection.Create();
    	if ( n.IsSet())
    	{
    		if (!n.Text.GetFirst().IsSet())
    		{
    			n.Text.Create().TextContent.Create().Text.content = t; 
    		}
    	}
    }
    

    Thanks

    Saurabh

    Add comment
    10|10000 characters needed characters exceeded