locked
Change attribute value in plugin RRS feed

  • Question

  • So i know how to do it in jscript but i need to do it during a plugin(for various reasons).

    During Jscript it would be..

    crmForm.all.quantity.DataValue

    but how would i access this during the plugin? I want to take a value from an attribute, change it and put it back with the changed text.

    Thanks in Advance

    Below is what i have, it should take it all, format it and give it back, but how would i save it back to the form/attribute?

     

    DynamicEntity target =

    (

    DynamicEntity)context.InputParameters[ParameterName.Target];

    target[

    "description"] = ConvertHTMLToText(Convert.ToString(target["description"]));

    Monday, January 11, 2010 9:52 PM

Answers

  • Hi, Boris.

    You are right! You can use following alhorytm:

    DynamicsEntity target = (DynamicEntity)context.InputParameters["Target"];

    string description = (string)target["description"];
    //manipulations with text
    target["description"] = description;

    context.InputParameters["Target"] = target;

    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)free countersLocations of visitors to this page
    Monday, January 11, 2010 9:56 PM
    Moderator

All replies

  • Hi, Boris.

    You are right! You can use following alhorytm:

    DynamicsEntity target = (DynamicEntity)context.InputParameters["Target"];

    string description = (string)target["description"];
    //manipulations with text
    target["description"] = description;

    context.InputParameters["Target"] = target;

    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)free countersLocations of visitors to this page
    Monday, January 11, 2010 9:56 PM
    Moderator
  • Hi boris37,

    I face the same problem today. Have you succeeded to change the inputparameter in plugin?

    It's said in SDK readonly. So I wanna if you are able to work around it. 
    Thursday, January 14, 2010 4:32 PM
  • Yeah i am however i cannot get my formatting correctly.. which is another issue entirely.

    Be sure you run the plugin in the right post or pre as well. I am running on update to do some testing but it will only update on pre-stage on the parent pipeline.

    Thursday, January 14, 2010 5:06 PM