1

I have a text field X where User can write a long or a short string. In an other text field Y, I need to get the first two caracters of that field X. I don't want to do this with JS since it will not be executed if a record is created with import. Is there any way to do this without using c# plugin?

Thanks in advance,

toto1999
  • 203
  • 1
  • 11
  • Not sure what code you have now, but what events do you have for the textfield the user is typing in? – Hace Jan 05 '17 at 15:16
  • I don't have any js code for that since I've already found that js code will not be usefull in import, so I am looking for a way to do this without js. A plugin can do that well in normal creation and import but I dont' want to use plugins. – toto1999 Jan 05 '17 at 15:27
  • What are you trying to achieve? Fill a second textbox with the two characters or fill some data with the first two chars? – Hace Jan 05 '17 at 15:35
  • I have a text field X: The user can write for example: 123456.. or abcd... I want to initialise the other text field Y with : 12 or ab – toto1999 Jan 05 '17 at 15:39
  • from a dynamics crm import perspective, not possible, you either need a plugin/custom workflow that does the job. – dynamicallyCRM Jan 05 '17 at 16:22
  • I'd like to do this with a workflow but I don't find any way to get the two first characteres of a text field, do you have any idea about this plz? – toto1999 Jan 05 '17 at 16:49
  • 1
    custom code: plugin or a custom workflow activity to take the first 2 chars – Guido Preite Jan 05 '17 at 23:18

2 Answers2

4

You will need to either use either a plugin or custom workflow activity for this.

Luckily, Gap Consulting provide a custom workflow activity which should hopefully suit this.

Download and install Gap Consulting Workflow Essentials (it's free).

Create a workflow and then use the custom workflow activity, Gap String Functions > Gap.StringFunctions.SubString.

Inputs:

  • Text: Field X
  • From Left to Right: True
  • Start Index: 0
  • Length: 2.

You can then copy the output from that into field Y.

Full discloure; I work for Gap Consulting

James Wood
  • 17,286
  • 4
  • 46
  • 89
1

Manipulation Library can help you too for CRM 2011.

You should pick the method ManipulationLibrary.Strings.Substring. Its use is exactly the same as James Wood describes for his tool.

Inputs:

  • Text: Input field
  • From Left to Right: True
  • Start Index: 0
  • Length: 2
Sxntk
  • 845
  • 14
  • 29