Return Ownership Profile Name

Discussions related to ReadyDoc development.
Post Reply
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Return Ownership Profile Name

Post by kendale.wyatt »

What's the best way to pull just the name of the Ownership Profile? I tried {{Order.OwnershipProfile.Name}} but the error that returns in "The 'Name' field does not exist on context 'ProfileInfo'. "

When I just use {{Order.OwnershipProfile}} I get the full path like Default\Test&Training\Development&Production but I just need the name of the profile which is "Development&Production" in this example.

Thanks!
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Return Ownership Profile Name

Post by BobRichards »

Have you tried: {{Order.OwnershipProfile.Name}}
Bob Richards, Senior Software Developer, SoftPro
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Re: Return Ownership Profile Name

Post by kendale.wyatt »

I did, that's when I get the error message:
"The 'Name' field does not exist on context 'ProfileInfo'."
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Return Ownership Profile Name

Post by BobRichards »

I asked a colleague in the documents department to take a look at your problem. He agreed with you that {{Order.OwnershipProfile.Name}} does not exist. He created some code to help you get the value. If you have any issues, please check back with us with the symptoms.
<VAR $ProfileName ("")>
<VAR $Slash1 (InString({{Order.OwnershipProfile}},"\"))>
<VAR $IsSlash2 ({{$Slash1}}+1)>
<IF (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0),"\")>0)>
<VAR $Slash2 (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0),"\"))>
<VAR $IsSlash3 ({{$Slash1}}+{{$Slash2}}+1)>
<IF (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0),"\")>0)>
<VAR $Slash3 (InString(SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0),"\"))>
<ELSE>
<VAR $ProfileName (SubString({{Order.OwnershipProfile}},{{$IsSlash3}},0))>
</IF>
<ELSE>
<VAR $ProfileName (SubString({{Order.OwnershipProfile}},{{$IsSlash2}},0))>
</IF>

All they have to do is add the coding above to their document – and wherever they want to display the Profile Name, simply use the Variable Field Code {{$ProfileName}}

Hope this helps!
Bob Richards, Senior Software Developer, SoftPro
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Re: Return Ownership Profile Name

Post by kendale.wyatt »

That worked perfectly, thank you!
Post Reply