Announcements
Dear All,
I have created one Custom report for Account Entity and wrote an Expression for address1_line1 and address1_line2 Field, its not working(please refer below mentioned Expression). I have tried in Two different instances which are online D365 version, Since i am facing the issue from Yesterday., after deploying in CRM instance i m getting as #Error in that Column.
Expression :=iif(Fields!address1_line1.Value,Fields!address1_line1.Value,Fields!address1_line2.Value)
Please suggest me for the same.
Regards,
Krishna.
*This post is locked for comments
Dear All,
we have wrote three Expression by using different Place holders that is resolved.
Regards,
Krishna
Hi preeti,
Thanks for your reply!
i tried using & also it didn't worked for me.
Regards,
Krishna
HI Samrando,
Thanks for your reply!
i tried the above mentioned expression it didn't worked for me.
Regards,
Krishna
Hi Krishna,
Please try below code:
IIF(IsNothing(Fields!address1_line1.Value) AND IsNothing(Fields!address1_line2.Value),"",
IIF(!IsNothing(Fields!address1_line1.Value) AND !IsNothing(Fields!address1_line2.Value), Fields!address1_line1.Value +","+ Fields!address1_line2.Value,
IIF(IsNothing(Fields!address1_line1.Value) AND !IsNothing(Fields!address1_line2.Value ), Fields!address1_line2.Value,
IIF(IsNothing(Fields!address1_line2.Value ) AND !IsNothing(Fields!address1_line1.Value), Fields!address1_line1.Value,""))))
Hello Krishna,
In your expression where you are trying to concatenate the string as below:
iif((Fields!address1_line1.Value) AND (Fields!address1_line2.Value), Fields!address1_line1.Value +","+ Fields!address1_line2.Value
Can you please try to concatenate using "&" instead of "+" as follow:
iif((Fields!address1_line1.Value) AND (Fields!address1_line2.Value), Fields!address1_line1.Value &","& Fields!address1_line2.Value
Hope this helps:)
Thanks
Preeti Sharma
Hi Dynamics365 Rocker,
Thanks for your reply!
please go through the below mentioned Expression which i am trying to achieve and at the end its showing me the error in the report like this.#Error
=iif(isnothing(Fields!address1_line1.Value) AND isnothing(Fields!address1_line2.Value),"",
iif((Fields!address1_line1.Value) AND (Fields!address1_line2.Value), Fields!address1_line1.Value +","+ Fields!address1_line2.Value,
iif(isnothing(Fields!address1_line1.Value) AND (Fields!address1_line2.Value ), Fields!address1_line2.Value,
iif(isnothing(Fields!address1_line2.Value ) AND (Fields!address1_line1.Value), Fields!address1_line1.Value,""))))
Please advice me for the same if i wrote anything wrong in above mentioned expression.
Regards,
Krishna.
First of all describe that what do you want to achieve by this condition.
You must write your condition like this:
=iif(Fields!address1_line1.Value!=null,Fields!address1_line1.Value,Fields!address1_line2.Value)
Hi Krishna
I just wrote this by head without testing but please check it out. I derived it from the options you have provided above. if 'and' logic operator doesn't work try 'Or'
=IIf(IsNothing(Fields!address1_line1.Value), Fields!address1_line2.Value,
IIF(IsNothing(Fields!address1_line2.Value),Fields!address1_line1.Value,
IFF(IsNothing(Fields!address1_line1.Value) and IsNothing(Fields!address1_line1.Value), "Null", Fields!address1_line1.Value & & Fields!address1_line1.Value))
HI Abby Kong,
Thanks for your response !
I will check with that and update you shortly.
Regards,
Krishna.
Hi Krishna,
Would suggest implementing this in Dynamics to reuse in multiple reports.
----------------------------------------------------------------------------------
You only post the business logic and didn't post the code to check where is wrong?To implement the blow logic in report, try switch function, based on the different conditions, pick a value from line1, line 2, line1&", "&line2, null
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/switch-function
1) if the address1_line1 doesn't have data and address1_line2 has data, print address1_line2.
2)if the address2_line2 doesn't have dataand address1_line1 has data print address1_line1
3) if address1_line1 and address1_line2 both having data print like this - address1_line1, adress1_line2
4)if address1_line1 and address1_line 2 both are not having data than print as null
Regards,
Abby
André Arnaud de Cal...
293,829
Super User 2025 Season 1
Martin Dráb
232,757
Most Valuable Professional
nmaenpaa
101,158
Moderator