Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to get the value from int64 field asset type to str

(0) ShareShare
ReportReport
Posted on by 172
Hi,
I have a requirement to display the asset type value in my custom form based on asset id where asset type is of int64 type. 
I have tried using display method and also used find method and tried to insert, I've even used int642str. But the asset type value is being displayed as some numeric value like : /5637146132/. I've checked in SQL also, it shows 5637146132 for asset type field. But in front end it shows as string. 

How can I get the string value displayed for the asset type field?
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,969 Super User 2025 Season 1 on at
    How to get the value from int64 field asset type to str
    Hi RSX,
     
    Can you tell if the reply from Deepak where he shared a coding tip helped you? If so, would you mind to verify his answer so this post will get the status answered
  • RSX Profile Picture
    RSX 172 on at
    How to get the value from int64 field asset type to str
    Hi Deepak,

    I've checked the relation and  relation was with rec id and used the same to find using rec id and inserted the actual table's (objecttype) string value and it worked fine now. Thanks.
  • Deepak Agarwal Profile Picture
    Deepak Agarwal 8,564 on at
    How to get the value from int64 field asset type to str
    btw, assetType is std ENUM in system,
  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 8,564 on at
    How to get the value from int64 field asset type to str
    It seems AssetType in your table is rec if of the original table, first you need to find the relation to the actual table where you may find some string value of AssetType. 
    As you may have noted it's Int64 which is supposed to be a numeric value and that wast you are getting when converting it to a string. 
     
    So all you need to do is go to your table relation find the parent table of AssetType and write logic to feth value, for eg, 
     
    select assetTypeTable
    where assetTypeTable.assetType == AssetType;
     
    return assetTypeTable.Description or name
  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    How to get the value from int64 field asset type to str
    Please give us more details. What value from which table are you trying to get?
     
    Also, where does you custom form gets the value? From a table field? If so, which one?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans