on 09-16-2015 1:59 PM
Hello,
I am trying to fill the snadard Note field on standard Opportunity TI using ABSL beforeSave script.
If the note in opportunity is already set, the script will successfully edit the note. This is working.
this.TextCollection.Text.TextContent.GetFirst().Text.content = "new note text";
BUT if the original note on opportunity is empty, the script fails. The reason is because the TextCollection instance is not set yet. So my question is how to create new note using ABSL (standard BO). My script always fails at line 3. It says I need to set TypeCode of the note. I am able to set the TypeCode after the Create(), not before.
if(!this.TextCollection.IsSet()){ // this = Opportunity root
var tc = this.TextCollection.Create();
var txt = tc.Text.Create(); // it trows error here - set TypeCode for notes
txt.TypeCode.content = "10002";
var txtCont = txt.TextContent.Create();
txtCont.Text.content = "new note text";
}
Please help
Kind Regards
Michal
Hello Michal,
I suggest to provide the TypeCode with the Create:
var tc = this.TextCollection.Create();
var txtData : elementsof Opportunity.TextCollection.Text;
txtData.TypeCode.content = "1002";
tc.Text.Create( txtData );
HTH,
Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mischa,
I am no longer with this department (for a long time already 😉 ). but I suggest to replace the "Opportunity.TextCollection" with "CustomerInvoiceRequest.Item.ItemTextCollection" and give it a try.
All the best,
. Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.