Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Answered

How to Encode the URL in C/AL !!

Posted on by 35

Dear All,

Version BC 14.0

while sending the Items from Nav to Salesforce when the item no. is having "/" Like '4197RRBK-M/L' its giving the error.

How to correct this error.

"The requested resource does not exist"

Source:

TmpBlob.INIT();
TmpBlob.Blob.CREATEOUTSTREAM(OutStrm1);
OutStrm1.WRITETEXT(Json.ToString());

//HttpWebRequestMgt.Initialize('XXXXXXXXXX/' itemno);

HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('PATCH');
HttpWebRequestMgt.AddHeader('Authorization','Bearer '+GetBearerToken());
HttpWebRequestMgt.SetReturnType('application/json');
HttpWebRequestMgt.SetContentType('application/json');
HttpWebRequestMgt.AddBodyBlob(TmpBlob);
ServicePointManager.SecurityProtocol(SecurityProtocol.Tls12);

  • Verified answer
    Jagathees Elango Profile Picture
    Jagathees Elango 35 on at
    RE: How to Encode the URL in C/AL !!

    Thank you Nam  for the reply and answer.

  • Jagathees Elango Profile Picture
    Jagathees Elango 35 on at
    RE: How to Encode the URL in C/AL !!

    Thank you Yun for the Reply and answer.

  • Suggested answer
    HoangNam Profile Picture
    HoangNam 315 on at
    RE: How to Encode the URL in C/AL !!

    You can use standard Codeunit: 

           TypeHelper: Codeunit "Type Helper";
    Example:  
         
          ConvertedTxt := TypeHelper.UrlEncode(CIPhertxt);
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,933 Super User 2024 Season 2 on at
    RE: How to Encode the URL in C/AL !!

    Hi, hope the following helps.

    https://forum.mibuso.com/discussion/45344/xmlport-and-webservice-performance-amp-encoding-problems

       

    Thanks.
    ZHU

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans