web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Fetch the whole number field using C#

(0) ShareShare
ReportReport
Posted on by 568

Hi,

I am new to CRM and i want to get the value of whole number field and set it to another field in another entity.

Please advise since i am unable to find.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    You can do it from fect xml.

    Below post may help you to do fetch XML:

    crmbusiness.wordpress.com/.../fetchxml

    After getting result,You can directly assign value of one Whole number field to another one then call service.update().

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Please check below reference  , how to retrieve data using fetchXML-

    https://arunpotti.wordpress.com/2014/12/10/retrieve-records-using-fetchxml-c-sdk-in-crm/

    Once you retrieve the entity here is sample code to get the whole number field value.

    Int32 PinCode = Convert.ToInt32(entity.Attributes["new_PinCode"].ToString());


    Here is sample code of create , retrieve and update  -

    https://woodsworkblog.wordpress.com/2017/06/25/create-retrieve-update-delete-365-data-in-a-late-bound-fashion/

  • Kokulan Profile Picture
    18,054 on at

    Hi

    Could you please let us know when and how you are planning to do this? Do you want to do this within CRM using plugin or workflow? Or Are you planning to do this outside of CRM using a console app or by other means?

    Once you provided the details on this, we should definitely be able to give you the appropriate example.

    If you are not sure of how you can approach this, please share a bit more detail on your requirement and we should definitely be able to help you

  • Suggested answer
    Pawar Pravin Profile Picture
    5,237 on at

    Hi AXTechie2120,

    In case if you want to use whole no field in plugin or console, refer following code:

    //Getting value

    Int32 variablename = entityObject.Attributes.Contains("attributelogicalname") ? entityObject.GetAttributeValue<int>("attributelogicalname") : 0;

    //Setting Value

    Entity OtherEntityObject = new Entity("otherentitylogicalname");

    OtherEntityObject["otherentitylogicalname"] = variablename;

    In case if you are using workflow you can set it directly.

    If you are using javascript then there is no conversion required for whole number.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans