Skip to main content

Notifications

Announcements

No record found.

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

how get default dimension recid using its display value

(0) ShareShare
ReportReport
Posted on by 490
i have a default dimesnion named /Fund/ and its display value as /567/ , how to get the recid for this deafult dimension value , please help me
  • Suggested answer
    Sachin Mittal Profile Picture
    Sachin Mittal 490 on at
    how get default dimension recid using its display value
    i am updating one of your replies as suggest answer , but screen keeps loading after clicking on it
  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    how get default dimension recid using its display value
    It seems that the question how get default dimension recid using its display value has been answered, so please verify the answer.
     
    The query will tell you whether the such a value was already used as a financial dimension; that is hasn't been doesn't mean that it can't be. If you have more question on this other topic, please create a new thread for them.
  • Sachin Mittal Profile Picture
    Sachin Mittal 490 on at
    how get default dimension recid using its display value
    can i validate this default fault dimension value using same code , i means if dimensionAttributeValue.recid exists , dimension value is correct otherwise it is wrong ?
     container                           dimCon = str2con("11030-101", "-");
            
            dimensionAttributenew       = DimensionAttribute::findByName('Fund');
            dimensionAttributeValue     = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(dimensionAttributenew, conPeek(dimCon, 2), false, true);
    
           
    
          
            if (!dimensionAttributeValue.RecId)
            {
                throw error("Financial dimensions fund value is not correct.");
            }
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    how get default dimension recid using its display value
    The value of the first parameter is wrong. You're passing a string, while the actual type is DimensionAttribute table. Use DimensionAttribute::findByName() to find the record.
  • Sachin Mittal Profile Picture
    Sachin Mittal 490 on at
    how get default dimension recid using its display value
      i used this dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError('Fund', '101', false, true); but giving error
    Type mismatch in 'DimensionAttributeValue.findByDimensionAttributeAndValueNoError' argument 1. The expected type is 'DimensionAttribute', but the actual type is 'str'.   
     
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    how get default dimension recid using its display value
    If you mean in code, use DimensionAttributeValue::findByDimensionAttributeAndValue().RecId.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans